How can <f:setPropertyActionListener> used with primefaces datatable rowExpansion

can <f:setPropertyActionListener> be used in primefaces datatable rowExpansion? I tried

<p:ajax event="rowToggle" listener="#{queryStudiesBean.onRowToggle}" >
      <f:setPropertyActionListener target="#{queryPatientBean.test}" value="sucess"/>
</p:ajax>

but it says

<f:setPropertyActionListener> Parent is not of type ActionSource

also I tried

<p:rowToggler>
    <f:setPropertyActionListener target="#{queryPatientBean.test}" value="sucess"/>
</p:rowToggler>

but it gives the same error, is there anyway to use it?


Solution 1:

<f:setPropertyActionListener> works with ActionSource components like <p:commandLink> and <p:commandButton>.

<p:rowExpansion>
   <p:commandLink>
      <f:setPropertyActionListener>
   </p:commandLink>
</p:rowExpansion>