I have created some button dynamically and i wanted to know which button is clicked on the managed bean all the buttons go to the same method and i what to determine which one is clicked. This is how i created the button.
<ui:repeat var="o" value="#{postManagedBean.answer}" varStatus="status">
<p:commandLink action="#{postManagedBean.add}" id="#{status.index}"/>
</ui:repeat>