f:param或f:attribute是否支持素数面自动完成



我已经读到核心JSF组件支持f:paramf:attribute标记,以便将一些值传递到服务器端,用于封装UI组件。

我需要能够为素数面的自动完成组件做到这一点,以便自动完成方法能够利用f:paramf:attribute提供的参数。我试图找到实现这一点的方法,发现完整的方法参数是固定的,不能接受更多的参数,因此,我考虑使用f:paramf:attribute

我使用的是2.2.x版本,根据我的实验,我似乎无法获得f:paramf:attribute工作

<p:autocomplete ...>
   <f:param name="myParam" value="xxxx" />
</p:autocomplete>

primefaces会在自动完成组件上支持这个功能吗?无论如何,我能找出哪些标签支持参数,哪些不支持参数吗?

谢谢!

终于让它工作起来了!

这是jsf的一部分:

<p:autoComplete id="#{cc.attrs.id}" label="#{cc.attrs.label}"
    ....
    completeMethod="#{filterableRaceAutocompleteBean.filterRace}">
    <f:attribute name="filter" value="#{cc.attrs.filter}" />
</p:autoComplete>

这是来源:

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;
}

最新更新