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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:41:02+00:00 2026-06-13T19:41:02+00:00

I am facing a problem that I could not find any resolution for… I

  • 0

I am facing a problem that I could not find any resolution for…
I have a selectManyChoice component like this:

<af:selectManyChoice value="#{bindings.my_VO1.inputValue}" 
                     label="myLabel" id="smc1"
                     binding="#{pageFlowScope.myBean.myMultiSelection}"
                     autoSubmit="true">
  <f:selectedItems value="#{bindings.my_VO1.items}" id="si1"/>
</af:selectManyChoice>

For getting out the values, I tested using 2 buttons like this:

<af:commandButton text="First Button" 
                  id="cb1" 
                  action="#{pageFlowScope.myBean.saveSelection}>
  <af:fileDownloadActionListener method="#{pageFlowScope.myBean.exportReport}"/>
</af:commandButton>

And:

<af:commandButton text="Second Button" 
                  id="cb2" 
                  action="#{pageFlowScope.myBean.saveSelection}/>

The second button could successfully get the selected values and print them out to the screen. However, the first button could not. It would always throw a NullPointerException when i tried to call myMultiSelection.getValue(), at this line of code:

public String saveSelection() {
    if (myMultiSelection.getValue() != null) {

The only difference between them is the fileDownloadActionListener tag. I wonder if that tag was affecting the inner works of the first button…However, I still need that tag, since the purpose of the button is to generate a pdf file based on the selected values, and have the browser download that file. Can anybody point me to the right direction?

  • 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-13T19:41:03+00:00Added an answer on June 13, 2026 at 7:41 pm

    You can try it this way :
    Use your second button and in his actionlistener you just call the fileDownloadActionListener. That way you know for sure if the selected value is correct.

    Example : http://adfwithejb.blogspot.be/2012/08/calling-affiledownloadactionlistener_2.html

    Edit:
    Instead of using JS to call the actionlistener you can do it this way:

    Add these to your page :

    <af:commandButton text="Hidden Button" binding="#{pageFlowScope.myBean.btnHiddenButton}"
                      id="cb1" visible="false">
      <af:fileDownloadActionListener method="#{pageFlowScope.myBean.exportReport}"/>
    </af:commandButton>
    
    <af:commandButton text="Visible Button" 
                      id="cb2" 
                      action="#{pageFlowScope.myBean.saveSelection}/>
    

    Then in your bean, go to the saveSelection method and do some stuff the get your correct data.
    After that add this :

    ActionEvent event = new ActionEvent(btnHiddenButton);
    event.queue();  
    

    This will trigger the hidden button without pressing it. (make sure you have a binding of course)

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

Sidebar

Related Questions

I was facing this problem earlier today, and since I could not find a
I'm facing this problem and could not get through by any means. Here is
I'm probably not the first one facing this problem, but I couldn't find a
I'm facing a problem that I can summarize as it follows: I have a
I'm facing a problem that seems to have no straighforward solution. I'm using java.util.Map
So here is the problem that I am facing: I have an application that
I am facing a problem that I can not understand . During a plugin
I have downloaded cppcheck tool and build it. Now am facing the problem that
Can you please help me with this problem that I am facing last days.
Im currently facing the problem that when i try to set focus on some

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.