File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Update another component when selectOneMenu Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Update another component when selectOneMenu" Watch "Update another component when selectOneMenu" New topic
Author

Update another component when selectOneMenu

D. Formenton
Ranch Hand

Joined: Mar 20, 2008
Posts: 39
Hi,

I wold like to update a <h:inputText> when an <h:selectOneMenu> is programmatically filled with values, without any action of operator.
Now if I click on selectOneMenu and select a different item the inputText is update Ok. But if the selectOneMenu has only one item (then cannot change value!)
OR in absence of any user action the input Text is not updated.

The relevant code:

<h:inputText value="#{richiesteOffController.newRow.articolo.measureUnit.descrizione}"
style="width: 40px; text-align: right;"
id="txtMeasUnit" readonly="true" />

<h:selectOneMenu value="#{richiesteOffController.newRow.articolo}"
id="somArticolo" converter="articoliConverter">
<f:selectItems value="#{articoliController.LArticoli}"
var="articolo" itemValue="#{articolo}"
itemLabel="#{articolo.descrizione}"/>
<f:ajax render=" txtMeasUnit"/>
</h:selectOneMenu>

I would like that when <h:selectOneMenu> is filled with one or more values the h:inputText is updated and shows a property of the item currently shown by <h:selectOneMenu.

What I have to do to reach this goal?

Thank you very much.

Domenico>
 
 
subject: Update another component when selectOneMenu
 
Threads others viewed
JSF partial validation
i am facing some problem with <h:selectOneMenu>
A Problem with events
Problem with loading the data after Value Change Listener on selectonemenu
Issue With selectOneMenu ValueChangeListener Not Firing
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com