• Post Reply Bookmark Topic Watch Topic
  • New Topic

can we use javascript for combox events or use JSF event?

 
amit taneja
Ranch Hand
Posts: 813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hii in my application which i m developing on jsf, has one combox which appear only when particular value of other combo box is selected !!!

how to deal with this scenario ? can i use javascript for that ? how ?
and if not then even pls tell me as i don't know javascript but if its possible through jsf then should i use eventhandling ? how

kindly reply ...its urgent !

thanks
[ September 12, 2006: Message edited by: amit taneja ]
 
Chris Schalk
author
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by amit taneja:
hii in my application which i m developing on jsf, has one combox which appear only when particular value of other combo box is selected !!!

how to deal with this scenario ? can i use javascript for that ? how ?
and if not then even pls tell me as i don't know javascript but if its possible through jsf then should i use eventhandling ? how

kindly reply ...its urgent !

thanks

[ September 12, 2006: Message edited by: amit taneja ]


I guess I missed this one yesterday..
This scenario is exactly covered in Chapter 8 where the event model is discussed. In the book a checkbox is shown on a form and when you click on it, another input field appears. This example does however rely on a post roundtrip to alter the render state of the extra input field that gets turned on.

If what you're asking is to make something appear without a server roundtrip purely on the client, this is also doable but you have to write JavaScript code to execute on the client to do this for you. You can then execute this JavaScript simply by setting one of the JavaScript attributes of any UI component such as onclick, onkeyup etc. The non post JavaScript events (onkeyup, onmouseout ..) will fire without needing a roundtrip. You then use JavaScript to update the value of another field just as if you would have entered the change manually. This approach is a little more advanced, but hopefully I haven't made it more confusing..

-Chris
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!