We'll take the (simplified) example of the previous post that could show a javascript alert and adopt it to get the message from an attribute which we specify in the JSF page using the component. We'll also make sure we can use an EL expression to specify this values (this is the tricky part). We will be able to do something like:
<af:forEach begin="1" end="5" varStatus="vs"> <af:commandButton text="click to see message #{vs.index}" id="cb"> <redheap:showAlertBehavior message="This is message #{vs.index}"/> </af:commandButton> </af:forEach>