• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 !!!
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic