You can enable or disable JSF input controls and command buttons
with EGL code. A disabled control cannot be edited or changed on the
web page.
To enable or disable a JSF control with an EGL JSF Handler:
- On a blank line inside a function in the JSF Handler, press Ctrl+Shift+Z.
The EGL Source Assistant window opens, displaying the JSF controls
on the page.
- In the EGL Source Assistant window, select the JSF control that
you want to access.
- Click OK.
The EGL source assistant adds
two lines of EGL code to the JSF Handler. The first line defines an
EGL variable of the type that matches the JSF control that you selected.
The second line associates that variable with the JSF control. For
example, the code to access a JSF input text control might look like
this:
text1 HtmlInputText;
text1 = myViewRoot.findComponent("form1:text1");
- Using the EGL variable that the source assistant created, enable
or disable the JSF control with the setDisabled function.
For example, to enable a text control, add this code:
text1.setDisabled(no);
To
disable the text control, add this code:
text1.setDisabled(yes);