This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting the value of the parent tag of <a4j:support>  RSS feed

 
Felix Sima
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello.

I have the following JSF page:

where actualizeazaOrase is a method of my backing bean:



How can I get the value of the select field having the id="judet" inside of my method?
The code I used is not working, the value of judet_id is null !
I also inspected:

event.getComponent();
event.getSource();

but the value is also null!

Which method is more appropriate to use in here? Should I get that value from FacesContext or from the ActionEvent?
Where can I find some sample code about this? (richfaces_usersguide.pdf doesn't helped me much in here )

Thank you,
Felix
Use www.jaaava.com - A Google for Java !!!
 
Tim Holloway
Bartender
Posts: 18661
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The whole purpose of the a4j support tag is to add AJAX support to the control in question. You're making things too complicated. The value of the control with the id "judet" is maintained under its value attribute.

In other words, if you want the value of "judet" in the actualizezaOrase action method, have that method retrieve it by invoking the "getIdJudet()" method.

The a4j function basically allows for the same behavior as traditional JSF UI, except that they permit fine-grained control over what parts of the form/page are sent and received. So there's no need to dissect internal DOM or JSF data structures for routine tasks such as this. The standard JSF lifecycle is still followed, just not with the entire page participating.
 
Felix Sima
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim.

I need the value of the "judet" to make an asynchronous call (ajax call) to update another field based on the selection of "judet".
I found the solution:


Thanks,
Felix
Use www.jaaava.com - A Google for Java.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!