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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:21:39+00:00 2026-05-18T00:21:39+00:00

My application has a modal panel where the user can upload files and choose

  • 0

My application has a modal panel where the user can upload files and choose a “document type” in a drop-down select.

I was using an <f:setPropertyActionListener> to set the document type value during the upload event, but sometimes the property is set after the upload has been processed. Probably it’s happening because another request is being generated, and this request is handled by another web container thread.

<rich:modalPanel id="attachFiles" autosized="true">
    <h:form id="formUpload" enctype="multipart/form-data">
        <h:selectOneMenu id="docType"  value="#{myMB.docType}" required="true" >
            <f:selectItems value="#{myMB.docTypesSelectItems}"  />
    </h:selectOneMenu>`
        <rich:fileUpload id="upload" fileUploadListener="#{myMB.handleUpload}">
            <a4j:support event="onupload">
                <f:setPropertyActionListener value="#{myMB.docType}" 
                    target="#{myMB.docType}" />
            </a4j:support>
        </rich:fileUpload>
</rich:modalPanel>

When it happens, the value of myMB.docTypeis null during the execution of myMB.handleUpload, which is not expected, since the field is supposed to be required.

Is there a way to assure that the method myMB.handleUpload is executed only after the property of docType has been set?

  • 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-18T00:21:39+00:00Added an answer on May 18, 2026 at 12:21 am
    <f:setPropertyActionListener value="#{myMB.docType}" target="#{myMB.docType}" />
    

    I don’t get you. The target is the same as the value. You’re basically setting the target’s value with self. Isn’t the value itself simply already null?

    Anyway, I don’t do RichFaces, so I can’t go in detail, but I know that it’s using Flash under the covers for the upload component and that such a construction usually fires a separate (and standalone) request which doesn’t take all other HTML form parameters into account. The “normal” JSF inputs comes thereafter in a separate HTTP request. So you’re kind of lost here without bringing in some nasty JS/ajax hacks. At least, in theory.

    Your best bet is to get hold of the uploaded file as a bean propery in the listener method and then process that further in the normal bean’s action method (the one attached to some UICommand component in the same form).

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

Sidebar

Related Questions

I created two application MainApps and SubApps, the SubApps has a modal type dialogbox
My Rails 2.3 application has a User model and the usual controller actions. The
Version 1.0 of an application has a data model, which is saved/loaded using the
I am building an application which has multiple user entry screens. I would like
My Flex 3 application has some modal dialogs displayed via the PopUpManager, but there
My MFC application has a CView and a couple of floating non-modal dialogs. I
My application has modal dialogs in it, and also a feedback widget that sticks
I've an application that has many modal windows. But, one window is modal less
I'm trying to open a modal dialog as soon as a WPF application has
I have a Delphi 7 application that has two views of a document (e.g.

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.