3

I'm trying to make a composite component containing a table with a commandButton on each row, calling an actionmethod taking the row object as a parameter. It would look like this without being a custom component:

<h:dataTable value=#{bean.objects} var="obj">
    <h:column>
        <h:commandButton id="button" action="#{bean.doSomething(obj)}" value="Do something with obj" ajax=false"/>
    </h:column>
</h:dataTable>

What kind of composite:interface parameters would enable this to work? I've tried with composite:actionSource, composite:attribute with target="button" etc, making the action parameter a f:propertyActionListener etc, but nothing has worked so far. As an ugly solution, I send the controller as a parameter and call methods directly from it, but is there a more elegant way?

fuggerjaki61
  • 822
  • 1
  • 11
  • 24
Rasmus Franke
  • 4,434
  • 8
  • 45
  • 62

0 Answers0