Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7075191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:08:53+00:00 2026-05-28T06:08:53+00:00

I have a p:fileUpload which works fine. But I need a partial page rendering

  • 0

I have a p:fileUpload which works fine. But I need a partial page rendering of a p:datatable after a new file was uploaded. The datatable shows the current files.

The strange this is, once I upload one file, the table is rerendered, showing one record. But the second time the table is not rerendered, ALTHOUGH the code shows there are 2 entries. This is blowing my mind, I have spent the entire day trying to get this working. At the moment I have a workaround using a ui:repeat.

Here is the code

    <h:outputLabel value="Files Upload" style="font-weight: bold;" />
    <p:fieldset>

      <p:fileUpload id="iconUpload" update="@form"
        fileUploadListener="#{appCreateController.processUpload}"
        image="/resources/gfx/file_browse_normal.png"
        allowTypes="*.jpg;*.png;*.gif;*.doc;*.exe;*.msi"
        description="Icon">
      </p:fileUpload>

   </p:fieldset>
   <p:message for="iconUpload" />

   <p:dataTable var="appFile" id="appFiles"
    value="#{appCreateController.uploadedFiles}" rows="10">
    <p:column>
    <f:facet name="header">
    <h:outputText value="Name" />
    </f:facet>
       <h:outputText value="#{appFile.uploadedFile.fileName}" />
    </p:column>
        <p:column>
    <f:facet name="header">
    <h:outputText value="Content Type" />
    </f:facet>
    <h:outputText value="#{appFile.uploadedFile.contentType}" />
    </p:column>
    <p:column>
    <f:facet name="header">
    <h:outputText value="File Type" />
    </f:facet>
    <h:selectOneMenu value="#{appFile.uploadedFileType}" id="fileType">
    <f:selectItems var="uploadedFileType"
          value="#{appCreateController.uploadedFileTypes}"
      itemLabel="#{uploadedFileType.name}" />
      </h:selectOneMenu>
    </p:column>
    <p:column>
       <f:facet name="header">
    <h:outputText value="Size" />
    </f:facet>
    <h:outputText value="#{appFile.size}" />
    </p:column>
   </p:dataTable>

Backing bean code:

    public void processUpload(FileUploadEvent event)
            throws AbortProcessingException {

        log.debug("Uploading file: " + event.getFile().getFileName());

        UploadedFileVO uploadedFileVO = new UploadedFileVO();
        uploadedFileVO.setUploadedFile(event.getFile());

        uploadedFiles.add(uploadedFileVO);

        log.debug("Uploaded file: " + event.getFile().getFileName());

        log.debug("file list now contains file : " + uploadedFiles.size());
    }

    public List<UploadedFileVO> getUploadedFiles() {

        log.debug("Getting uploadedFiles. Total == " + uploadedFiles.size());

    return uploadedFiles;
  }


    public UploadedFileType[] getUploadedFileTypes() {
     return UploadedFileType.values();
   }

Hope anyone knows a solution 🙂

Cheers,
Coen

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:08:53+00:00Added an answer on May 28, 2026 at 6:08 am

    OK, I tried with 2.2.1 and upgraded for this issue to 3.0.1. The problem still occurred with 3.0.1 but it is fixed now.

    Apparently the JSF engine did not see that the contents of the datatable changed because the getter was already called via another method in the backing bean.

    I had another method which in its turn called getUploadedFiles() before the xhtml page did, somehow this affected the re-population of the datatable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this simple script which works fine, but currently overwrites files with duplicate
I have a file upload script that works [finally] but want to have users
I have a FileUpload control, and when I select the file 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.txt' , (which
I have HTML page, which gives an option to upload a file to the
I have setup uploadify which works fine on Firefox with mulitple image uploads. However,
I have a HTML file upload field from which I'm reading the file name
I have a form which binds a model and a file upload using the
I have a page that have fileupload control, on the submission of the form,
I have a FileUpload control in the Source page. On the Upload button handler,
I have an aspx page with multiple FileUpload controls and one Upload button. In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.