Details
-
Type:
New Feature
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: EE-3.0.0.GA, 3.1
-
Fix Version/s: 3.3
-
Labels:None
-
Environment:ICEfaces
-
Assignee Priority:P2
-
ICEsoft Forum Reference:
-
Affects:Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial
Description
Create a component which will allow to control which command to initiate form submit when enter key is pressed.
For example such component will allow to execute button#2 by default when a user hit Enter:
<h:form id="form">
...
<h:commandButton value="Ajax button" id="button1" actionListener="#{sampleBean.ajaxSubmit}">
<f:ajax execute="@this" render="@form">
<h:commandButton>
<h:commandButton value="Regular Button" id="button2" action="#{sampleBean.nonAjaxSubmit}" />
<ace:defaultAction target="#{someEL_poinitng_to_button2}" />
...
</h:form>
The component could also support more keys in addition to Enter.
Example:
<h:form id="form">
...
<f:ajax execute="@this" render="@form">
<h:commandButton value="Submit" id="button1" actionListener="#{sampleBean.ajaxSubmit}"/>
<h:commandButton value="Cancel" id="button2" action="#{sampleBean.nonAjaxSubmit}" />
<f:ajax/>
<ace:defaultAction target="button1" key="Enter"/>
<ace:defaultAction target="button2" key="Esc"/>
...
</h:form>
For example such component will allow to execute button#2 by default when a user hit Enter:
<h:form id="form">
...
<h:commandButton value="Ajax button" id="button1" actionListener="#{sampleBean.ajaxSubmit}">
<f:ajax execute="@this" render="@form">
<h:commandButton>
<h:commandButton value="Regular Button" id="button2" action="#{sampleBean.nonAjaxSubmit}" />
<ace:defaultAction target="#{someEL_poinitng_to_button2}" />
...
</h:form>
The component could also support more keys in addition to Enter.
Example:
<h:form id="form">
...
<f:ajax execute="@this" render="@form">
<h:commandButton value="Submit" id="button1" actionListener="#{sampleBean.ajaxSubmit}"/>
<h:commandButton value="Cancel" id="button2" action="#{sampleBean.nonAjaxSubmit}" />
<f:ajax/>
<ace:defaultAction target="button1" key="Enter"/>
<ace:defaultAction target="button2" key="Esc"/>
...
</h:form>
This likely should be an icecore: component.