0

I am getting the following Error:

Cannot find component with identifier "myForm:display" referenced from "myForm_j_idt32".

my xhtml File :

<div id="divScreen" align="center">
  <div id="divPage">
    <ui:insert>
      <ui:include src="/banner.xhtml"></ui:include>
    </ui:insert>

    <h:form id="menuBarForm">
      <div id="menubar_link">
        <p:commandLink value="Home" action="#{loginAct.homeNavigation}" style="color: #ffffff;margin-left: 10px;" ajax="false"></p:commandLink>
        <p:commandLink action="#{loginAct.dologout}" style="color: #ffffff;margin-left: 10px;" value="Logout" ajax="false"></p:commandLink>
      </div>
    </h:form>


    <div id="divMnuAndFrm">                
      <div id="divMnuContnr">
        <h:form id="menuForm">
          <p:menu style="width: 94%;" model="#{authMenuModel.model}"></p:menu>
        </h:form>
      </div>

      <div id="divFrmContnrwithmenu">
        <div style="height: 400px; margin: 10px 0px 0px 0px;width: 100%;">
          <h:form id="myForm">                      
            <p:dataTable 
              var="filem" 
              value="#{fileViewManagementPnation.data}" 
              rowKey="#{filem.ftype}"
              paginator="true" rows="10"
              selection="#{fileViewManagementPnation.selectedFile}"
              selectionMode="single"
              emptyMessage="No Files Found"                                      
                                 >  

            <p:ajax event="rowSelect" update="myForm:display" oncomplete="fileDialog.show()"/> 

            <f:facet name="header">  
              :: File Management ::       
            </f:facet>  

            <p:column sortBy="#{filem.ftype}" filterBy="#{filem.ftype}" headerText="FileType">  
              #{filem.ftype}
            </p:column>

            <p:column headerText="Version" sortBy="#{filem.version}">  
              #{filem.version} 
            </p:column>  

            <p:column headerText="Size">  
              #{filem.fsize} 
            </p:column>  

            <p:column headerText="File">              
              Action
            </p:column>  
          </p:dataTable>    


          <p:dialog header="File Details" widgetVar="fileDialog" resizable="false" width="400" 
            showEffect="explode" hideEffect="explode">

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

              <f:facet name="header_det">
                <p:graphicImage value="/images/gep_logo.gif" />
              </f:facet>

              <h:outputText value="File Name : " />
              <h:outputText value="#{fileViewManagementPnation.selectedFile.ftype}" id="ftype"/>

              <h:outputText value="Size" />
              <h:outputText value="#{fileViewManagementPnation.selectedFile.fsize}" id="size"/>

              <h:outputText value="File Type :" />
              <h:outputText value="#{fileViewManagementPnation.selectedFile.version}" id="version"/>

            </h:panelGrid>
          </p:dialog>
        </h:form> 
      </div>
    </div>       
  </div>     

  <div id="divFooter">
    <p>Developed and Maintained by National Informatics Centre</p>
  </div>
</div>

I am trying last two weeks to make it work but still am not getting any answers. Please kindly help me in this issue.

Manuel
  • 3,828
  • 6
  • 33
  • 48

2 Answers2

0

You should be able to use update=":myForm:display" or update="display" instead of update="myForm:display".

Take a look at NamingContainer in JSF2/Primefaces, it'll give you a bit more background information. It's because myForm:display refers to nested NamingContainer within myForm which is called myForm, but you don't have that. The component you want to update is directly witin the same NamingContainer, namely myForm. So simply call one of the above mentioned and you should be fine.

Community
  • 1
  • 1
Manuel
  • 3,828
  • 6
  • 33
  • 48
0

You are not calling the right component.

You are calling a component withing the same form.

calling myForm:display will look for a component with id myForm inside the current form myForm as in :myForm:myForm:display which you do not have.

So you do not need to specify the full qualified name of the form. You can use the id of the component directly as in:

Both components (the calling component, and the called component) are inside the same form so use: update="display"

So instead you can either call the component directly as in the example above, or call it using its full qualified name update =":myForm:display"

fareed
  • 3,034
  • 6
  • 37
  • 65