I have a datalist within an a4j:region which contains a list of names. At page laoding the names are correctly printed.
By selecting one Name of the Selectbox (which is also within the region) i want to add this selected Name to be printed out at the dataList.
Here is my xhtml-snippet:
<a4j:region id="names_region" renderRegionOnly="true" >
<rich:dataList styleClass="inlinelist" id="name_repeat" value="#{personDetailBean.names}" var="name" >
<h:outputText value="#{name.fullName}" />
</rich:dataList>
<h:selectOneListbox id="new_name" size="1" value="#{personDetailBean.currentName}" >
<a4j:support actionListener="#{personController.addName}" event="onchange" />
<f:selectItems value="#{utilWebController.namesForSelect }"/>
<f:converter converterId="nameConverter"/>
</h:selectOneListbox>
</a4j:region>
The actionlistener which is initiated by the onchange-event looks like this:
public void addName(ActionEvent event) {
PersonDetailBean detailBean = (PersonDetailBean) getRequestBean(RequestBeanName.PERSON_DETAIL);
Name name = detailBean.getCurrentName();
detailBean.getNames().add(name);
detailBean.setCurrentName(null);
}
When i debug into the request, i can see the method 'addName' is successfully called and processed and even the List of names increases with every ajax-request. However, the datalist does not update.
I'm using Richfaces 3.3.3.Final with JSF 1.2 (Myfaces) and Facelets.
i'm not exactly sure how, but somehow i made it work. What i did: I added the ajaxSingle="true" and reRender Attribute to the a4j:support-tag