/** * Add options to a list from an array or map. * @param elementId The HTML element to update (by id) * @param array And array of objects from which to create options * @param property The object property to use for the option value and text */ public static void addOptions(String elementId, Collection<?> array, String property) { ScriptSessions.addFunctionCall("dwr.util.addOptions", elementId, array, property); }
/** * Call a named function with one parameter. * @param funcName The name of the function to call * @param params The parameters to the above function */ public static void addFunctionCall(String funcName, Object... params) { ScriptSessions.addFunctionCall(funcName, params); }
/** * Send some data to the client and have the browser offer it for download * @param ft The data to be downloaded */ public static void openInDownload(FileTransfer ft) { ScriptSessions.addFunctionCall("dwr.engine.openInDownload", ft); }
/** * Add options to a list from an array or map. * @param elementId The HTML element to update (by id) * @param array And array of objects from which to create options * @param valueProperty The object property to use for the option value * @param textProperty The object property to use for the option text */ public static void addOptions(String elementId, Collection<?> array, String valueProperty, String textProperty) { ScriptSessions.addFunctionCall("dwr.util.addOptions", elementId, array, valueProperty, textProperty); }
/** * $(ele).className += "X", that we can call from Java easily. * @param elementId The HTML element to update (by id) * @param className The CSS class to add to the element */ public static void addClassName(String elementId, String className) { ScriptSessions.addFunctionCall("dwr.util.addClassName", elementId, className); }
public void run() { ScriptSessions.addFunctionCall("riot.showNotification", message); } });
/** * Remove all the children of a given node. * @param elementId The HTML element to update (by id) */ public static void removeAllRows(String elementId) { ScriptSessions.addFunctionCall("dwr.util.removeAllRows", elementId); }
/** * Send some data to the client and have the browser offer it for download * @param blob The data to be downloaded */ public static void openInDownload(byte[] blob) { ScriptSessions.addFunctionCall("dwr.engine.openInDownload", blob); }
/** * Send some data to the client and have the browser offer it for download * @param in The data to be downloaded */ public static void openInDownload(InputStream in) { ScriptSessions.addFunctionCall("dwr.engine.openInDownload", in); }
/** * Show in an 'alert' dialog * @param message The text to go into the alert box */ public static void alert(String message) { ScriptSessions.addFunctionCall("alert", message); }
/** * Attempt to close this window */ public static void close() { ScriptSessions.addFunctionCall("close"); }
/** * Open a new browser child window, pointing at given <code>url</code> and * identified with a given <code>windowName</code>. * @see #open(String, String, OptionBuilder) for more details */ public static void open(String url, String windowName) { ScriptSessions.addFunctionCall("open", url, windowName); }
/** * Add options to a list from an array or map. * @param elementId The HTML element to update (by id) * @param array An array of strings to use as both value and text of options */ public static void addOptions(String elementId, String[] array) { ScriptSessions.addFunctionCall("dwr.util.addOptions", elementId, array); }
/** * Clone a given node. * @param elementId The HTML element to update (by id) */ public static void cloneNode(String elementId) { ScriptSessions.addFunctionCall("dwr.util.cloneNode", elementId); }
/** * $(ele).className = "X", that we can call from Java easily * @param elementId The HTML element to update (by id) * @param className The CSS class to set for the element */ public static void setClassName(String elementId, String className) { ScriptSessions.addFunctionCall("dwr.util.setClassName", elementId, className); }
/** * $(ele).className -= "X", that we can call from Java easily From code originally by Gavin Kistner * @param elementId The HTML element to update (by id) * @param className The CSS class to remove from the element */ public static void removeClassName(String elementId, String className) { ScriptSessions.addFunctionCall("dwr.util.removeClassName", elementId, className); }
/** * $(ele).className |= "X", that we can call from Java easily. * @param elementId The HTML element to update (by id) * @param className The CSS class to toggle on/off */ public static void toggleClassName(String elementId, String className) { ScriptSessions.addFunctionCall("dwr.util.toggleClassName", elementId, className); }
/** * Open a new browser child window, pointing at given <code>url</code> and * identified with a given <code>windowName</code>. * @param windowName The window name can be one of the special values: * _blank, _parent, _self, _top. */ public static void open(String url, String windowName, OptionBuilder builder) { ScriptSessions.addFunctionCall("open", url, windowName, builder.createWindowFeatures()); }
/** * Set the value an HTML element to the specified value. * @param elementId The HTML element to update (by id) * @param value The text to insert into the HTML element * @param escapeHtml Should we escape HTML characters? */ public static void setValue(String elementId, Object value, boolean escapeHtml) { ScriptSessions.addFunctionCall("dwr.util.setValue", elementId, value, getEscapeOptions(escapeHtml)); }
/** * Given a map, call setValue() for all the entries in the map using the * entry key as an element id. * @param values The map of elementIds to values to alter * @param escapeHtml Should we escape HTML characters? */ public static void setValues(Map<?, ?> values, boolean escapeHtml) { ScriptSessions.addFunctionCall("dwr.util.setValues", values, getEscapeOptions(escapeHtml)); }