2

I would like to fire an actionListener from a p:commandButton inside a column header as follows:

<h:form id="foos">
    <p:messages id="mess" />

    <p:columns var="foo" value="#{fooBean.foos}">
        <f:facet name="header">#{foo.name} 
            <p:commandButton icon="ui-icon-trash" actionListener="#{fooBean.test()}" update=":foos" process="@this" />
        </f:facet>

        <h:outputText value="foobar" />

    </p:columns>
</h:form>

No matter what I try, the actionListener method never is fired. If I move the commandButton outside of the facet it works, so I assume there is something awry with the facet component in conjunction with the commandButton.

No messages are displayed so it appears that validation is not failing.

This is under Primefaces 3.5

anger
  • 1,018
  • 1
  • 9
  • 25
  • Are you sure that your `` is inside a single ``? – Luiggi Mendoza Aug 05 '13 at 14:29
  • I don't think you can wrap `html` component inside `f:facet` cause it's only to specify type like header or footer – SRy Aug 05 '13 at 14:29
  • Be aware of what `immediate="true"` means. – Manuel Aug 05 '13 at 14:51
  • I don't know if you need it, but you can put `ajax="false"` to call your method. – danRod Aug 05 '13 at 17:10
  • Yes it is in a single h:form (which i omitted for brevity). I cannot see which of the points in the linked answer is actually relevant. Is it because the commandButton is in a f:facet? – anger Aug 05 '13 at 22:52
  • 4
    I wish this hadn't been marked as duplicate, because it isn't a duplicate, it's a PrimeFaces bug. See my answer here: [p:commandButton action and f:setpropertyactionlistener not invoked in p:columngroup](http://stackoverflow.com/questions/17838434/). – patstuart Aug 06 '13 at 03:37
  • Thank you so much @patstuart - I tried everything in BalusC's post to no avail. – anger Aug 06 '13 at 05:25
  • @patstuart Can you possibly vote to reopen in so I can link to the bug in an answer? – anger Aug 06 '13 at 05:40
  • My reputation is not high enough. Sorry. :( – patstuart Aug 06 '13 at 12:56

1 Answers1

0

if no ActionEvent parameter for your test method then use action

 .....icon="ui-icon-trash" action="#{fooBean.test}" ...