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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:48:31+00:00 2026-05-26T05:48:31+00:00

I have a <f:viewParam> driven search screen. I am trying to implement it to

  • 0

I have a <f:viewParam> driven search screen. I am trying to implement it to take multiple values for a single <f:viewParam>.

I believe the correct URL would look something like

<url>?state=COMPLETE&state=PENDING

The XHTML section is as follows:

<f:metadata>
   <f:viewParam name="state"
      value="#{backingBean.state}"
      converter="#{stateNameConverter}" />
</f:metadata>

I have tried the following 2 method signatures on backingBean:

public void setState(State... state)

Was hopeful that JSF implementation would build an array for the values and set on the backing bean. JSF implementation failed with error stating it cannot convert enum to array of enums.

public void setState(State state)

Thought that maybe the JSF implementation would set the converted values as it found them in the URL. Only the first value was set.

The stateNameConverter converts between String and enum value.

Is it possible to have multiple values for <f:viewParam> in JSF 2?

  • 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-26T05:48:32+00:00Added an answer on May 26, 2026 at 5:48 am

    No, unfortunately, there’s no such tag as <f:viewParams>. There’s also a comment in Mojarra’s UIViewParameter#decode() implementation (which is the code behind <f:viewParam> tag) which confirms that:

    @Override
    public void decode(FacesContext context) {
        if (context == null) {
            throw new NullPointerException();
        }
    
        // QUESTION can we move forward and support an array? no different than UISelectMany; perhaps need to know
        // if the value expression is single or multi-valued
        // ANSWER: I'd rather not right now.
        String paramValue = context.getExternalContext().getRequestParameterMap().get(getName());
    
        // submitted value will stay as previous value (null on initial request) if a parameter is absent
        if (paramValue != null) {
            setSubmittedValue(paramValue);
        }
    
        rawValue = (String) getSubmittedValue();
        setValid(true);
    
    }
    

    Right now your best bet to workaround this is by gathering the values yourself from ExternalContext#getRequestParameterValuesMap() in a @PostConstruct or <f:viewAction> or maybe a @ManagedProperty("#{paramValues.state}") on a String[] property.

    You could also create a custom <my:viewParams> tag which achieves that, but this isn’t exactly trivial.

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

Sidebar

Related Questions

I have two separate views that both show multiple lists of values. Both views
I have the following simple view main.xhtml , the request URL would be something
Have a n-tire web application and search often times out after 30 secs. How
Have you ever seen someone try to implement the MVP pattern with ASP.NET Web
I have a JSF page that accepts a viewparam and sets a variable which
I have created a simple Eclipse RCP application where I can open multiple editor
I have problem firing an ajax request with Primefaces <f:metadata> <f:viewParam name=token value=#{clientBean.token}/> <f:event
have been trying couple of hours now to make my iphone app universal. The
i have one perspective and one viewpart. The viewpart is shown as soon as
I have a view in Eclipse (implemented by a class which extends org.eclipse.ui.part.ViewPart )

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.