-
1. Re: All form elements are being submitted when ajaxSingle="true"
mp911de Aug 14, 2011 5:23 AM (in response to shandor)Hi Adi,
some thougts on this:
A form submission needs to be complete, because of validation and possible data requirements in the execution of the request. If you would send only half of the data and your process behind needs some data which was entered but not submitted you would get a problem. On the other side, hundreds of inputs indicate a bad application design. And if you just want to transmit the data you need, minimize network traffic and overhead you probably should not use JSF anyway, stay with JSP and servlets.
Best regards,
Mark
-
2. Re: All form elements are being submitted when ajaxSingle="true"
shandor Aug 14, 2011 5:38 AM (in response to mp911de)Hi Mark,
Thanks for your answer, but I do not agree with you for the following reasons:
1) The application developer knows exactly what is needed on the server side and can design an accurate ajax behaviour. Good framework should not enforce application behaviour of any kind! Application errors are for the developer to deal with. I expect of a good framework flexibility rather than "helpful" limitations.
2) Example: A web based spreadsheet is a classic ajax application that potentially can have thousands of inputs on the screen while the user changes one at a time and wants to see other inputs updated. So again, your suggestion for sticking to "JSP" and servlets is not relevant.
Best regards,
Adi
-
3. Re: All form elements are being submitted when ajaxSingle="true"
shandor Aug 14, 2011 7:31 AM (in response to shandor)Digging in the source code a bit reveals:
org.ajax4jsf.renderkit.AjaxRendererUtils line 286 is commentted out. Uncommenting it will cause the browser to submit only the ajaxed value.
if (ajaxSingle ) {
parameters.put(AJAX_SINGLE_PARAMETER_NAME, targetComponent.getClientId(facesContext));
// options.put("single", JSReference.TRUE);
if (input) {
options.put("control", JSReference.THIS);
}
}
Can someone from RichFaces team can explain rationale behind it ?
Thanks
Adi
-
4. Re: All form elements are being submitted when ajaxSingle="true"
blabno Aug 15, 2011 4:01 AM (in response to shandor)1 of 1 people found this helpfulSome complex components have their client id on i.e. DIV surrounding input, so submitting value of element under componentId would trigger error in javascript. Other reason is that client side doesn't know of how many inputs given component consists. There can be component consisted of several inputs, their id's must be different, so there is no way to tell client side which controls are to be submit for given component.
Thus everything in form gets submitted and the components on the server side decide what parameters are for them.
-
5. Re: All form elements are being submitted when ajaxSingle="true"
shandor Aug 15, 2011 6:50 AM (in response to blabno)Hello Bernard,
Thanks for your reply. This make sense, but the simple case ( which covers 90% of use cases I believe ) is just an a4j:support component attached to h:InputText. In this case really there is no need for full form sumbmission. It just diminish the full strength of an Ajaxed web app.
Can I suggest this becomes an optional parameter on the a4j:support component ?
I think this is something the framework should leave for the developer to control ( with the disclaimer from your reply )
Thanks
Adi