Details
-
Type: New Feature
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.8.2
-
Fix Version/s: 1.8.2-EE-GA_P01, 1.8.3
-
Component/s: ICE-Components
-
Labels:None
-
Environment:All
-
ICEsoft Forum Reference:
Description
In a standard web page, or stock JSF application, if there is a form, input fields, and a submit button, and the user presses enter in one of the input fields, the form will be submitted as if the submit button has been pressed. In stock JSF applications, that results in the submit commandButton's action or actionListener being invoked. Application developers would like that capability in ICEfaces applications.
Currently, ICEfaces intercepts all form submissions, to be able to do its own form field serialization, and bundle in ICEfaces specific submitted values. This keeps the browser's default behaviour from happening. When seeking to address user's desire of default browser behaviour, it's been noted that certain issues make it suboptimal. For example, in stock JSF applications, if there are multiple submit buttons, then there is not consistent behaviour across browsers, as to which submit button will be virtually clicked. Solving the simple case would likely break more complex cases. Furthermore, after DOM manipulation, which submit button is clicked becomes arbitrary in some browsers. There is also the question of forms with input fields, and no submit button, which is quite popular with search fields.
Historically, ICEfaces addressed these issues by allowing applications to specify an action/actionListener on certain input fields directly, so that if ENTER was pressed in that specific input field, a precisely specified action/actionListener could be invoked. This fine grained control becomes a detriment when there are many input fields in a form, or when using multiples levels of JSP or Facelets inclusion, and the application wishes to always invoke the same action/actionListener.
So, to complement existing behaviours, we propose adding action and actionListener attributes to ice:form, so that there may be a single place to specify the action/actionListener, regardless of the submitting component, whether it be an input field or UICommand subclass like commandButton. When any of those components cause a full form submission (not a partialSubmit), they will be given a chance to invoke their own action/actionListener, but if they have none specified, then the ice:form will invoke its own action/actionListener, if one was specified. In this way, a catch-all action/actionListener may be specified on the ice:form, which can be overridden on a per component basis.
Currently, ICEfaces intercepts all form submissions, to be able to do its own form field serialization, and bundle in ICEfaces specific submitted values. This keeps the browser's default behaviour from happening. When seeking to address user's desire of default browser behaviour, it's been noted that certain issues make it suboptimal. For example, in stock JSF applications, if there are multiple submit buttons, then there is not consistent behaviour across browsers, as to which submit button will be virtually clicked. Solving the simple case would likely break more complex cases. Furthermore, after DOM manipulation, which submit button is clicked becomes arbitrary in some browsers. There is also the question of forms with input fields, and no submit button, which is quite popular with search fields.
Historically, ICEfaces addressed these issues by allowing applications to specify an action/actionListener on certain input fields directly, so that if ENTER was pressed in that specific input field, a precisely specified action/actionListener could be invoked. This fine grained control becomes a detriment when there are many input fields in a form, or when using multiples levels of JSP or Facelets inclusion, and the application wishes to always invoke the same action/actionListener.
So, to complement existing behaviours, we propose adding action and actionListener attributes to ice:form, so that there may be a single place to specify the action/actionListener, regardless of the submitting component, whether it be an input field or UICommand subclass like commandButton. When any of those components cause a full form submission (not a partialSubmit), they will be given a chance to invoke their own action/actionListener, but if they have none specified, then the ice:form will invoke its own action/actionListener, if one was specified. In this way, a catch-all action/actionListener may be specified on the ice:form, which can be overridden on a per component basis.
Activity
Mark Collette
created issue -
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #19865 | Fri Dec 04 10:48:06 MST 2009 | adnan.durrani | Fix towards |
Files Changed | ||||
MODIFY
/icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/panelseries/UISeries.java
MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/ext/HtmlForm.java |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #19866 | Fri Dec 04 11:22:04 MST 2009 | adnan.durrani | Fix towards |
Files Changed | ||||
MODIFY
/icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/ext/HtmlForm.java
|
Ken Fyten
made changes -
Field | Original Value | New Value |
---|---|---|
Salesforce Case | [] | |
Fix Version/s | 1.8.3 [ 10211 ] | |
Assignee Priority | P1 | |
Assignee | Adnan Durrani [ adnan.durrani ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #19869 | Sun Dec 06 18:05:36 MST 2009 | adnan.durrani | Fix towards |
Files Changed | ||||
MODIFY
/icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/ext/HtmlForm.java
MODIFY /icefaces/trunk/icefaces/component-metadata/src/main/resources/conf/ice_properties/ice-form-props.xml |
Adnan Durrani
made changes -
Attachment | ICE-5122.war [ 12116 ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #19876 | Mon Dec 07 15:42:26 MST 2009 | yip.ng | |
Files Changed | ||||
MODIFY
/icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/ext/HtmlForm.java
|
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #19881 | Tue Dec 08 10:44:20 MST 2009 | adnan.durrani | Fix towards |
Files Changed | ||||
MODIFY
/icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/ext/HtmlForm.java
|
yip.ng
made changes -
Attachment | ICE-5122-2.war [ 12122 ] |
Adnan Durrani
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #19948 | Thu Dec 10 15:13:22 MST 2009 | judy.guglielmin | |
Files Changed | ||||
MODIFY
/icefaces/scratchpads/glimmer/compat/components/src/main/java/com/icesoft/faces/component/panelseries/UISeries.java
MODIFY /icefaces/scratchpads/glimmer/compat/component-metadata/src/main/resources/conf/ice_properties/ice-form-props.xml MODIFY /icefaces/scratchpads/glimmer/compat/components/src/main/java/com/icesoft/faces/component/ext/HtmlForm.java |
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
Assignee Priority | P1 | |
Assignee | Adnan Durrani [ adnan.durrani ] |
Ken Fyten
made changes -
Resolution | Fixed [ 1 ] | |
Status | Closed [ 6 ] | Reopened [ 4 ] |
Ken Fyten
made changes -
Salesforce Case | [] | |
Fix Version/s | 1.8.2-EE-GA_P01 [ 10220 ] |
Ken Fyten
made changes -
Status | Reopened [ 4 ] | Closed [ 6 ] |
Resolution | Fixed [ 1 ] |
We've identified two main strategies for accomplishing this.
One strategy would be to modify each ice: component that can specify an action or actionListener, and make it so that where they decide if they are responsible for creating an ActionEvent, to check if an action/actionListener is specified on them, and if so create their own ActionEvent, and otherwise find their form, and if it's an ice:form, allow that to create an ActionEvent if it has an action or actionListener specified on it. This wouldn't work with third party components, and in the case of the h: components would result in the stock browser behaviour, instead of the ice:form specified one.
Another strategy would be to modify ice:form to detect when a full form submission has occurred, where none of its children had queued an ActionEvent, and then queue one itself, if it has an action/actionListener. This would involve overriding HtmlForm's queueEvent and processDecodes methods, so as to track if queueEvent had been called with an ActionEvent, while processDecodes was recursing through the child components, which is when they could enqueue an ActionEvent. At the end of processDecodes, if no child had enqueued an ActionEvent, then HtmlForm could do so itself, if it had an action/actionListener and if it was a full form submit. The problem here is that if the child component that does enqueue an ActionEvent is within a UIData or ICEfaces UISeries, then the ActionEvent will be wrapped inside another FacesEvent, which contains the UIData/UISeries row information. Even if we allow for inspection within ICEfaces' row events, that still doesn't cover the UIData wrapper event. Introspection could be added in that case. Still, any third party container component that uses event wrapping would break this feature.