This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes Changing the value of a rich:comboBox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Changing the value of a rich:comboBox" Watch "Changing the value of a rich:comboBox" New topic

Changing the value of a rich:comboBox

daphna deutsch

Joined: Nov 17, 2005
Posts: 17

I'm quite new to JSF, so maybe my question is really simple.

I’m using a table to display list of data. When clicking on one of the row, I display an hidden div that contains rich:comboBox.
I want that the value of the rich:comboBox (the one that is no selected) will be change from row to row.
So – when I display the div, using java script, I also set the value of the component.
However, this has no affect on the component…

Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
JSF runs at the server side and produces HTML.
JS runs at the client side and intercepts on HTML DOM.

So, whenever you want to write a JS function, you should not look at the JSF source code, but look at its generated HTML output. Base your Javascript on this. The HTML element in question may not have a 'value' attribute, for example a <select> element. If you stucks in this, try a HTML/Javascript forum. The JSF code is irrelevant here.
I agree. Here's the link:
subject: Changing the value of a rich:comboBox
Similar Threads
rich:comboBox fails to reRender due to rich:ajaxValidator
rich:comboBox setting a default value
Dynamically deciding either to show or hide modalPanel
richfaces :comboBox defaultLabel, required=false question
rich:comboBox valueChangeListener is not working