I have a problem getting AJAX and a h:selectOneMenu to work together. I have a select box and when the user selects an entry, then I would the value inserted into myFacade.secondaryAttribute and then re-render the panelGroup called details.
I've found a lot of threads about this, and I have tried converts, change listeners and nothing works :-( If I add a commandButton and attach ajax to this - then I get a server error.
serverError: class java.lang.NullPointerException
My code snippet:
<h:form>
<h:panelGroup layout="block" styleClass="dropdown">
<h:selectOneMenu value="#{myFacade.secondaryAttribute}" id="secondaryAttribute">
<f:selectItems value="#{myFacade.attributes}" var="attribute" itemLabel="#
{attribute.description}" itemValue="#{attribute}"></f:selectItems>
<f:ajax event="change" render=":details"></f:ajax>
</h:selectOneMenu>
</h:panelGroup>
</h:form>
<h:panelGroup id="details">
...
</h:panelGroup>
I hope that someone has an idea as to what I'm doing wrong - or whether this is not possible at all (found some forum threads saying that you cannot use ajax with h:selectOneMenu?)
Thanks in advance.
/Søren