Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

display a profile of the car on the same page - with h:selectOneListbox

 
chetan padhye
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

My select list is like below .... and on selection of any of option on it i want to display a profile of the car on the same page .....what can be possible options and the best option ?


<h:selectOneListbox id="pickCar"
value="#{carBean.currentCar}">
<f:selectItems
value="#{carBean.carList}" />
</h:selectOneListbox>

Please tell me , how do i change the values of existing components on the screen on some valueChangeEvent ?

Thanks in advance
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Several ways. Do you want to do it synchronously? Just submit the form to the server on change of the dropdown. Do you want to do it asynchronously? Consider using Ajax4jsf (part of RichFaces) to rerender the desired part of the page on change of the dropdown. Do you want to do it entirely clientside? Print all desired values to some Javascript array and use Javascript to display the desired part of the page on change of the dropdown.

The valueChangeEvent isn't of interest. You're not interested in the old value.
 
chetan padhye
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for reply

Ajax4jsf sounds best option here ....do you have any example ....

Thanks ...
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Documentation, tutorials and examples enough at their own homepage.
 
chetan padhye
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks




 
Rahul Santha
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to do Ajax refresh after the onChange event of dropdown.

Below link is something similar.. but it uses IBM JSF Ajax component.
http://www.ibm.com/developerworks/rational/library/06/1205_kats_rad2/

Thanks,
Santha
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic