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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:50:20+00:00 2026-06-01T05:50:20+00:00

I’m using the component rich:fileUpload for uploading files to my server the problem is

  • 0

I’m using the component rich:fileUpload for uploading files to my server the problem is that those files go along with a form that the user fills, so I wanna use one external button for doing this.

The user select the files to upload, fill the form and then click a “Submit” button at the bottom of the page. This upload the file with the form. I’ve tried it like this:

I’m able to hide the button inside the panel of fileUpload so the user don’t click on it.

    <rich:fileUpload id="fileUploadId"
        style="width: 100%; height: 130px;"
        fileUploadListener="#{documentsBean.listener}"
        maxFilesQuantity="1"
        uploadButtonClass="display-none"
        uploadButtonClassDisabled="display-none">
    </rich:fileUpload>

And what I’ve tried with the button is

<a4j: commandButton  id="uploadFormButton"
        value="Attach"
        onclick="#{rich:component('fileUploadId')}.submitForm();"
        oncomplete="#{rich:component('fileUploadId')}.clear(); return false;"/>

But it doesn’t work.

  • 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-01T05:50:22+00:00Added an answer on June 1, 2026 at 5:50 am

    I don’t know if there is a way to do exactly what you want, but here is another solution you can use :

    <html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:rich="http://richfaces.org/rich"
        xmlns:a4j="http://richfaces.org/a4j"
        xmlns:st="http://spectotechnologies.com/jsf"
        xmlns:t="http://myfaces.apache.org/tomahawk">
    
        ...
    
        <h:form enctype="multipart/form-data">
            ... your fields ...
    
            <t:inputFileUpload value="#{bean.document}" />
    
            <h:commandButton value="Submit" actionListener="#{bean.onButtonSubmitClick}" />
        </h:form>
    </html>
    

    and the bean :

    @ManagedBean
    @RequestScoped
    public class Bean
    {
        private UploadedFile m_oDocument;
    
        public void setDocument(UploadedFile p_oDocument)
        {
            m_oDocument = p_oDocument;
        }
    
        @UploadedFileNotEmpty
        @UploadedFileSize(max="10000000")
        @UploadedFileExtension(accept="doc,docx,pdf,txt,rtf,xls,xlsx,zip,rar,jpg,jpeg,jpe,bmp,gif,png,csv,ppt,pptx,odp,pic,odt,ods")
        public UploadedFile getDocument()
        {
            return m_oDocument;
        }
    
        public void onButtonSubmitClick(ActionEvent p_oEvent)
        {
            ...
        }
    }
    

    Hope this helps!

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have thousands of HTML files to process using Groovy/Java and I need to
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am doing a simple coin flipping experiment for class that involves flipping a

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.