Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a strange behaviour on a JSF update.

I have two SelectOneMenus and I want to update the second when the first changed. This doesn`t work:

<p:selectOneMenu id="som1" value="#{VBean.somVertrag}" converter="VConverter">
    <p:ajax event="valueChange" update="som2" />
    <f:selectItems value="#{VBean.VList}" var="v" itemValue="#{v}" itemLabel="#{v.VNr}" />
</p:selectOneMenu>
<p:selectOneMenu id="som2" value="#{VBean.somVertrag.VS}" converter="VSConverter">
    <f:selectItems value="#{SDBean.vsList}" var="vs" itemValue="#{vs}" itemLabel="#{vs.vertragsstatus}" />
</p:selectOneMenu>

When I put the som2 Menu before the som1 then it works. I doesn′t know why :-(

<p:selectOneMenu id="som2" value="#{VBean.somVertrag.VS}" converter="VSConverter">
    <f:selectItems value="#{SDBean.vsList}" var="vs" itemValue="#{vs}" itemLabel="#{vs.vertragsstatus}" />
</p:selectOneMenu>
<p:selectOneMenu id="som1" value="#{VBean.somVertrag}" converter="VConverter">
    <p:ajax event="valueChange" update="som2" />
    <f:selectItems value="#{VBean.VList}" var="v" itemValue="#{v}" itemLabel="#{v.VNr}" />
</p:selectOneMenu>

Can anyone explain me why solution 1 is not working?

question from:https://stackoverflow.com/questions/66064100/jsf-selectonemenu-not-updating

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
348 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...