• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

AJAX and select nightmares...

 
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You'll never get away with this you overconfident blob! The most you will ever get is this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic