the delete button code looks like this:
<a4j:commandLink id="removeTRQlink" title="#{msg['label.trip.confirmRemoveTRQ']}" action="#{listRequestsDM.tripBean.setCurrentTripAndTRQ(listObj, trq)}" oncomplete="#{rich:component('removeTRQPanelTrip')}.show()" reRender="removeTRQPanelTrip">
<h:graphicImage value="/images/icons/delete.gif" style="border:0" />
</a4j:commandLink>
when i tried setting the a4j:commandLink id dynamically (using the transport request receiver ref id, like this:
<a4j:commandLink id="#{trq.receiverRefId}" title="#{msg['label.trip.confirmRemoveTRQ']}" action="#{listRequestsDM.tripBean.setCurrentTripAndTRQ(listObj, trq)}" oncomplete="#{rich:component('removeTRQPanelTrip')}.show()" reRender="removeTRQPanelTrip">
<h:graphicImage value="/images/icons/delete.gif" style="border:0" />
</a4j:commandLink>
i would get the following error:
java.lang.IllegalArgumentException
eventually, after reading the sahi documentation, i noticed that images can also be identified by title. and jsf/richfaces also allows setting the title value dynamically :)
<h:graphicImage value="/images/icons/delete.gif" title="#{trq.receiverRefId}" style="border:0" />
and here's the sahi script code:
_click(_image($tr_id));
then we don't need any proximity qualifiers and we can precisely match any transport request in the subtable! :)
NOTE: trq.receiverRefId == $tr_id
pages that helped me:
http://sahi.co.in/forums/discussion/3870/identifying-image-buttons-uniquely/p1
http://sahi.co.in/w/all-apis
No comments:
Post a Comment