The best place to *find* answers to programming/development questions, imo, however it's the *worst* place to *ask* questions (if your first question/comment doesn't get any up-rating/response, then u can't ask anymore questions--ridiculously unrealistic), but again, a great reference for *finding* answers.

My Music (Nickleus)

20140109

how to convert richfaces a4j:actionparam tags (that don't use "assignTo" attribute) to primefaces

during our migration from richfaces to primefaces, i stumbled across the richfaces tag a4j:actionparam (demo), e.g.:

<p:menuitem value="#{msg['label.showTrackAndTrace']}"
    ...
    actionListener="#{listTRQDataModel.fetchCurrentRow}">
    <a4j:actionparam name="row" value="{currentRowNo}" />
    <a4j:actionparam name="actionName" value="viewTNTListTrips" />
</p:menuitem>


luckily, since it doesn't use the assignTo attribute, the conversion of this tag to primefaces is pretty simple:

<p:menuitem value="#{msg['label.showTrackAndTrace']}"
    ...
    actionListener="#{listTRQDataModel.fetchCurrentRow}">
    <f:param name="row" value="{currentRowNo}" />
    <f:param name="actionName" value="viewTNTListTrips" />
</p:menuitem>


NOTE: f:param would have worked just as fine in richfaces, but for some reason, whoever coded the old version used a4j:actionparam instead (overkill and unnecessary).

see also the great f:param tutorial by mkyong.

No comments:

Post a Comment