Event update in component "p: commandLink" does not render

1

I have datatable displayed within Dialog primefaces , when I click on commandLink of the line I want, I want to get this value and render it within inputText of my screen, but I'm getting the% following error in my update event.

  

error: javax.faces.FacesException: Can not find component with expression "gerSup"

Why is it not identifying the id of my inputText ? I do not know if it's possible to do what I'm trying to do, but if anyone knew I could give me the hint.

My inputText on the main screen

<p:inputText id="gerSup" value="#{funcionarioBean.funcionario.pessoa.nomePessoa}" style="width:270px; margin-left: 6px;"/>

My p:dialog where I click on the commandLink of the first column

<p:dialog header="Buscar Gerentes Cadastrados" height="300" width="750" widgetVar="gerDialog" modal="true" showEffect="drop" hideEffect="drop" resizable="false">
  <br/>
  <p:outputPanel id="getDetail" style="text-align:center;">

    <h:panelGrid columns="3">
      <h:outputText value="Buscar Gerente: " style="margin-left: 8px;" />
      <p:spacer width="5" />
      <p:inputText style="width:250px;" onkeyup="this.value = this.value.toUpperCase()" />
    </h:panelGrid>
    <br/>

    <p:dataTable var="obj" value="#{funcionarioBean.listGerentesSupervisores}" rows="5" paginator="true" paginatorPosition="bottom">
      <f:facet name="header">
        Gerentes e Supervisores
      </f:facet>
      <p:column width="5%" style="text-align:center">
        <p:commandLink value="Submit" update="gerSup">
          <p:graphicImage value="/resources/img/icon/Accepted16X16.png" />
        </p:commandLink>
      </p:column>

      <p:column headerText="Código" width="10%;" style="text-align:center">
        <h:outputText value="#{obj.pessoa.codigoPessoa}" />
      </p:column>
      <p:column headerText="Nome" width="40%;" style="text-align:center">
        <h:outputText value="#{obj.pessoa.nomePessoa}" />
      </p:column>
      <p:column headerText="Cargo" width="40%;" style="text-align:center">
        <h:outputText value="#{obj.cargo.descricao}" />
      </p:column>
    </p:dataTable>
  </p:outputPanel>
</p:dialog>

Error Message

22:25:02,918 ERROR [io.undertow.request] (default task-64) UT005023: Exception handling request to /sgc/cadastro/funcionario.xhtml: javax.servlet.ServletException: Cannot find component with expression "gerSup" referenced from "formFun:j_idt122:0:j_idt125".
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]

Caused by: javax.faces.FacesException: Cannot find component with expression "gerSup" referenced from "formFun:j_idt122:0:j_idt125".
    at org.primefaces.expression.SearchExpressionFacade.resolveComponentInternal(SearchExpressionFacade.java:422) [primefaces-5.1.jar:5.1]
    at org.primefaces.expression.SearchExpressionFacade.resolveComponentForClient(SearchExpressionFacade.java:200) [primefaces-5.1.jar:5.1]
    at org.primefaces.expression.SearchExpressionFacade.resolveComponentsForClient(SearchExpressionFacade.java:147) [primefaces-5.1.jar:5.1]
    at org.primefaces.util.AjaxRequestBuilder.addExpressions(AjaxRequestBuilder.java:92) [primefaces-5.1.jar:5.1]
    at org.primefaces.util.AjaxRequestBuilder.update(AjaxRequestBuilder.java:85) [primefaces-5.1.jar:5.1]
    at org.primefaces.renderkit.CoreRenderer.buildAjaxRequest(CoreRenderer.java:356) [primefaces-5.1.jar:5.1]
    at org.primefaces.component.commandlink.CommandLinkRenderer.encodeEnd(CommandLinkRenderer.java:93) [primefaces-5.1.jar:5.1]
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at org.primefaces.component.column.Column.renderChildren(Column.java:304) [primefaces-5.1.jar:5.1]
    at org.primefaces.component.datatable.DataTableRenderer.encodeCell(DataTableRenderer.java:963) [primefaces-5.1.jar:5.1]
    at org.primefaces.component.datatable.DataTableRenderer.encodeRow(DataTableRenderer.java:919) [primefaces-5.1.jar:5.1]
    at org.primefaces.component.datatable.DataTableRenderer.encodeRows(DataTableRenderer.java:830) [primefaces-5.1.jar:5.1]
    at org.primefaces.component.datatable.DataTableRenderer.encodeTbody(DataTableRenderer.java:777) [primefaces-5.1.jar:5.1]
    at org.primefaces.component.datatable.DataTableRenderer.encodeTbody(DataTableRenderer.java:740) [primefaces-5.1.jar:5.1]
    at org.primefaces.component.datatable.DataTableRenderer.encodeRegularTable(DataTableRenderer.java:264) [primefaces-5.1.jar:5.1]
    at org.primefaces.component.datatable.DataTableRenderer.encodeMarkup(DataTableRenderer.java:226) [primefaces-5.1.jar:5.1]
    at org.primefaces.component.datatable.DataTableRenderer.encodeEnd(DataTableRenderer.java:85) [primefaces-5.1.jar:5.1]
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:83) [primefaces-5.1.jar:5.1]
    at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:66) [primefaces-5.1.jar:5.1]
    at org.primefaces.component.outputpanel.OutputPanelRenderer.encodeMarkup(OutputPanelRenderer.java:65) [primefaces-5.1.jar:5.1]
    at org.primefaces.component.outputpanel.OutputPanelRenderer.encodeEnd(OutputPanelRenderer.java:41) [primefaces-5.1.jar:5.1]
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:83) [primefaces-5.1.jar:5.1]
    at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:66) [primefaces-5.1.jar:5.1]
    at org.primefaces.component.dialog.DialogRenderer.encodeContent(DialogRenderer.java:180) [primefaces-5.1.jar:5.1]
    at org.primefaces.component.dialog.DialogRenderer.encodeMarkup(DialogRenderer.java:109) [primefaces-5.1.jar:5.1]
    at org.primefaces.component.dialog.DialogRenderer.encodeEnd(DialogRenderer.java:47) [primefaces-5.1.jar:5.1]
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at javax.faces.render.Renderer.encodeChildren(Renderer.java:176) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:456) [jsf-impl-2.2.8-jbossorg-1.jar:]
    at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133) [jsf-impl-2.2.8-jbossorg-1.jar:]
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) [jsf-impl-2.2.8-jbossorg-1.jar:]
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.2.8-jbossorg-1.jar:]
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) [jsf-impl-2.2.8-jbossorg-1.jar:]
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647) [jboss-jsf-api_2.2_spec-2.2.8.jar:2.2.8]
    ... 31 more
    
asked by anonymous 21.04.2015 / 03:39

1 answer

1

Test as follows:

update="@form:gerSup"

In some versions of jsf it works with space.

update="@form gerSup"

Also test in place of @form the id of your form.

Take the test and let it know if it worked.

    
15.07.2016 / 20:43