Package com.vaadin.client.flow.binding
Class ServerEventObject
java.lang.Object
com.google.gwt.core.client.JavaScriptObject
com.vaadin.client.flow.binding.ServerEventObject
public final class ServerEventObject
extends com.google.gwt.core.client.JavaScriptObject
A representation of a server object able to send notifications to the server.
- Since:
- 1.0
- Author:
- Vaadin Ltd
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddefineMethod(String methodName, StateNode node, boolean returnPromise) Defines a method with the given name to be a callback to the server for the given state node.static ServerEventObjectget(elemental.dom.Element element) Gets or createselement.static ServerEventObjectgetIfPresent(elemental.dom.Node node) Gets or createselement.Gets the defined methods.protected static com.vaadin.client.flow.binding.ServerEventObject.ServerEventDataExpressiongetOrCreateExpression(String expressionString) voidReject all promises pending on this server object.voidremoveMethod(String methodName) Removes a method with the given name.Methods inherited from class com.google.gwt.core.client.JavaScriptObject
cast, createArray, createArray, createFunction, createObject, equals, hashCode, toSource, toString
-
Constructor Details
-
ServerEventObject
protected ServerEventObject()JSO constructor.
-
-
Method Details
-
defineMethod
Defines a method with the given name to be a callback to the server for the given state node.Note! If the Polymer.Element contains an implementation for
methodNameit will be run before the server-side method.- Parameters:
methodName- the name of the method to addnode- the node to use as an identifier when sending an event to the serverreturnPromise-trueif the handler should return a promise that will reflect the server-side result;falseto not return any value
-
removeMethod
Removes a method with the given name.- Parameters:
methodName- the name of the method to remove
-
getMethods
Gets the defined methods.- Returns:
- an array of defined method names
-
get
Gets or createselement.$serverfor the given element.- Parameters:
element- the element to use- Returns:
- a reference to the
$serverobject in the element
-
getIfPresent
Gets or createselement.$serverfor the given element, if present.- Parameters:
node- the element to use- Returns:
- a reference to the
$serverobject in the element, ornullif note present.
-
getOrCreateExpression
protected static com.vaadin.client.flow.binding.ServerEventObject.ServerEventDataExpression getOrCreateExpression(String expressionString) -
rejectPromises
public void rejectPromises()Reject all promises pending on this server object. Called during client resynchronization to free consumers of promises that are never delivered by the server.
-