Here is my code
index.xhtml
<h1>Student List</h1>
    <h:form id="studentListForm">
        <h:dataTable id="studentsList"
                     style="border:2px solid;"
                     var="student"
                     value="#{tableItems.students}">
            <h:column>
                <f:facet name="First Name"/>
                <h:outputText value="#{student.firstName}"/>
            </h:column>
            <h:column>
                <f:facet name="Last Name"/>
                <h:outputText value="#{student.lastName}"/>
            </h:column>
            <h:column>
                <f:facet name="Faculty Name"/>
                <h:outputText value="#{student.faculty.name}"/>
            </h:column>
        </h:dataTable>
        <br/>
        <p:commandButton value="Add Student"
                         update=":studentAdding"
                         oncomplete="PF('studentAddingDialog').show();"/>
    </h:form>
addStudent.xhtml
<p:dialog id="studentAddingDialogId" modal="true"
              header="Add Student"
              widgetVar="studentAddingDialog"
              closeOnEscape="true">
        <h:form id="studentAdding">
            <h:outputLabel value="Student first name"/>
            <h:inputText id="firstName"
                         value="#{tableItems.studentFirstName}"
                         required="true"/>
            <br/>
            <h:outputLabel value="Student last name"/>
            <h:inputText id="lastName"
                         value="#{tableItems.studentLastName}"
                         required="true"/>
            <br/>
            <h:outputLabel value="Choose student faculty"/>
            <h:selectOneMenu id="selectFaculty"
                             value="#{tableItems.studentFaculty}"
                             required="true">
                <f:selectItem itemLabel="--Select--" itemValue=""/>
                <f:selectItems value="#{faculties.faculties}"
                               var="itam"
                               itemValue="#{itam.name}"
                               itemLabel="#{itam.name}"/>
            </h:selectOneMenu>
            <p:commandButton value="Submit"
                             actionListener="#{tableItems.addStudent}"
                             oncomplete="PF('studentAddingDialog').hide();"
                             update="studentListForm"/>
        </h:form>
    </p:dialog>
After running the program I see an Error(HTTP Status 500 - Cannot find component for expression ":studentAdding" referenced from "studentListForm:j_idt10".) why it can't recognize the form with it's id from another xhtml file?
 
     
    