Hello.
I've got 2 components, watching one backing bean value:
<h:selectOneMenu value="#{tableData.country}"
onchange="submit()"
immediate="true"
valueChangeListener="#{tableData.countryChanged}">
<f:selectItems
value="#{tableData.countryNames}" />
</h:selectOneMenu>
<h:selectOneMenu value="#{tableData.country}"
onchange="submit()"
immediate="true">
<f:valueChangeListener
type="my.examples.CountryListener"/>
<f:selectItems
value="#{tableData.countryNames}" />
</h:selectOneMenu>
If i change the value of the one component, the other dont get it - of
cause, because the new value is in the event object and these are
processed later, the other component saw the old value, which is changed
after that - so the component missed the update.
Doing a second submit of another kind, shows the correct active value
for the attribute watched, now correct on the former wrong displayed
component.
How to solve this problem, that a value may be watched by different
components ( doesnt matter if the components use the same listener or
not ). ?
Lets call the above problem X.
Now it also happens, that if another valuechangeevent for another
component is thrown and the View gets updated, X shows the wrong active
value, the one of the X component which didnt get updated right.
example:
Y: 10
X1: en
X2: en
click on X1: change it to -> de
update view shows:
Y: 10
X1: de
X2: en
The UI is now rendered with german messages from the de_DE message
bundle.
now click on Y and change it to 5:
updated view shows:
Y: 5
X1: en
X2: en
But the UI is still in german text, not english - the value of the
backing bean is en, making some updates on Y from 10 to 5 or 20 shows en
in the backing bean, but somewhere the UI forgot to change the locale
back.
Testing a little bit, it seems that the last rendered component watching
this value is the one which counts, regardless if other components
rendered before does some changes to the value of the backing bean, the
value of the last one overrides - although the first ones do update the
view to the correct languages, the event gets called.
If i only use the last rendered component watching the value, backing
bean value gets updated right every time - although the other ones still
lack the problem mentioned X above.
Hope its not to confusing ;).
Bug or not, any solution for the tow problems or am i doing a fatal
mistake here?
kind regards
Torsten
-- Press every key to continue. --