Appframe Knowledge Base

1 hits

How to manipulate form fields

// Get and set the caption of a field
var vOldCaption = formMain.getFields("FieldName").caption();
formMain.getFields("FieldName").caption("New caption");

// Get and set the disabled state of a field
formMain.getFields("FieldName").disabled(true || false);

// Get and set the visible state of a field
formMain.getFields("FieldName").display(true || false);

// Hide and show a field

// Get and set the value of a field
formMain.getFields("FieldName").value("New value");

// Get a reference to the af.controls.ComboBox instance of a field
var vComboBox = formMain.getFields("SomeComboBoxField").comboBox;

// Get references to the different html-elements of a field
// Normally you should not have to do things directly on the html element
// but it you really have to, this is the way to do it
var vFieldElement = formMain.getFields("FieldName").getElement();
var vLabelElement = formMain.getFields("FieldName").getLabel();
var vInputElement = formMain.getFields("FieldName").getInput();

components web · Perma link post comment Posted by: Jan Henrik Endsjø Høiland (22-okt-2013)