1

The problem is that before adding the primefaces tabView everything worked fine i was able to update the second form from the first, now this exception is raised with the same code :

org.primefaces.expression.ComponentNotFoundException

Here's the code :

<p:tab title="profils">

    <h:form class="searchForm">
            <h:outputText value="Recherche:" />
            <p:inputText id="globalFilter" value="#{profil.login}" onkeyup="myCommand();" 
      style="width:150px" placeholder="Filtrer par login"/>
            <p:remoteCommand name="myCommand" actionListener="#{profil.getTheProfils()}" 
                     update=":profilForm" style="display: none;" />
        </h:form>
    <br/>



    <h:form id="profilForm">
    <p:growl id="growl" showDetail="true" sticky="false" />  
    <h:panelGroup id="wrapper">
    <p:dataTable value ="#{profil.profils}" var ="p" rows="5"
             paginator="true"
             paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} 
                {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
             rowsPerPageTemplate="3,5,15" resizableColumns="true" style="margin-bottom:20px" 
             id="profilTable">

   <p:column headerText="Login">                    
      <h:inputHidden value = "#{profil.login}" size = "10" rendered = "#{edit.id eq p.login}" 
    class="form-control"/>                  
      <h:outputText value = "#{p.login}" rendered = "#{edit.id ne p.login}" />
   </p:column>
    </p:dataTable>
   </h:panelGroup>
   </h:form>


</p:tab>

i have tried update="profilTable" update=":profilForm:profilTable" update="@profilTable" ...

Selaron
  • 6,105
  • 4
  • 31
  • 39
Amine Maalfi
  • 145
  • 9
  • And your error does not contain **any** info about wich component cannot be found? – Kukeltje Dec 20 '19 at 14:44
  • 1
    the tabview the tab is in is also a namingcontainer so it should be `nameoftabview:profilForm:profilTable` – fuggerjaki61 Dec 20 '19 at 15:26
  • 1
    Does this answer your question? [How to find out client ID of component for ajax update/render? Cannot find component with expression "foo" referenced from "bar"](https://stackoverflow.com/questions/8634156/how-to-find-out-client-id-of-component-for-ajax-update-render-cannot-find-compo) – fuggerjaki61 Dec 20 '19 at 15:37

1 Answers1

3

The p:tab is allocated in a p:tabView and this looks then like this:

<p:tabView id="tabView">
    <p:tab>
        <h:form id="searchForm">
            <p:remoteCommand ... update="tabView:profilForm:profilTable" />
        </h:form>
    </p:tab>

    <p:tab>
        <h:form id="profilForm">
            <p:dataTable id="profilTable">
                ...
            </p:dataTable>
        </h:form>
    </p:tab>
</p:tabView>

This should solve the org.primefaces.expression.ComponentNotFoundException. This error is caused because a tabView is a namingcontainer (see this). Fix this error by just adding the id of the tabView in front of the searchexpression.


Related Questions

Naming Container in JSF2/PrimeFaces

How to find out client ID of component for ajax update/render? Cannot find component with expression "foo" referenced from "bar"

Community
  • 1
  • 1
fuggerjaki61
  • 822
  • 1
  • 11
  • 24