I have a <rich:popupPanel>
tag and inside of it I use <f:ajax>
events. Therefore the <rich:popupMenu>
also needs to have a <h:from>
inside of it. In my ajax event I need to grab a value form the 'main page' therefore I list it in the execute list with the corresponding :formid:elementid pattern but this doesn't work - the value is null in the listener method. here is the code:
<h:form id="form">
...
<h:selectOneMenu id="selectUser" value="#{usersBean.user_id}" styleClass="comboBoxes" >
<f:selectItems value="#{usersBean.myModelUsersValues}" />
<a4j:ajax event="valueChange" listener="#{usersBean.userSelected}" render="login password customer_name" execute="@this"/>
</h:selectOneMenu >
...
</h:form>
<rich:popupPanel id="popup" modal="true" autosized="true" resizeable="false">
<f:facet name="header">
<h:outputText value="Atributes" />
</f:facet>
<f:facet name="controls">
<h:outputLink value="#" onclick="#{rich:component('popup')}.hide(); return false;">
X
</h:outputLink>
</f:facet>
<h:form id="popupForm">
...
<h:selectOneListbox id="atrib_list" value="#{usersBean.atribSelect}" styleClass="comboBoxes" style="height:100px;width:100px;">
<f:selectItems value="#{usersBean.atribValues}" />
<f:ajax event="valueChange" listener="#{usersBean.atribValuesChanged}" render="child_list" execute="@this :form:selectUser"/>
</h:selectOneListbox >
...
</h:form>
</rich:popupPanel>
In the usersBean.atribValuesChanged
listener method the usersBean.user_id
field is empty (not having the value that was selected). How can I force to execute the form:selectUser element so that I can read it's selected value in my listener method?
Part2:
This is just a btw. question, maybe I should open another thread for this. The problem is that when the <h:selectOneListBox>
has only one value it is created more like a h:selectOneMenu
. This looks bad and also the valueChange
event is not fired when you select it. This problem does not exist in <h:selectManyListBox>
is it a bug? Is it fixable?