Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 2 ui内commandLink上的setPropertyActionListener:使用复合组件重复_Jsf 2_Primefaces_Composite Component - Fatal编程技术网

Jsf 2 ui内commandLink上的setPropertyActionListener:使用复合组件重复

Jsf 2 ui内commandLink上的setPropertyActionListener:使用复合组件重复,jsf-2,primefaces,composite-component,Jsf 2,Primefaces,Composite Component,我已经创建了一个复合组件,它在ui:repeat中嵌入了commandLink。我需要能够动态更改通过commandLink的action属性调用的方法,但由于您需要在 因为commandLinks在UI:repeat中,所以它们都有一个动态ID 作为一种解决方法,我尝试在命令链接上使用setPropertyActionListener。但是,似乎从未调用过该方法。我错过什么了吗?这是我想要的错误方式吗 下面是一些示例代码 复合组件: <ui:repeat value="#{cc.attr

我已经创建了一个复合组件,它在ui:repeat中嵌入了commandLink。我需要能够动态更改通过commandLink的action属性调用的方法,但由于您需要在 因为commandLinks在UI:repeat中,所以它们都有一个动态ID

作为一种解决方法,我尝试在命令链接上使用setPropertyActionListener。但是,似乎从未调用过该方法。我错过什么了吗?这是我想要的错误方式吗

下面是一些示例代码

复合组件:

<ui:repeat value="#{cc.attributes.value}" var="aUser">
<li class="ui-widget-content ui-state-default q-userListResult">   
        <p:commandLink 
        styleClass="q-userList-resultLink"
                update=":userList:q-userList-formUsers:userToolTip">
                <f:setPropertyActionListener value="{aUser}" target="#{cc.attributes.resultLinkActionListener}"/>
<q:userList id="userList" 
   value="#{caseWizardBackingBean.companyContacts}" 
   renderHeader="false" 
   resultLinkActionListener="#{caseWizardBackingBean.selectedCompanyContact}"/>
private CTProfile selectedCompanyContact;
public CTProfile getSelectedCompanyContact() { return this.selectedCompanyContact; }
public void setSelectedCompanyContact(CallTrackProfile ctp) { this.selectedCompanyContact = ctp; }    
我尝试将一些调试语句和断点添加到属性的getter和setter中,但它们从未被命中。我猜有些奇怪的事情正在发生,因为我能找到的所有例子都表明这应该是可行的(但他们不使用复合组件)


我应该指出,我正在使用Primefaces commandLink,但这似乎也发生在常规commandLink上

好的,据我所知,在当前版本的JSF(2.1.3)中无法做到这一点

为了解决这个问题,我将组件设置为单个commandLink,然后使用页面有一个ui:repeat,其中包含commandLink