Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Update another component when selectOneMenu  RSS feed

D. Formenton
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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}"
<f:ajax render=" txtMeasUnit"/>

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.

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