JSF Primefaces Selection Mode

Bitte aktiviere JavaScript!
Ich habe mir einen Selection geschrieben wo ich meine Personen in einem extra Dialogfenster anzeigen kann.
Und in der Anleitung die ich im Internet gefunden habe stehst es so drin wie ich es jetzt gemacht habe:

xhtml Seite:
Java:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"  
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>

        <h:form prependId="false">
            <p:dataTable var="per" 
                         value="#{myBean.l}" 
                         emptyMessage="Keine Daten zu diesem Suchbegriff vorhanden" 
                         filteredValue="#{myBean.filteredPerson}" >

                <f:facet name="header">
                    Test Tabelle
                </f:facet>

                <p:column filterBy="#{per.name}" 
                          headerText="Vorname" 
                          footerText="contains" 
                          filterMatchMode="contains" 
                          sortBy="#{per.name}">                    
                    <h:outputText value="#{per.name}" />
                </p:column>

                <p:column headerText="Alter" filterBy="#{per.alter}" footerText="contains" filterMatchMode="contains" sortBy="#{per.alter}">
                    <h:outputText value="#{per.alter}" />
                </p:column>

                <p:column headerText="Job" filterBy="#{per.job}" footerText="contains" filterMatchMode="contains" sortBy="#{per.job}"> 
                    <h:outputText value="#{per.job}" />
                </p:column>

                <p:column headerText="Level" filterBy="#{per.level}" footerText="contains" filterMatchMode="contains" sortBy="#{per.level}">
                    <h:outputText value="#{per.level}" />
                </p:column>

                <p:column style="width:32px">  
                    <p:commandButton update="display"  oncomplete="myDialog.show()"  
                                     image="ui-icon ui-icon-search">  
                        <f:setPropertyActionListener value="#{per}"  
                                                     target="#{myBean.selectedPerson}" />  
                    </p:commandButton>  
                </p:column> 


            </p:dataTable>

            <p:dialog header="Person Detail" widgetVar="myDialog" resizable="false"  
                      width="200" showEffect="explode" hideEffect="explode">  

                <h:panelGrid id="display" columns="2" cellpadding="4">  

                    <f:facet name="header">  
                        <h:outputText value="abc"/> 
                    </f:facet>  

                    <h:outputText value="Name: " />  
                    <h:outputText value="#{myBean.selectedPerson.name}" />  

                    <h:outputText value="Alter: " />  
                    <h:outputText value="#{myBean.selectedPerson.alter}" />  

                    <h:outputText value="Job: " />  
                    <h:outputText value="#{myBean.selectedPerson.job}" />  

                    <h:outputText value="Levle: " />  
                    <h:outputText value="#{myBean.selectedPerson.level}" />  
                </h:panelGrid>  
            </p:dialog>

        </h:form>
    </h:body>
</html>
Es gibt jedoch einen Fehler aus diesen hier:
Da hab ich mir gedacht i lass das update="display" weg aber dann geht es zwar mit dem Dialogfenster öffnen jedoch wird meist ein anderer Datensatz als Dialog verwendet und beim zweiten mal drücken immer der der als erstes nach dem start gedrückt wurde


Stack Trace:
Java:
javax.faces.FacesException: Cannot find component with expression "display" referenced from "j_idt6:0:j_idt17".
	at org.primefaces.expression.SearchExpressionFacade.resolveComponentInternal(SearchExpressionFacade.java:435)
	at org.primefaces.expression.SearchExpressionFacade.resolveComponentForClient(SearchExpressionFacade.java:220)
	at org.primefaces.expression.SearchExpressionFacade.resolveComponentsForClient(SearchExpressionFacade.java:130)
	at org.primefaces.util.AjaxRequestBuilder.addExpressions(AjaxRequestBuilder.java:87)
	at org.primefaces.util.AjaxRequestBuilder.update(AjaxRequestBuilder.java:80)
	at org.primefaces.renderkit.CoreRenderer.buildAjaxRequest(CoreRenderer.java:207)
	at org.primefaces.component.commandbutton.CommandButtonRenderer.encodeMarkup(CommandButtonRenderer.java:87)
	at org.primefaces.component.commandbutton.CommandButtonRenderer.encodeEnd(CommandButtonRenderer.java:54)
	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
	at org.primefaces.component.datatable.DataTableRenderer.encodeCell(DataTableRenderer.java:823)
	at org.primefaces.component.datatable.DataTableRenderer.encodeRow(DataTableRenderer.java:784)
	at org.primefaces.component.datatable.DataTableRenderer.encodeRows(DataTableRenderer.java:699)
	at org.primefaces.component.datatable.DataTableRenderer.encodeTbody(DataTableRenderer.java:654)
	at org.primefaces.component.datatable.DataTableRenderer.encodeRegularTable(DataTableRenderer.java:249)
	at org.primefaces.component.datatable.DataTableRenderer.encodeMarkup(DataTableRenderer.java:211)
	at org.primefaces.component.datatable.DataTableRenderer.encodeEnd(DataTableRenderer.java:83)
	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
	at javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
	at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889)
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856)
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
	at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:456)
	at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
	at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
	at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:526)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:655)
	at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1566)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1523)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
Bitte um Hilfe..
 
Zuletzt bearbeitet:
Passende Stellenanzeigen aus deiner Region:

Neue Themen

Oben