Try getting away from request parameters altogether with something like 
t:updateActionListener .  I promise you will be glad ;)

<h:commandLink value="Select Customer X">
  <t:updateActionListener value="#{path.to.customer.id}" 
     property="#{backingbean.customeridProperty}" />
</h:commandLink>

>-----Original Message-----
>From: Emily Gu [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, December 28, 2005 12:32 AM
>To: 'MyFaces Discussion'
>Subject: Re: set UIParameter in backing bean
>
>I know you can get it as following. I don't know whether you have another
>way to do it though.
>
>  public void actionListener (ActionEvent event) {
>     FacesContext context = FacesContext.getCurrentInstance();
>     param =
>(String)context.getExternalContext().getRequestParameterMap().get("bluh");
>     System.out.println("param: " + param);
>     setParam("bluh2");
>   }
>
>You can have regular setter and getter for param in the backing bean.
>
>On 12/27/05, Saumil Mehta <[EMAIL PROTECTED]> wrote:
>>
>>  Hello,
>>
>>
>>
>> I've got a JSF application which uses the <f:param> tag embedded in a
>> <h:commandLink> tag in several places. Now I need to set a parameter in a
>> backing bean that is accessible to the JSP when the page is re-rendered (the
>> same page is reloaded after the actionlistener executes, no navigation
>> taking place).
>>
>>
>>
>> How would I go about attaching a parameter so that it would be accessible?
>> Note that this type of code doesn't work:
>>
>>
>>
>> Public void actionListener (ActionEvent evt)
>>
>> {
>>
>>             UIParameter uip = new UIParameter();
>>
>>             Uip.setName("blah");
>>
>>             Uip.setValue("blah");
>>
>>             Uip.setParent(Evt.getComponent());
>>
>> }
>>
>>
>>
>> I am guessing this is because the component tree is re-created when the
>> response is rendered, and that therefore the parameter disappears when my
>> JSP tries to get to it.
>>
>>
>>
>> Any ideas as to how this would be done? I'm pretty lost and would
>> appreciate your help.
>>
>>
>>
>> -Saumil
>>
>


Reply via email to