Ajax update problem

UI Components for JSF
Post Reply
loright
Posts: 42
Joined: 10 Aug 2011, 09:55

15 Aug 2011, 10:27

Hello, i have problem with ajax update. I try update page after fileupdate and befor dialog show and log say me, that "cannot find component with identificator "updatePage"" and when dialog show log say "cannot find component with identificator "errorDialog"". Where i can do mistake?

primeface 3.0 m2 + tomcat 7.0.19
Primefaces 3.4 + JBoss 6.1. Final

loright
Posts: 42
Joined: 10 Aug 2011, 09:55

15 Aug 2011, 10:29

Code: Select all


<f:view>
<h:body >
 <h:form id="uploadPage" enctype="multipart/form-data">
     <p:fileUpload id="fileUploader"
                   fileUploadListener="#{fileUploadController.handleFileUpload}"
                   mode="advanced"
                   multiple="true"
                   label = "Select"
                   uploadLabel = "Upload"
                   cancelLabel = "Cancel"
             />
    <p:dataTable id="table"
                 var="uploadResult"
                 value="#{fileUploadController.results}"
                 dynamic="true">
        <p:column>
            <f:facet name="header">
                <h:outputText value="File name" />
            </f:facet>
        </p:column>
        <p:column>
            <f:facet name="header">
                <h:outputText value="File type" />
            </f:facet>
        </p:column>
        <p:column>
            <f:facet name="header">
                <h:outputText value="Status" />
            </f:facet>
            <h:outputText value = "Upload success"
                          rendered = "#{uploadResult.correctUpload}"/>
            <p:fileUpload id="fileReUploader"
                          rendered = "#{uploadResult.upload}"
                          fileUploadListener="#{fileUploadController.reUpload}"
                          label = "Reload"
                          auto="true"
                          value="#{uploadResult}"
                          target="#{fileUploadController.selectedUploadResult}"
                          zindex="#{uploadResult.numberInList}"
                          update="uploadPage"
                          dynamic="true"
                   />
        </p:column>
        <p:column>
            <f:facet name="header">
                <h:outputText value="Error" />
            </f:facet>
            <h:outputText value="#{uploadResult.errorMessage}" />
                <p:commandButton oncomplete="errorDialog.show()"
                                 title="Report"
                                 rendered="#{!uploadResult.correctUpload}"
                                 update="errorTable"
                                 image="ui-icon ui-icon-search"
                        >
                    <p:ajax update="errorTable"/>
                    <f:setPropertyActionListener value="#{uploadResult}" target="#{fileUploadController.selectResult}" />
                </p:commandButton>
        </p:column>
    </p:dataTable>
    <p:dialog header="Error Detail" widgetVar="errorDialog" resizable="false" id="errorDlg"
              width="500" showEffect="fade" hideEffect="explode" modal="true" >

        <p:dataTable id="errorTable"
                 var="errors"
                 value="#{fileUploadController.selectResult.errorList}"
                >
            <p:column>
                <f:facet name="header">
                    <h:outputText value="Number line" />
                </f:facet>
                <h:outputText value="#{errors.lineNumber}" />
            </p:column>

            <p:column>
                <f:facet name="header">
                    <h:outputText value="Description" />
                </f:facet>
                <h:outputText value="#{errors.description}" />
            </p:column>
        </p:dataTable>

    </p:dialog>
 </h:form>
</h:body>
</f:view>
</html>
Primefaces 3.4 + JBoss 6.1. Final

gaus
Posts: 7
Joined: 28 Apr 2010, 11:27

15 Aug 2011, 12:30


loright
Posts: 42
Joined: 10 Aug 2011, 09:55

16 Aug 2011, 07:09

Thanx, this way all work great!
Primefaces 3.4 + JBoss 6.1. Final

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 49 guests