use of org.directwebremoting.ScriptBuffer in project aries by apache.
the class ServerSideClass method addFunctionCall.
private void addFunctionCall(String name, Object... params) {
final ScriptBuffer script = new ScriptBuffer();
script.appendScript(name).appendScript("(");
for (int i = 0; i < params.length; i++) {
if (i != 0)
script.appendScript(",");
script.appendData(params[i]);
}
script.appendScript(");");
Browser.withAllSessions(new Runnable() {
public void run() {
for (ScriptSession s : Browser.getTargetSessions()) {
s.addScript(script);
}
}
});
}
use of org.directwebremoting.ScriptBuffer in project ma-core-public by infiniteautomation.
the class ScriptProxy method addFunctionCall.
/**
* Call a named function with one parameter.
* @param funcName The name of the function to call
* @param param1 The first parameter to the above function
* @param param2 The second parameter to the above function
* @param param3 The third parameter to the above function
*/
public void addFunctionCall(String funcName, Object param1, Object param2, Object param3) {
ScriptBuffer script = new ScriptBuffer();
script.appendScript(funcName).appendScript("(").appendData(param1).appendScript(",").appendData(param2).appendScript(",").appendData(param3).appendScript(");");
addScript(script);
}
use of org.directwebremoting.ScriptBuffer in project ma-core-public by infiniteautomation.
the class Engine method setHttpMethod.
/**
* Which HTTP method do we use to send results? Must be one of "GET" or "POST".
* @param httpMethod One of {@link #XMLHttpRequest}, {@link #IFrame} or {@link #ScriptTag}
* @see <a href="http://getahead.org/dwr/browser/engine/options">Options documentation</a>
*/
public void setHttpMethod(String httpMethod) {
ScriptBuffer script = new ScriptBuffer();
script.appendScript("dwr.engine.setHttpMethod(").appendData(httpMethod).appendScript(");");
addScript(script);
}
use of org.directwebremoting.ScriptBuffer in project ma-core-public by infiniteautomation.
the class Engine method setTimeout.
/**
* Set a default timeout value for all calls. 0 (the default) turns timeouts off.
* @param timeout The time to wait in milliseconds
* @see <a href="http://getahead.org/dwr/browser/engine/errors">Error handling documentation</a>
*/
public void setTimeout(int timeout) {
ScriptBuffer script = new ScriptBuffer();
script.appendScript("dwr.engine.setTimeout(").appendData(timeout).appendScript(");");
addScript(script);
}
use of org.directwebremoting.ScriptBuffer in project ma-core-public by infiniteautomation.
the class Engine method setOrdered.
/**
* Ensure that remote calls happen in the order in which they were sent? (Default: false)
* @param ordered True to set call ordering.
* @see <a href="http://getahead.org/dwr/browser/engine/ordering">Ordering documentation</a>
*/
public void setOrdered(boolean ordered) {
ScriptBuffer script = new ScriptBuffer();
script.appendScript("dwr.engine.setOrdered(").appendData(ordered).appendScript(");");
addScript(script);
}
Aggregations