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.JavaScriptObjectA representation of a server object able to send notifications to the server.- Since:
- 1.0
- Author:
- Vaadin Ltd
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedServerEventObject()JSO constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineMethod(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.$serverfor the given element.static ServerEventObjectgetIfPresent(elemental.dom.Node node)Gets or createselement.$serverfor the given element, if present.JsArray<String>getMethods()Gets the defined methods.protected static com.vaadin.client.flow.binding.ServerEventObject.ServerEventDataExpressiongetOrCreateExpression(String expressionString)voidrejectPromises()Reject all promises pending on this server object.voidremoveMethod(String methodName)Removes a method with the given name.
-
-
-
Method Detail
-
defineMethod
public void defineMethod(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.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
public void removeMethod(String methodName)
Removes a method with the given name.- Parameters:
methodName- the name of the method to remove
-
getMethods
public JsArray<String> getMethods()
Gets the defined methods.- Returns:
- an array of defined method names
-
get
public static ServerEventObject get(elemental.dom.Element element)
Gets or createselement.$serverfor the given element.- Parameters:
element- the element to use- Returns:
- a reference to the
$serverobject in the element
-
getIfPresent
public static ServerEventObject getIfPresent(elemental.dom.Node node)
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.
-
-