Menu

Defining default action to button in ADF

ADF By Jun 21, 2013 No Comments
There are many cases where user wants to submit a page or
form on press of “Enter”  key.
ADF provides a direct solution to this.
af:form or af:subform has a property called defaultCommand.
If we give button id as its value then on press of enter key, the given
button will be executed.
Example:
<af:subform defaultCommand=”cb1″
id=”s2″>

<af:panelFormLayout id=”pfl1″>   
    <af:inputText
label=”User Name” id=”it1″ />
    <af:inputText
label=”Password” id=”it2″ secret=”true”/>

<af:commandButton text=”Login” id=”cb1″  action=”#{pageFlowScope.mbean.doLogin}”
/>

</af:panelFormLayout>

</af:subform>

No Comments

Leave a comment

Hi, Welcome here.
JOIN OUR NEWSLETTER
And get notified everytime we publish a new blog post.