f:param or f:attribute support on primefaces autocomplete?

后端 未结 1 1693
抹茶落季
抹茶落季 2021-01-05 18:37

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 enc

相关标签:
1条回答
  • 2021-01-05 19:02

    Finally i got it working !

    Here's the jsf part :

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

    And here is the source :

    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;
    }
    
    0 讨论(0)
提交回复
热议问题