use of com.servoy.j2db.persistence.ScriptMethod in project servoy-client by Servoy.
the class JSForm method js_setOnSortCmdMethod.
/**
* @deprecated As of release 4.1, replaced by setOnSortCmd(JSMethod).
*/
@Deprecated
public void js_setOnSortCmdMethod(Object functionOrInteger) {
checkModification();
if (functionOrInteger instanceof Function) {
Function function = (Function) functionOrInteger;
ScriptMethod scriptMethod = getScriptMethod(function, application.getFlattenedSolution());
if (scriptMethod != null) {
getForm().setOnSortCmdMethodID(scriptMethod.getID());
} else {
getForm().setOnSortCmdMethodID(0);
}
} else if (functionOrInteger instanceof Number) {
getForm().setOnSortCmdMethodID(((Number) functionOrInteger).intValue());
}
}
use of com.servoy.j2db.persistence.ScriptMethod in project servoy-client by Servoy.
the class JSForm method js_setOnUnLoadMethod.
/**
* @deprecated As of release 4.1, replaced by setOnUnLoad(JSMethod).
*/
@Deprecated
public void js_setOnUnLoadMethod(Object functionOrInteger) {
checkModification();
if (functionOrInteger instanceof Function) {
Function function = (Function) functionOrInteger;
ScriptMethod scriptMethod = getScriptMethod(function, application.getFlattenedSolution());
if (scriptMethod != null) {
getForm().setOnUnLoadMethodID(scriptMethod.getID());
} else {
getForm().setOnUnLoadMethodID(0);
}
} else if (functionOrInteger instanceof Number) {
getForm().setOnUnLoadMethodID(((Number) functionOrInteger).intValue());
}
}
use of com.servoy.j2db.persistence.ScriptMethod in project servoy-client by Servoy.
the class JSForm method getMethods.
/**
* Returns all existing form methods for this form.
*
* @sample
* var frm = solutionModel.getForm("myForm");
* var methods = frm.getMethods();
* for (var m in methods)
* application.output(methods[m].getName());
*
* @param returnInheritedElements boolean true to also return the elements from the parent form
* @return all form methods for the form
*/
@JSFunction
public JSMethod[] getMethods(boolean returnInheritedElements) {
List<JSMethod> methods = new ArrayList<JSMethod>();
Form form2use = returnInheritedElements ? getFlattenedContainer() : getForm();
Iterator<ScriptMethod> scriptMethods = form2use.getScriptMethods(true);
while (scriptMethods.hasNext()) {
methods.add(new JSMethod(this, scriptMethods.next(), application, false));
}
return methods.toArray(new JSMethod[methods.size()]);
}
use of com.servoy.j2db.persistence.ScriptMethod in project servoy-client by Servoy.
the class JSForm method js_setOnPrintPreviewCmdMethod.
/**
* @deprecated As of release 4.1, replaced by setOnPrintPreviewCmd(JSMethod).
*/
@Deprecated
@ServoyClientSupport(ng = false, wc = true, sc = true)
public void js_setOnPrintPreviewCmdMethod(Object functionOrInteger) {
checkModification();
if (functionOrInteger instanceof Function) {
Function function = (Function) functionOrInteger;
ScriptMethod scriptMethod = getScriptMethod(function, application.getFlattenedSolution());
if (scriptMethod != null) {
getForm().setOnPrintPreviewCmdMethodID(scriptMethod.getID());
} else {
getForm().setOnPrintPreviewCmdMethodID(0);
}
} else if (functionOrInteger instanceof Number) {
getForm().setOnPrintPreviewCmdMethodID(((Number) functionOrInteger).intValue());
}
}
use of com.servoy.j2db.persistence.ScriptMethod in project servoy-client by Servoy.
the class JSForm method js_setOnLoadMethod.
/**
* @deprecated As of release 4.1, replaced by setOnLoad(JSMethod).
*/
@Deprecated
public void js_setOnLoadMethod(Object functionOrInteger) {
checkModification();
if (functionOrInteger instanceof Function) {
Function function = (Function) functionOrInteger;
ScriptMethod scriptMethod = getScriptMethod(function, application.getFlattenedSolution());
if (scriptMethod != null) {
getForm().setOnLoadMethodID(scriptMethod.getID());
} else {
getForm().setOnLoadMethodID(0);
}
} else if (functionOrInteger instanceof Number) {
getForm().setOnLoadMethodID(((Number) functionOrInteger).intValue());
}
}
Aggregations