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?
QueryParamStyle
. – Alleyne