f:param或f:关于primefaces自动完成的属性支持?

ber*_*tie 5 jsf primefaces jsf-2

我已经读过核心JSF组件支持f:paramf:属性标记,以便将一些值传递给服务器端的封闭UI组件.

我需要能够为primefaces的自动完成组件执行此操作,以便自动完成方法能够使用f:paramf:属性提供的参数.我试图找到实现这一目标的方法,并发现完整的方法参数是固定的,不能采用更多的参数,因此我想使用f:paramf:attribute.

我使用2.2.x版本,并根据我的实验,我似乎无法得到f:paramf:属性工作

<p:autocomplete ...>
   <f:param name="myParam" value="xxxx" />
</p:autocomplete>
Run Code Online (Sandbox Code Playgroud)

primefaces是否支持自动完成组件上的此功能?无论如何,我可以找出支持参数的标签和那些不支持的标签?

谢谢 !

ber*_*tie 15

最后我搞定了!

这是jsf部分:

<p:autoComplete id="#{cc.attrs.id}" label="#{cc.attrs.label}"
    ....
    completeMethod="#{filterableRaceAutocompleteBean.filterRace}">

    <f:attribute name="filter" value="#{cc.attrs.filter}" />

</p:autoComplete>
Run Code Online (Sandbox Code Playgroud)

以下是来源:

public List<Dto> filterRace(String filterString) {
    String filterValue = (String) UIComponent.getCurrentComponent(FacesContext.getCurrentInstance()).getAttributes().get("filter");
    log.debug("filter string : " + filterString + ", with query filter of : " + filterValue);

    ....

    return result;
}
Run Code Online (Sandbox Code Playgroud)