{column:width=80px|padding=0px}{column}{column}{column}
Constants Summary
{column:width=80px|padding=0px}{column}{column}{column}
Property Summary
dataSource
The names of the database server and table that this form is linked to.
onRecordSelection
The method that is triggered each time a record is selected.
serverName
Get the server name used by this form.
{column:width=80px|padding=0px}{column}{column}{column}
Method Summary
JSButton[]
getButtons()
Returns all JSButtons of this form, including the ones without a name.
getComponent(name)
Returns a JSComponent that has the given name; if found it will be a JSField, JSLabel, JSButton, JSPortal, JSBean or JSTabPanel.
getComponents()
Returns a array of all the JSComponents that a form has; they are of type JSField,JSLabel,JSButton,JSPortal,JSBean or JSTabPanel.
JSMethod[]
getMethods()
Returns all existing form methods for this form.
[JSPart]
getPart(type)
Gets a part of the form from the given type (see JSPart constants).
getVariable(name)
Gets an existing form variable for the given name.
getVariables()
An array consisting of all form variables for this form.
newCheck(dataprovidername/jsvariable, x, y, width, height)
Creates a new JSField object on the form with the displayType of CHECK (checkbox) - including the dataprovider/JSVariable of the JSField object, the "x" and "y" position of the JSField object in pixels, as well as the width and height of the JSField object in pixels.
newComboBox(dataprovidername/jsvariable, x, y, width, height)
Creates a new JSField object on the form with the displayType of COMBOBOX - including the dataprovider/JSVariable of the JSField object, the "x" and "y" position of the JSField object in pixels, as well as the width and height of the JSField object in pixels.
newField(dataprovidername/jsvariable, displaytype, x, y, width, height)
Creates a new JSField object on the form - including the dataprovider/JSVariable of the JSField object, the "x" and "y" position of the JSField object in pixels, as well as the width and height of the JSField object in pixels.
[JSPart]
newFooterPart(height)
Creates a new Footer part on the form.
[JSPart]
newHeaderPart(height)
Creates a new Header part on the form.
newPassword(dataprovidername/jsvariable, x, y, width, height)
Creates a new JSField object on the form with the displayType of PASSWORD - including the dataprovider/JSVariable of the JSField object, the "x" and "y" position of the JSField object in pixels, as well as the width and height of the JSField object in pixels.
newRadios(dataprovidername/jsvariable, x, y, width, height)
Creates a new JSField object on the form with the displayType of RADIOS (radio buttons) - including the dataprovider/JSVariable of the JSField object, the "x" and "y" position of the JSField object in pixels, as well as the width and height of the JSField object in pixels.
newTextArea(dataprovidername/jsvariable, x, y, width, height)
Creates a new JSField object on the form with the displayType of TEXT_AREA - including the dataprovider/JSVariable of the JSField object, the "x" and "y" position of the JSField object in pixels, as well as the width and height of the JSField object in pixels.
newTextField(dataprovidername/jsvariable, x, y, width, height)
Creates a new JSField object on the form with the displayType of TEXT_FIELD - including the dataprovider/JSVariable of the JSField object, the "x" and "y" position of the JSField object in pixels, as well as the width and height of the JSField object in pixels.
newVariable(name, type)
Creates a new form JSVariable - based on the name of the variable object and the number type, uses the SolutionModel JSVariable constants.
newVariable(name, type, defaultValue)
Creates a new form JSVariable - based on the name of the variable object , the type and it's default value , uses the SolutionModel JSVariable constants.
removeButton(name)
Removes a JSButton that has the specified name.
removeComponent(name)
Removes a component (JSLabel, JSButton, JSField, JSPortal, JSBean, JSTabpanel) that has the given name.
removeField(name)
Removes a JSField that has the given name.
removeLabel(name)
Removes a JSLabel that has the given name.
removeMethod(name)
Removes a form JSMethod - based on the specified code.
removeVariable(name)
Removes a form JSVariable - based on the name of the variable object.
{column:width=100%|padding=0px}{column}
Constants Details
{column:width=100%|padding=0px}{column}
Property Details
The names of the database server and table that this form is linked to.
Since
Replace with version info
Parameters
Also see
External links
Sample
var myForm = solutionModel.newForm('newForm', 'db:/a_server/a_table', 'aStyleName', false, 800, 600) myForm.dataSource = 'db:/anotherServerName/anotherTableName'
The name of the form.
Since
Replace with version info
Parameters
Also see
External links
Sample
var form = solutionModel.newForm('myForm',myDatasource,null,true,800,600); var formName = form.name; application.output(formName);
The method that is triggered when another form is being activated.
NOTE: If the onHide method returns false, the form can be prevented from hiding.
For example, when using onHide with showFormInDialog, the form will not close by clicking the dialog close box (X).
Since
Replace with version info
Parameters
Also see
External links
Sample
form.onShow = form.newMethod('function onShow(firstShow, event) { application.output("onShow intercepted on " + event.getFormName() + ". first show? " + firstShow); return false; }'); form.onHide = form.newMethod('function onHide(event) { application.output("onHide blocked on " + event.getFormName()); return false; }');
The method that is triggered when a form is loaded/reloaded from the repository; used to alter elements, set globals, hide toolbars,
etc; onShow method can also be assigned.
NOTE: onShow should be used to access current foundset dataproviders; onLoad cannot be used because the foundset data is not loaded until after the form is loaded.
Also calls to loadRecords() should be done in the onShow method and not in the onLoad method
If you call loadRecords() in the onShow method, you may want to set the namedFoundSet property of the form to 'empty' to prevent the first default form query.
NOTE: the onLoad event bubbles down, meaning that the onLoad is first fired on the parent then on a tab in a tabpanel (and in tab of that tab panels if you are 3 deep)
Since
Replace with version info
Parameters
Also see
External links
Sample
form.onLoad = form.newMethod('function onLoad(event) { application.output("onLoad intercepted on " + event.getFormName()); }'); form.onUnLoad = form.newMethod('function onUnLoad(event) { application.output("onUnLoad intercepted on " + event.getFormName()); }');
The method that is triggered each time a record is selected.
If a form is in List view or Special table view - when the user clicks on it.
In Record view - after the user navigates to another record using the slider or clicks up or down for next/previous record.
NOTE: Data and Servoy tag values are returned when the onRecordSelection method is executed.
Since
Replace with version info
Parameters
Also see
External links
Sample
form.onRecordEditStart = form.newMethod('function onRecordEditStart(event) { application.output("onRecordEditStart intercepted on " + event.getFormName()); }'); form.onRecordEditStop = form.newMethod('function onRecordEditStop(record, event) { application.output("onRecordEditStop intercepted on " + event.getFormName() + ". record is: " + record); }'); form.onRecordSelection = form.newMethod('function onRecordSelection(event) { application.output("onRecordSelection intercepted on " + event.getFormName()); }');
The method that is triggered EVERY TIME the form is displayed; an argument must be passed to the method if this is the first time the form is displayed.
NOTE: onShow can be used to access current foundset dataproviders; onLoad cannot be used because the foundset data is not loaded until after the form is loaded.
NOTE: the onShow event bubbles down, meaning that the onShow event of a form displayed in a tabPanel is fired after the onShow event of the parent.
Since
Replace with version info
Parameters
Also see
External links
Sample
form.onShow = form.newMethod('function onShow(firstShow, event) { application.output("onShow intercepted on " + event.getFormName() + ". first show? " + firstShow); return false; }'); form.onHide = form.newMethod('function onHide(event) { application.output("onHide blocked on " + event.getFormName()); return false; }');
Get the server name used by this form.
Since
Replace with version info
Parameters
Also see
External links
Sample
var form = solutionModel.newForm('myForm',myDatasource,null,true,800,600); form.serverName = 'anotherServerName'; var theServerName = form.serverName; application.output(theServerName);
The [name of the table/SQL view].[the name of the database server connection] the form is based on.
Since
Replace with version info
Parameters
Also see
External links
Sample
var aForm = solutionModel.newForm('newForm1', myDatasource, null, true, 800, 600); aForm.tableName = 'anotherTableOfMine' if (forms['newForm1'].controller.find()) { columnTextDataProvider = '=aSearchedValue' columnNumberDataProvider = '>10'; forms['newForm1'].controller.search() }
{column:width=100%|padding=0px}{column}
Method Details
getButton
(name)
Returns a JSButton that has the given name.
Since
Replace with version info
Parameters
{String} name – the specified name of the button
Returns
JSButton – a JSButton object
Also see
External links
Sample
var btn = myForm.getButton("hello"); application.output(btn.text);
JSButton[]
getButtons
()
Returns all JSButtons of this form, including the ones without a name.
Since
Replace with version info
Parameters
Returns
JSButton[] – the list of all JSbuttons on this forms
Also see
External links
Sample
var buttons = myForm.getButtons(); for (var b in buttons) { if (buttons[b].name != null) application.output(buttons[b].name); else application.output(buttons[b].text + " has no name "); }
getComponent
(name)
Returns a JSComponent that has the given name; if found it will be a JSField, JSLabel, JSButton, JSPortal, JSBean or JSTabPanel.
Since
Replace with version info
Parameters
{String} name – the specified name of the component
Returns
JSComponent – a JSComponent object (might be a JSField, JSLabel, JSButton, JSPortal, JSBean or JSTabPanel)
Also see
External links
Sample
var frm = solutionModel.getForm("myForm"); var cmp = frm.getComponent("componentName"); application.output("Component type and name: " + cmp);
getComponents
()
Returns a array of all the JSComponents that a form has; they are of type JSField,JSLabel,JSButton,JSPortal,JSBean or JSTabPanel.
Since
Replace with version info
Parameters
Returns
JSComponent[] – an array of all the JSComponents on the form.
Also see
External links
Sample
var form = solutionModel.getForm("myForm"); var components = form.getComponents(); for (var i in components) application.output("Component type and name: " + components[i]);
getField
(name)
The field with the specified name.
Since
Replace with version info
Parameters
{String} name – the specified name of the field
Returns
JSField – a JSField object
Also see
External links
Sample
var form = solutionModel.getForm("myForm"); var field = form.getField("myField"); application.output(field.dataProviderID);
JSField[]
getFields
()
Returns all JSField objects of this form, including the ones without a name.
Since
Replace with version info
Parameters
Returns
JSField[] – all JSField objects of this form
Also see
External links
Sample
var frm = solutionModel.getForm("myForm"); var fields = frm.getFields(); for (var f in fields) { var fname = fields[f].name; if (fname != null) application.output(fname); }
getLabel
(name)
Returns a JSLabel that has the given name.
Since
Replace with version info
Parameters
{String} name – the specified name of the label
Returns
JSLabel – a JSLabel object (or null if the label with the specified name does not exist)
Also see
External links
Sample
var frm = solutionModel.getForm("myForm"); var label = frm.getLabel("myLabel"); application.output(label.text);
JSLabel[]
getLabels
()
Returns all JSLabels of this form (not including its super form), including the ones without a name.
Since
Replace with version info
Parameters
Returns
JSLabel[] – all JSLabels on this form
Also see
External links
Sample
var frm = solutionModel.getForm("myForm"); var labels = frm.getLabels(); for (var i in labels) { var lname = labels[i].name; if (lname != null) application.output(lname); }
getMethod
(name)
Gets an existing form method for the given name.
Since
Replace with version info
Parameters
{String} name – the specified name of the method
Returns
JSMethod – a JSMethod object (or null if the method with the specified name does not exist)
Also see
External links
Sample
var frm = solutionModel.getForm("myForm"); var method = frm.getMethod("myMethod"); application.output(method.code);
JSMethod[]
getMethods
()
Returns all existing form methods for this form.
Since
Replace with version info
Parameters
Returns
JSMethod[] – all form methods for the form
Also see
External links
Sample
var frm = solutionModel.getForm("myForm"); var methods = frm.getMethods(); for (var m in methods) application.output(methods[m].getName());
[JSPart]
getPart
(type)
Gets a part of the form from the given type (see JSPart constants).
Since
Replace with version info
Parameters
{Number} type – The type of the part to retrieve.
Returns
[JSPart] – A JSPart instance representing the retrieved form part.
Also see
External links
Sample
form.getPart(JSPart.HEADER).background = 'red'; form.getPart(JSPart.LEADING_SUBSUMMARY, 160).background = 'red';
getVariable
(name)
Gets an existing form variable for the given name.
Since
Replace with version info
Parameters
{String} name – the specified name of the variable
Returns
JSVariable – a JSVariable object
Also see
External links
Sample
var frm = solutionModel.getForm("myForm"); var fvariable = frm.getVariable("myVarName"); application.output(fvariable.name + " has the default value of " + fvariable.defaultValue);
getVariables
()
An array consisting of all form variables for this form.
Since
Replace with version info
Parameters
Returns
JSVariable[] – an array of all variables on this form
Also see
External links
Sample
var frm = solutionModel.getForm("myForm"); var variables = frm.getVariables(); for (var i in variables) application.output(variables[i].name);
newButton
(text, x, y, width, height, jsmethod)
Creates a new button on the form with the given text, place, size and JSMethod as the onAction event triggered action.
Since
Replace with version info
Parameters
text – the text on the button
{Number} x – the x coordinate of the button location on the form
{Number} y – the y coordinate of the button location on the form
{Number} width – the width of the button
{Number} height – the height of the button
jsmethod – the method assigned to handle an onAction event
Returns
JSButton – a new JSButton object
Also see
External links
Sample
var form = solutionModel.newForm('newForm1', myDatasource, null, true, 800, 600); var method = form.newMethod('function onAction(event) { application.output("onAction intercepted on " + event.getFormName()); }'); var button = form.newButton('myButton', 10, 10, 100, 30, method); application.output("The new button: " + button.name + " has the following onAction event handling method assigned " + button.onAction.getName());
newCheck
(dataprovidername/jsvariable, x, y, width, height)
Creates a new JSField object on the form with the displayType of CHECK (checkbox) - including the dataprovider/JSVariable of the JSField object, the "x" and "y" position of the JSField object in pixels, as well as the width and height of the JSField object in pixels.
Since
Replace with version info
Parameters
dataprovidername/jsvariable – the specified dataprovider name/JSVariable of the JSField object
{Number} x – the horizontal "x" position of the JSfield object in pixels
{Number} y – the vertical "y" position of the JSField object in pixels
{Number} width – the width of the JSField object in pixels
{Number} height – the height of the JSField object in pixels
Returns
JSField – a new JSField object on the form with the displayType of CHECK (checkbox)
Also see
External links
Sample
var form = solutionModel.newForm('newForm1', myDatasource, null, true, 800, 600); var calendar = form.newCheck(myDataProvider, 100, 100, 200, 200); forms['newForm1'].controller.show();
newComboBox
(dataprovidername/jsvariable, x, y, width, height)
Creates a new JSField object on the form with the displayType of COMBOBOX - including the dataprovider/JSVariable of the JSField object, the "x" and "y" position of the JSField object in pixels, as well as the width and height of the JSField object in pixels.
Since
Replace with version info
Parameters
dataprovidername/jsvariable – the specified dataprovider name/JSVariable of the JSField object
{Number} x – the horizontal "x" position of the JSfield object in pixels
{Number} y – the vertical "y" position of the JSField object in pixels
{Number} width – the width of the JSField object in pixels
{Number} height – the height of the JSField object in pixels
Returns
JSField – a new JSField object on the form with the displayType of COMBOBOX
Also see
External links
Sample
var form = solutionModel.newForm('newForm1', myDatasource, null, true, 800, 600); var calendar = form.newComboBox(myDataProvider, 100, 100, 200, 200); forms['newForm1'].controller.show();
newField
(dataprovidername/jsvariable, displaytype, x, y, width, height)
Creates a new JSField object on the form - including the dataprovider/JSVariable of the JSField object, the "x" and "y" position of the JSField object in pixels, as well as the width and height of the JSField object in pixels.
Since
Replace with version info
Parameters
dataprovidername/jsvariable – the specified dataprovider name/JSVariable of the JSField object
displaytype – the display type of the JSField object (see the Solution Model -> JSField node for display types)
{Number} x – the horizontal "x" position of the JSField object in pixels
{Number} y – the vertical "y" position of the JSField object in pixels
{Number} width – the width of the JSField object in pixels
{Number} height – the height of the JSField object in pixels
Returns
JSField – a new JSField object (of the specified display type)
Also see
External links
Sample
var form = solutionModel.newForm('newForm1', myDatasource, null, true, 800, 600); var variable = form.newVariable('myVar', JSVariable.TEXT); variable.defaultValue = "'This is a default value (with triple quotes)!'"; var field = form.newField(variable, JSField.TEXT_FIELD, 100, 100, 200, 200); forms['newForm1'].controller.show();
[JSPart]
newFooterPart
(height)
Creates a new Footer part on the form.
Since
Replace with version info
Parameters
{Number} height – The height of the new part
Returns
[JSPart] – A JSPart instance corresponding to the newly created Footer form part.
Also see
External links
Sample
var footer = form.newFooterPart(440);
[JSPart]
newHeaderPart
(height)
Creates a new Header part on the form.
Since
Replace with version info
Parameters
{Number} height – The height of the new part
Returns
[JSPart] – A JSPart instance corresponding to the newly created Header form part.
Also see
External links
Sample
var header = form.newHeaderPart(80);
newLabel
(txt, x, y, width, height)
Creates a new JSLabel object on the form - including the text of the label, the "x" and "y" position of the label object in pixels, the width and height of the label object in pixels.
Since
Replace with version info
Parameters
{String} txt – the specified text of the label object
{Number} x – the horizontal "x" position of the label object in pixels
{Number} y – the vertical "y" position of the label object in pixels
{Number} width – the width of the label object in pixels
{Number} height – the height of the label object in pixels
Returns
JSLabel – a JSLabel object
Also see
External links
Sample
var form = solutionModel.newForm('newForm1', myDatasource, null, true, 800, 600); var label = form.newLabel('The text on the label', 140, 140, 50, 20); forms['newForm1'].controller.show();
newMethod
(code)
Creates a new form JSMethod - based on the specified code.
Since
Replace with version info
Parameters
{String} code – the specified code for the new method
Returns
JSMethod – a new JSMethod object for this form
Also see
External links
Sample
var form = solutionModel.newForm('newForm1', myDatasource, null, true, 800, 600); var method = form.newMethod('function aMethod(event){application.output("Hello world!");}'); var button = myListViewForm.newButton('Show message!',50,50,100,30,method); forms['newForm1'].controller.show();
newPassword
(dataprovidername/jsvariable, x, y, width, height)
Creates a new JSField object on the form with the displayType of PASSWORD - including the dataprovider/JSVariable of the JSField object, the "x" and "y" position of the JSField object in pixels, as well as the width and height of the JSField object in pixels.
Since
Replace with version info
Parameters
dataprovidername/jsvariable – the specified dataprovider name/JSVariable of the JSField object
{Number} x – the horizontal "x" position of the JSfield object in pixels
{Number} y – the vertical "y" position of the JSField object in pixels
{Number} width – the width of the JSField object in pixels
{Number} height – the height of the JSField object in pixels
Returns
JSField – a new JSField object on the form with the displayType of PASSWORD
Also see
External links
Sample
var form = solutionModel.newForm('newForm1', myDatasource, null, true, 800, 600); var pass = form.newPassword(scopes.globals.aVariable, 100, 100, 70, 30); forms['newForm1'].controller.show();
newRadios
(dataprovidername/jsvariable, x, y, width, height)
Creates a new JSField object on the form with the displayType of RADIOS (radio buttons) - including the dataprovider/JSVariable of the JSField object, the "x" and "y" position of the JSField object in pixels, as well as the width and height of the JSField object in pixels.
Since
Replace with version info
Parameters
dataprovidername/jsvariable – the specified dataprovider name/JSVariable of the JSField object
{Number} x – the horizontal "x" position of the JSfield object in pixels
{Number} y – the vertical "y" position of the JSField object in pixels
{Number} width – the width of the JSField object in pixels
{Number} height – the height of the JSField object in pixels
Returns
JSField – a JSField object with the displayType of RADIOS (radio buttons)
Also see
External links
Sample
var form = solutionModel.newForm('newForm1', myDatasource, null, true, 800, 600); var vlist = solutionModel.newValueList('options',JSValueList.CUSTOM_VALUES); vlist.customValues = "value1\nvalue2\nvalue3"; var radios = form.newRadios('columnDataProvider',100,100,200,200); radios.valuelist = vlist;
newTextArea
(dataprovidername/jsvariable, x, y, width, height)
Creates a new JSField object on the form with the displayType of TEXT_AREA - including the dataprovider/JSVariable of the JSField object, the "x" and "y" position of the JSField object in pixels, as well as the width and height of the JSField object in pixels.
Since
Replace with version info
Parameters
dataprovidername/jsvariable – the specified dataprovider name/JSVariable of the JSField object
{Number} x – the horizontal "x" position of the JSTabPanel object in pixels
{Number} y – the vertical "y" position of the JSTabPanel object in pixels
{Number} width – the width of the JSTabPanel object in pixels
{Number} height – the height of the JSTabPanel object in pixels
Returns
JSField – a JSField object with the displayType of TEXT_AREA
Also see
External links
Sample
var form = solutionModel.newForm('newForm1',myDatasource,null,true,800,600); var globalVar = solutionModel.newGlobalVariable('globals', 'myGlobal',JSVariable.TEXT); globalVar.defaultValue = "'Type your text in here'"; var textArea = form.newTextArea(globalVar,100,100,300,150); forms['newForm1'].controller.show();
newTextField
(dataprovidername/jsvariable, x, y, width, height)
Creates a new JSField object on the form with the displayType of TEXT_FIELD - including the dataprovider/JSVariable of the JSField object, the "x" and "y" position of the JSField object in pixels, as well as the width and height of the JSField object in pixels.
Since
Replace with version info
Parameters
dataprovidername/jsvariable – the specified dataprovider name/JSVariable of the JSField object
{Number} x – the horizontal "x" position of the JSfield object in pixels
{Number} y – the vertical "y" position of the JSField object in pixels
{Number} width – the width of the JSField object in pixels
{Number} height – the height of the JSField object in pixels
Returns
JSField – a JSField object with the displayType of TEXT_FIELD
Also see
External links
Sample
var form = solutionModel.newForm('newForm1',myDatasource,null,true,800,600); //choose the dataprovider or jsvariable you want for the Text Field var x = null; //global jsvariable as the dataprovider //x = solutionModel.newGlobalVariable('globals', 'myGlobal',JSVariable.TEXT); //x.defaultValue = "'Text from a global variable'"; //or a form jsvariable as the dataprovider //x = form.newVariable('myFormVar',JSVariable.TEXT); //x.defaultValue = "'Text from a form variable'"; var textField = form.newTextField(x,100,100,200,50); //or a column data provider as the dataprovider //textField.dataProviderID = columnTextDataProvider; forms['newForm1'].controller.show();
newVariable
(name, type)
Creates a new form JSVariable - based on the name of the variable object and the number type, uses the SolutionModel JSVariable constants.
Since
Replace with version info
Returns
JSVariable – a JSVariable object
Also see
External links
Sample
var form = solutionModel.newForm('newForm1', myDatasource, null, true, 800, 600); var variable = form.newVariable('myVar', JSVariable.TEXT , "'This is a default value (with triple quotes)!'"); //or variable = form.newVariable('myVar', JSVariable.TEXT) //variable.defaultValue = "'This is a default value (with triple quotes)!'" // setting the default value after the variable is created requires form recreation //variable.defaultValue = "{a:'First letter',b:'Second letter'}" var field = form.newField(variable, JSField.TEXT_FIELD, 100, 100, 200, 200); forms['newForm1'].controller.show();
newVariable
(name, type, defaultValue)
Creates a new form JSVariable - based on the name of the variable object , the type and it's default value , uses the SolutionModel JSVariable constants.
This method does not require the form to be destroyed and recreated. Use this method if you want to change the form's model without destroying the runtime form</b>
Since
Replace with version info
Parameters
Returns
JSVariable – a JSVariable object
Also see
External links
Sample
var form = solutionModel.newForm('newForm1', myDatasource, null, true, 800, 600); var variable = form.newVariable('myVar', JSVariable.TEXT , "'This is a default value (with triple quotes)!'"); //or variable = form.newVariable('myVar', JSVariable.TEXT) //variable.defaultValue = "'This is a default value (with triple quotes)!'" // setting the default value after the variable is created requires form recreation //variable.defaultValue = "{a:'First letter',b:'Second letter'}" var field = form.newField(variable, JSField.TEXT_FIELD, 100, 100, 200, 200); forms['newForm1'].controller.show();
removeButton
(name)
Removes a JSButton that has the specified name. Returns true if removal was successful, false otherwise.
Since
Replace with version info
Parameters
{String} name – the specified name of the JSButton to be removed
Returns
Boolean – true if the JSButton has been removed; false otherwise
Also see
External links
Sample
var form = solutionModel.newForm('newFormX',myDatasource,null,true,800,600); var b1 = form.newButton('This is button1',100,100,200,50,null); b1.name = 'b1'; var jsmethod = form.newMethod("function removeMe(event) { var form = solutionModel.getForm('newFormX'); if (form.removeButton('b1') == true) application.output('Button has been removed ok'); else application.output('Button could not be deleted'); forms['newFormX'].controller.recreateUI();}"); var b2 = form.newButton('Click here to remove button1',100,230,200,50,jsmethod); b2.name = 'b2'; forms['newFormX'].controller.show();
removeComponent
(name)
Removes a component (JSLabel, JSButton, JSField, JSPortal, JSBean, JSTabpanel) that has the given name. It is the same as calling "if(!removeLabel(name) && !removeButton(name) ....)".
Returns true if removal was successful, false otherwise.
Since
Replace with version info
Parameters
{String} name – the specified name of the component to be deleted
Returns
Boolean – true if component has been successfully deleted; false otherwise
Also see
External links
Sample
var form = solutionModel.newForm('newFormX','db:/server1/parent_table',null,true,1000,750); var jsbutton = form.newButton('JSButton to delete',100,100,200,50,null); jsbutton.name = 'jsb'; var jslabel = form.newLabel('JSLabel to delete',100,200,200,50,null); jslabel.name = 'jsl'; jslabel.transparent = false; jslabel.background = 'green'; var jsfield = form.newField('scopes.globals.myGlobalVariable',JSField.TEXT_FIELD,100,300,200,50); jsfield.name = 'jsf'; var relation = solutionModel.newRelation('parentToChild','db:/server1/parent_table','db:/server1/child_table',JSRelation.INNER_JOIN); relation.newRelationItem('parent_table_id', '=', 'child_table_id'); var jsportal = form.newPortal('jsp',relation,100,400,300,300); jsportal.newField('child_table_id',JSField.TEXT_FIELD,200,200,120); var childOne = solutionModel.newForm('childOne','db:/server1/child_table',null,false,400,300); childOne.newField('child_table_id', JSField.TEXT_FIELD,10,10,100,20); var childTwo = solutionModel.newForm('childTwo','server1','other_table',null,false,400,300); childTwo.newField('some_table_id', JSField.TEXT_FIELD,10,10,100,100); var jstabpanel = form.newTabPanel('jst',450,30,620,460); jstabpanel.newTab('tab1','Child One',childOne,relation); jstabpanel.newTab('tab2','Child Two',childTwo); var jsmethod = form.newMethod("function removeMe(event) { var form = solutionModel.getForm('newFormX');\n if ((form.removeComponent('jsb') == true) && (form.removeComponent('jsl') == true) && (form.removeComponent('jsf') == true) && (form.removeComponent('jsp') == true) & (form.removeComponent('jst') == true)) application.output('Components removed ok'); else application.output('Some component(s) could not be deleted'); forms['newFormX'].controller.recreateUI();}"); var removerButton = form.newButton('Click here to remove form components',450,500,250,50,jsmethod); removerButton.name = 'remover'; forms['newFormX'].controller.show();
removeField
(name)
Removes a JSField that has the given name. Returns true if removal was successful, false otherwise.
Since
Replace with version info
Parameters
{String} name – the specified name of the JSField to remove
Returns
Boolean – true is the JSField has been successfully removed; false otherwise
Also see
External links
Sample
var form = solutionModel.newForm('newFormX',myDatasource,null,true,800,600); var jsfield = form.newField(scopes.globals.myGlobalVariable,JSField.TEXT_FIELD,100,300,200,50); jsfield.name = 'jsf'; var jsmethod = form.newMethod("function removeMe(event) { var form = solutionModel.getForm('newFormX');\n if (form.removeComponent('jsf') == true) application.output('Field has been removed ok'); else application.output('Field could not be deleted'); forms['newFormX'].controller.recreateUI();}"); var removerButton = form.newButton('Click here to remove the field',450,500,250,50,jsmethod); removerButton.name = 'remover'; forms['newFormX'].controller.show();
removeLabel
(name)
Removes a JSLabel that has the given name. Returns true if removal successful, false otherwise
Since
Replace with version info
Parameters
{String} name – the specified name of the JSLabel to be removed
Returns
Boolean – true if the JSLabel with the given name has successfully been removed; false otherwise
Also see
External links
Sample
var form = solutionModel.newForm('newFormX',myDatasource,null,true,1000,750); var jslabel = form.newLabel('JSLabel to delete',100,200,200,50,null); jslabel.name = 'jsl'; jslabel.transparent = false; jslabel.background = 'green'; var jsmethod = form.newMethod("function removeMe(event) { var form = solutionModel.getForm('newFormX'); if (form.removeComponent('jsl') == true) application.output('Label has been removed'); else application.output('Label could not be deleted'); forms['newFormX'].controller.recreateUI();}"); var removerButton = form.newButton('Click here to remove the green label',450,500,250,50,jsmethod); removerButton.name = 'remover'; forms['newFormX'].controller.show();
removeMethod
(name)
Removes a form JSMethod - based on the specified code.
Since
Replace with version info
Parameters
{String} name – the specified name of the method
Returns
Boolean – true if method was removed successfully , false otherwise
Also see
External links
Sample
var form = solutionModel.newForm('newForm1', null, null, true, 800, 600); var hello = form.newMethod('function aMethod(event){application.output("Hello world!");}'); var removeMethod = form.newMethod('function removeMethod(event){ \ solutionModel.getForm(event.getFormName()).removeMethod("aMethod"); \ forms[event.getFormName()].controller.recreateUI();\ }'); var button1 = form.newButton('Call method!',50,50,120,30,hello); var button2 = form.newButton('Remove Mehtod!',200,50,120,30,removeMethod); forms['newForm1'].controller.show();
removeVariable
(name)
Removes a form JSVariable - based on the name of the variable object.
Since
Replace with version info
Parameters
{String} name – the specified name of the variable
Returns
Boolean – true if removed, false otherwise (ex: no var with that name)
Also see
External links
Sample
var form = solutionModel.newForm('newForm1', null, null, true, 800, 600); var variable = form.newVariable('myVar', JSVariable.TEXT); variable.defaultValue = "'This is a default value (with triple quotes)!'"; //variable.defaultValue = "{a:'First letter',b:'Second letter'}" var field = form.newField(variable, JSField.TEXT_FIELD, 100, 100, 200, 200); forms['newForm1'].controller.show(); variable = form.removeVariable('myVar'); application.sleep(4000); forms['newForm1'].controller.recreateUI();