[jboss-user] [JBoss Seam] - Re: How can I pass parameters to action methods
javarebel
do-not-reply at jboss.com
Tue Mar 6 16:33:46 EST 2007
My requirement is to get an identifier in which link I have clicked in the backing bean. I am able to find a solution for this.
In XHTML File
-------------------------
<c:forEach items="#{listingSearch.pagesLinks}" var="page">
<s:link action="#{listingSearch.next()}"
value="#{page.globalListingId}">
<f:param name="linkId" value="#{page.globalListingId}" />
</s:link>
</c:forEach>
In Backing bean
-----------------------
@RequestParameter
private String linkId;
public void next() {
System.out.println("You Clicked on link Id : " + this.linkId);
return;
}
or
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest)
facesContext.getExternalContext().getRequest();
String linkIdFromCtx = ((String[])request.getParameterMap()
.get("linkId"))[0];
System.out.println("Ctx: You Clicked on link Id : " + linkIdFromCtx);
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025588#4025588
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025588
More information about the jboss-user
mailing list