Werner Punz wrote:

Richard Wallace wrote:

Hello again,

I'm trying to figure out how, if it's possible to add form elements, like text fields, when a user clicks an add button without having to have the page resubmit.

Only by using javascript, but without javascript no.
That is a limit caused by the beast which is called html.
With javascript you can do it by altering the dom
tree.

I understand that, but how do you have JSF pickup the new element(s) when restoring state when the form is submitted?

With server side roundtripping, JSF has special api hooks
to do that (component bindings, child element trees)


I'm not even sure it's 100% possible unless the STATE_SAVING_METHOD is client. And then the javascript would have to manipulate that hidden field. Or do some kind of AJAX operation to modify the state when it's being stored server side. At this point, I think if anything prevents us from adopting JSF at work it would be dynamically adding form elements. Any suggestions?

Well depends on what you want to do with it, if you need additional data from the server, either use ajax, or go the roundtripping way. But if you want to stay on the client side, there is no way you can avoid javascript and if you dont want javascript, there is no way you
can avoid roundtripping.


Reply via email to