I have many lines (in a table).
In the first line I have three selectOneMenu:
- the first contains the names of continents
- the second contains the names of towns (depending on the continent selected in the first selectOneMenu)
- the third one contains the names of villages (which depends on the tows selectd in the second selectOneMenu)
In the second line and the next ones, it is the same three selectOneMenu but with others values.
All these selectOneMenu uses converters. like this
<p:selectOneMenu id="id" value="#{xValue}" converter="xConverter" >
<f:selectItem itemLabel="-----" />
<f:selectItems value="#{lstItemsForSelectOneMenu}" />
<p:ajax event="valueChange" listener="#{xChange()}" update="thingsToUpdate"/>
</p:selectOneMenu>
My problem is that the converter xConverter
is executed before the method xChange()
.
The following example explains why it is a problem for me:
if the user chooses in the first line:
1.Continent : America
2. Town: Washington
3. Village: Baltimore
and in the second one he chooses
1.Continent : Africa
2. Town: Tunisia
3. Village: Sfax
After selecting Sfax
he returns immediately to the first line in the second selectOneMenu, in this case how can the system knows that the user hase selected the selectOneMenu of the first line in the converter ?
Thanks