Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AJAX and select nightmares...

 
Gerardo Tasistro
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... 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
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic