0

my code looks like this, my form-element is in my template.xhtml:

<ui:define name="content">
    <h:panelGrid columns="1" styleClass="benutzerVerwaltung">
        <p:panel header="Benutzerverwaltung">
            <h:panelGrid columns="1">
                <p:selectOneListbox id="benutzerBisher" style="font-size:1.3em;"
                    value="#{mainBean.gewaehltListe}" var="benutzer" filter="true"
                    filterMatchMode="contains">
                    <f:selectItems value="#{mainBean.benutzerBisher}" var="ben"
                        itemLabel="#{ben.email}" itemValue="#{ben}"/>
                    <f:ajax render="ausgewaehlterBenutzer"/>
                    <p:column>
                        <h:outputText value="#{benutzer.email}" />
                    </p:column>
                </p:selectOneListbox>                   
            </h:panelGrid>              
        </p:panel>              
    </h:panelGrid>
    <h:panelGrid columns="2" id="ausgewaehlterBenutzer">
                <h:outputLabel value="Vorname"/>
                <p:inputText value="#{mainBean.gewaehltListe.vorname}" id="vo"/>
                <h:outputLabel value="Nachname"/>
                <p:inputText value="#{mainBean.gewaehltListe.name}" id="na"/>
                <h:outputLabel value="Kundennummer"/>
                <p:inputText value="#{mainBean.gewaehltListe.kundennummer}" id="ku"/>
                <h:outputLabel value="EMail"/>
                <p:inputText value="#{mainBean.gewaehltListe.email}" id="em"/>
                <h:outputLabel value="Firma"/>
                <p:inputText value="#{mainBean.gewaehltListe.firma}" id="fi"/>
    </h:panelGrid>
    <p:commandLink value="zurück" action="#{mainBean.main()}"/>
</ui:define>

So what i want is that if i select some in the ListBox, the input fields should be update with the selected one. My Problem now is, that nothing happend and i got the error message:

javax.el.PropertyNotFoundException: /benutzerverwaltung.xhtml @28,70 value="#{mainBean.gewaehltListe.vorname}": Target Unreachable, 'null' returned null

user3515460
  • 139
  • 1
  • 10

1 Answers1

0

Try to add a "converter" in the p:selectOneListbox tag declaration.

In your case you should have something like this : <p:selectOneListbox [..] converter="gewaehltListeConverter">

See http://www.primefaces.org/showcase/ui/input/listbox.xhtml for further informations.

There is a concrete example of what you want exactly

David H.
  • 905
  • 1
  • 7
  • 19