在primefaces自动完成功能上是f:param还是f:attribute支持? [英] f:param or f:attribute support on primefaces autocomplete?

查看:85
本文介绍了在primefaces自动完成功能上是f:param还是f:attribute支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I've read that the core JSF components support the f:param and f:attribute tag, in order to pass some values to the serverside for the enclosing UI Components.

我需要能够对primefaces的自动填充组件执行此操作, 以便自动完成方法可以使用 f:param f:attribute 提供的参数. 我尝试找出实现此目的的方法,并发现完整的方法参数是固定的,不能接受更多参数, 因此,我想使用 f:param f:attribute .

There's a need for me to be able to do this for primefaces' autocomplete component, so that the autocomplete method will be able to make use of the parameter supplied by the f:param or f:attribute. I tried finding out ways to accomplish this, and found out that the complete method parameter is fixed and cannot take more arguments, hence im thinking of using f:param or f:attribute.

我使用的是2.2.x版本,根据我的实验,我似乎无法正常运行 f:param f:attribute

Im use the 2.2.x version, and based on my experiment, i cant seem to get the f:param or the f:attribute working

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

primface会在自动完成组件上支持此功能吗? 无论如何,我可以找出支持这些参数的标签和不支持这些标签的标签吗?

Is primefaces going to support this feature on the autocomplete component ? Is there anyway i can find out which tags that support the parameters and those who dont ?

谢谢!

推荐答案

最后,我开始使用它了!

Finally i got it working !

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

这篇关于在primefaces自动完成功能上是f:param还是f:attribute支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆