English 中文(简体)
f: 具有多重价值的概览
原标题:f:viewParam with multiple values

我有<代码><f:viewParam>驱动搜索屏幕。 我正试图实施这一计划,为单一<代码><f:viewParam>采用多种数值。

我认为,正确的《URL》将研究类似的东西。

<url>?state=COMPLETE&state=PENDING

第十节是:

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

我尝试了以下2个支持加勒比的方法:

public void setState(State... state)

希望共同基金的实施能为价值观建立一个阵列,并立足于背后的灯塔。 共同财产基金的实施没有出现错误,说明它不能将遗体转化为各种遗体。

public void setState(State state)

或许《共同财产法》的实施将确定转换值,因为它在《欧洲不动产法》中发现这些价值。 只确定了第一个数值。

<代码>stateNameConverter <代码>String和_enum数值之间的换算。

是否有可能在联合论坛中为<代码><f:viewParam>规定多重数值。 2 ?

最佳回答

可惜的是,没有这样的标签:<f:viewParams>。 在Mojarra s >>> 编码 执行(该代码为<><的编码;f:viewram>

@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);

}

现在,你的最佳工作方式是收集以下数值:从<条码>中得出的数值:ExternalContext#getRequestParaileValuesMap( in a @PostConstruct<f:viewAction> or maybe a @Managedproperty(#{paramValues.state}”) Property>。

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

问题回答

暂无回答




相关问题
JSF a4j:support with h:selectManyCheckbox

I m having trouble with a JSF selectManyCheckbox and A4J support. The purpose is to run some action when a checkbox is selected. This works perfectly in Firefox. Yet, when testing in any IE (ie6 / ie7 ...

Mojarra for JSF Encoding

Can anyone teach me how to use mojarra to encode my JSF files. I downloaded mojarra and expected some kind of jar but what i had downloaded was a folder of files i don t know what to do with

如何拦截要求终止?

在共同基金中,如果用户要求终止,就需要采取一些行动。 我需要某种拦截器,但我不知道如何这样做。 我需要帮助。 增 编

ICEFaces inputFile getting the file content without upload

Is there any way of just getting the content of the browsed file without any upload/file transfer operations? I currently use ICEFaces inputFile component but I do not need the default uploading ...

Weird behaviour of h:commandLink action (MethodExpression)

I have two JSPs where I am displaying some info from database in a h:dataTable. One of them is showing all the info, and one of them user specifically. I have showXML.jsp that shows the "XML" column ...

How to correctly use ResultSet with h:dataTable

The problem is, that after displaying the ResultSet with <h:dataTable>, the connection is left open. If I close it, it closes the ResultSet too. I m thinking about copying the ResultSet data ...

热门标签