DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR
{column:width=80px|padding=0px}{column}{column}{column}
Property Summary
dataProviderID
The dataprovider of the component.
displayType
The type of display used by the field.
horizontal
Flag for horizontal/vertical radios layout.
onDataChange
Method that is executed when the data in the component is successfully changed.
placeholderText
The text that is displayed in field when the field doesn't have a text value.
styleClass
The name of the style class that should be applied to this component.
valuelist
The valuelist that is used by this field when displaying data.
{column:width=80px|padding=0px}{column}{column}{column}
Method Summary
{column:width=100%|padding=0px}{column}
Property Details
Sample
// Normally the dataprovider is specified when a component is created. var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 40, 100, 20); // But it can be modified later if needed. field.dataProviderID = 'parent_table_id';
Sample
// The display type is specified when the field is created. var cal = form.newField('my_table_date', JSField.CALENDAR, 10, 10, 100, 20); // But it can be changed if needed. cal.dataProviderID = 'my_table_text'; cal.displayType = JSField.TEXT_FIELD;
Sample
var form = solutionModel.newForm('printForm', 'db:/example_data/parent_table', null, false, 400, 300); var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20); field.enabled = false;
Sample
var field = form.newField('my_table_number', JSField.TEXT_FIELD, 10, 10, 100, 20); field.format = '$#.00';
Sample
var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20); application.output('original width: ' + field.width); application.output('original height: ' + field.height); field.width = 200; field.height = 100; application.output('modified width: ' + field.width); application.output('modified height: ' + field.height);
Sample
radio.horizontal = true;
Sample
var form = solutionModel.newForm('someForm', 'db:/example_data/parent_table', null, false, 620, 300); var label = form.newLabel('Label', 10, 10, 150, 150); label.name = 'myLabel'; // Give a name to the component. forms['someForm'].controller.show() // Now use the name to access the component. forms['someForm'].elements['myLabel'].text = 'Updated text';
Sample
var doNothingMethod = form.newMethod('function doNothing() { application.output("Doing nothing."); }'); var onClickMethod = form.newMethod('function onClick(event) { application.output("I was clicked at " + event.getTimestamp()); }'); var onDoubleClickMethod = form.newMethod('function onDoubleClick(event) { application.output("I was double-clicked at " + event.getTimestamp()); }'); var onRightClickMethod = form.newMethod('function onRightClick(event) { application.output("I was right-clicked at " + event.getTimestamp()); }'); // At creation the button has the 'doNothing' method as onClick handler, but we'll change that later. var btn = form.newButton('I am a button', 10, 40, 200, 20, doNothingMethod); btn.onAction = onClickMethod; btn.onDoubleClick = onDoubleClickMethod; btn.onRightClick = onRightClickMethod;
Sample
var form = solutionModel.newForm('someForm', 'db:/example_data/parent_table', null, false, 620, 300); var onDataChangeMethod = form.newMethod('function onDataChange(oldValue, newValue, event) { application.output("Data changed from " + oldValue + " to " + newValue + " at " + event.getTimestamp()); }'); var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20); field.onDataChange = onDataChangeMethod; forms['someForm'].controller.show();
Sample
field.placeholderText = 'Search';
Sample
var form = solutionModel.newForm('printForm', 'db:/example_data/parent_table', null, false, 400, 300); var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20); var style = solutionModel.newStyle('myStyle','field.fancy { background-color: yellow; }'); form.styleName = 'myStyle'; // First set the style on the form. field.styleClass = 'fancy'; // Then set the style class on the field.
Sample
var vlist = solutionModel.newValueList('options', JSValueList.CUSTOM_VALUES); vlist.customValues = "one\ntwo\nthree\nfour"; var cmb = form.newField('my_table_options', JSField.COMBOBOX, 10, 100, 100, 20); cmb.valuelist = vlist;
Sample
var form = solutionModel.newForm('printForm', 'db:/example_data/parent_table', null, false, 400, 300); var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20); field.visible = false;
Sample
var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20); application.output('original width: ' + field.width); application.output('original height: ' + field.height); field.width = 200; field.height = 100; application.output('modified width: ' + field.width); application.output('modified height: ' + field.height);
Sample
var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20); application.output('original location: ' + field.x + ', ' + field.y); field.x = 90; field.y = 90; application.output('changed location: ' + field.x + ', ' + field.y);
Sample
var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 10, 10, 100, 20); application.output('original location: ' + field.x + ', ' + field.y); field.x = 90; field.y = 90; application.output('changed location: ' + field.x + ', ' + field.y);
{column:width=100%|padding=0px}{column}
Method Details
getTitle
()
Sample
var form = solutionModel.newForm('someForm', 'db:/example_data/parent_table'); var field = form.newField('parent_table_text', JSField.TEXT_FIELD, 1); field.getTitle().text = 'Parent table' forms['someForm'].controller.show()