views:

651

answers:

2

I have menu build on Richfaces using rich:menuitem. I need to determine, which menuitem was clicked by user. I tried to use:

<rich:menuItem submitMode="server" value="#{msg.sidemenu_alldocs_internal_documents_bill_sent_documents}" action="#{billdoc.list}">
            <f:param name="sidemenutype" value="#{bill_sent}"/>
        </rich:menuItem>

But, i don't see parameter sidemenutype in my request parameters. Why?

    FacesContext context = FacesContext.getCurrentInstance();
    HttpServletRequest req = (HttpServletRequest) context.getExternalContext().getRequest();
    String docType = (String)context.getExternalContext().getRequestMap().get("sidemenutype");

docType is null. Can i somehow pass parameter from jsp to request, using rich:menuitem?

A: 

I'd recommend using <f:setPropertyActionListener> (inside your menuItem) and setting the docType in a property of your bean, not in the request.

Bozho
+1  A: 

Use f:setPropertyActionListener instead.

<f:setPropertyActionListener target="#{billdoc.bill_sent}" value="#{bill_sent}"/>

This expects a property bill_sent with a getter and setter in the billdoc bean.

BalusC
I wouldn't encourage underscore separated properties :)
Bozho
Me neither. *15 chars req'd*
BalusC