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 9007643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:44:44+00:00 2026-06-16T01:44:44+00:00

in my application, I have a form with multiple primefaces fileUploader in simple mode.

  • 0

in my application, I have a form with multiple primefaces fileUploader in simple mode. These uploader components are dynamically generated, one for each row of a dataTable.
I’d like to mark them as required so I tried this:

<h:form enctype="multipart/form-data" id="aform">
   <p:dialog id="dlgId">
    <p:dataTable var="foo" id="table"
        value="#{myBean.fooList}">
        <p:column>
           <p:fileUpload value="#{foo.file}" mode="simple" required="true"/>
        </p:column>
    </p:dataTable>

    <p:commandButton id="submit" value="Submit" ajax="false"
        actionListener="#{myBean.listener}" update="dlgId">
    </p:commandButton>
  </p:dialog>
</h:form>

The problem is that the form is correctly working if I upload all the files but the validation is not executed. The PrimeFaces version is 3.4.

  • 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-06-16T01:44:45+00:00Added an answer on June 16, 2026 at 1:44 am

    As per the comments, you have actually this form inside a dialog which get closed/hidden after submit. You basically need to let the visible attribute of the dialog evaluate true when the form inside the dialog is submitted and there’s a validation error.

    You can achieve it as follows:

    <p:dialog ... visible="#{dialogForm.submitted and facesContext.validationFailed}">
        <h:form binding="#{dialogForm}">
            ...
        </h:form>
    </p:dialog>
    

    Unrelated to the concrete problem, the dialog should not go inside a form, instead the dialog should have its own form (because 1) the dialog may be implicitly relocated to the end of body by JS and 2) you don’t want to submit/process all other inputs which are outside the dialog’s view). So if the dialog is currently by itself inside a form with all other input controls, you should move it outside, e.g. to the very bottom of the body.

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

Sidebar

Related Questions

I have an application with multiple forms, each form has the same icon, so
In my web application I have a simple employee form. Each employee has a
I have multiple master pages in my asp.net mvc web application... Each of the
I have a window form application, and it has multiple threads running that would
We have an application with multiple subsystems running in different threads (ie one thread
I have a web application that runs multiple websites from one codebase. I have
I currently have an application that spawns multiple instances of a single win form.
I have a .net winforms application, where multiple forms are displayed at one time.
I am making a multiple form based application and have encountered a problem with
My application has multiple form and each form with multiple fields. I find tabIndex

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.