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

  • Home
  • SEARCH
  • 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 6191413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:45:35+00:00 2026-05-24T02:45:35+00:00

I am using <rich:fileupload> and I need to send some extra parameters to my

  • 0

I am using <rich:fileupload> and I need to send some extra parameters to my Controller. I tried to use <f:param> for this.

Here is the view:

<rich:fileUpload 
    fileUploadListener="#{fileUploadController.listener}"
    maxFilesQuantity="#{fileUploadController.uploadsAvailable}"
    addControlLabel="Hinzufügen"
    uploadControlLabel="Hochladen"
    cancelEntryControlLabel="Abbrechen"
    doneLabel="Fertig"
    clearAllControlLabel="Alle entfernen"
    noDuplicate="true"
    stopControlLabel="Stop"
    clearControlLabel="Entfernen"
    id="upload"                             
    immediateUpload="#{fileUploadController.autoUpload}"  
    ajaxSingle="true"
    acceptedTypes="jpg" 
    allowFlash="#{fileUploadController.useFlash}"
    rerender="info">

    <a4j:support event="onuploadcomplete" reRender="info" status="globalStatus" />

    <f:param 
    value="#{imageFormat}"  
    name="#{fileUploadController.imageFormat}"/>

</rich:fileUpload>

Here is the FileUploadController backing bean:

    private String imageFormat;

    public void setImageFormat(String imageFormat) {
        this.imageFormat = imageFormat;
    }

    public String getImageFormat() {
        return imageFormat;
    }

However, the setter is never called, so the variable is always null. The #{imageFormat} has the correct value, I verified it with an <h:outputText>.

I can’t use <a4j:param>, because there is no button to hook on.

We are using JSF 1.2, not JSF 2.0.

  • 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-24T02:45:37+00:00Added an answer on May 24, 2026 at 2:45 am

    To perform some operations on specific phases of upload, you can attach to an event of rich:fileUpload. Along with standard events, rich:fileUpload provides a number of specific events:

    • The “onadd” event handler called on an add file operation
    • The “onupload” which gives you a possibility to cancel the upload at
      client side
    • The “onuploadcomplete” which is called after all files from the list
      are uploaded
    • The “onuploadcanceled” which is called after upload has been canceled
      via cancel control
    • The “onerror” which is called if the file upload was interrupted
      according to any errors

    To invoke server side logic using AJAX when event occurs, use ‘a4j:status’ or ‘a4j:jsFunction’, for example using ‘a4j:status’:

    <rich:fileUpload
            yourParameters="...">
        <a4j:support event="onuploadcomplete" reRender="something" action="#{fileUploadController.setImageFormat(imageFormat)}"/>
    </rich:fileUpload>
    

    and using ‘a4j:jsFunction’ (also demonstrated how to use setPropertyActionListener, it is for case if your EL resolver does not support method invocations with parameters (refer to BalusC comment))

    <rich:fileUpload onupload="setImageFormat();"
            yourParameters="..."></rich:fileUpload>
    
    <a4j:jsFunction name="setImageFormat">
        <f:setPropertyActionListener value="#{imageFormat}" target="#{fileUploadController.imageFormat}"/>
    </a4j:jsFunction>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tries to upload the file using rich:fileupload componenet.When i tried to upload
I am using php to output some rich text. How can I strip out
I m using a rich:calendar to display Date in my application But some how
I have menu build on Richfaces using rich:menuitem. I need to determine, which menuitem
According to Using Rich Edit Controls I use RichEdit in such way: MyControl::OnCreate() {
I have some rich text created using the flex (flash builder 4) rich text
I'm using playframework to build a web site. And I also use a rich
I am using a rich text box to enter some variables. I am restricting
Using delphi and rich edit, I need to replicate something along the lines of
I am currently using a rich:dataTable to display some information from the database. I

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.