wood burning stoves 2.0*
The moose likes JSF and the fly likes AJAX and select nightmares... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "AJAX and select nightmares..." Watch "AJAX and select nightmares..." New topic
Author

AJAX and select nightmares...

Gerardo Tasistro
Ranch Hand

Joined: Feb 08, 2005
Posts: 362
... among other things. The only way I've managed to make AJAX work with JSF is with lots of <f:verbatim/> html, hidden fields and JavaScript. All JSF values that will interact with AJAX go into hidden inputs. On load the values are set in the components. AJAX then works with the html components in the page. On submit the values are stored in the hidden fields and posted.

In my case I need to change some text inputs into selects and back depending on the values of other fields. This is impossible (or at least I didn't manage to do it) with <h:input... whatevers. And if you have an <h:selectOneMenu/> and you change its list values with AJAX it doesn't work with the new values.

Any comments why this is so complicated?
Fintan Conway
Ranch Hand

Joined: Apr 03, 2002
Posts: 141
Originally posted by Gerardo Tasistro:
... among other things. The only way I've managed to make AJAX work with JSF is with lots of <f:verbatim/> html, hidden fields and JavaScript. All JSF values that will interact with AJAX go into hidden inputs. On load the values are set in the components. AJAX then works with the html components in the page. On submit the values are stored in the hidden fields and posted.

In my case I need to change some text inputs into selects and back depending on the values of other fields. This is impossible (or at least I didn't manage to do it) with <h:input... whatevers. And if you have an <h:selectOneMenu/> and you change its list values with AJAX it doesn't work with the new values.

Any comments why this is so complicated?


Hi Gerardo,

Have you tried any of the Ajax frameworks such as Dojo, or AjaxAnywhere? I have heard of others using these extensively in JSF applications without resorting to <f:verbatim> tags.

Regards,

Fintan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: AJAX and select nightmares...