[jboss-user] [JBoss Seam] - How can I pass parameters to action methods

javarebel do-not-reply at jboss.com
Tue Mar 6 13:42:49 EST 2007


I need to pass a parameter to an action method in the backing bean, how can I do that? Now I am getting the parameter as Null in the action method.

My XHTML Page
-----------------
<h:form id="myForm">
    <c:forEach items="#{listingSearch.pagesLinks}" var="page">
        <s:link action="#{listingSearch.next(page.globalListingId)}" 
           value="#{page.globalListingId}" />
    </c:forEach>
</h:form>

where:
listingSearch is the name of the Stateful Session Bean
pagesLinks is a private list, which have a getter method defined.
globalListingId is a property of the pojo which I am putting in the list(pagesLinks).


My Action Method
----------------------
public void next(Object object) {
    System.out.println("Parameter -------->" + object);
    return ;
}


In the web page the value part of the <s:link> is correctly resolved and it is displaying the globalListingId values from the list. But in the backing bean action method I am getting the object parameter as null.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025530#4025530

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025530



More information about the jboss-user mailing list