myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bhushan <bhusha...@chn.dnb.co.in>
Subject Re: <f:param is not working under <tr:commandLink in Trinidad 1.0.8 (JSF1.1)
Date Tue, 17 Jun 2008 04:33:38 GMT

Thanks Samba,
I've tried with <tr:setActionListener> its working fine.

Thanks,
Bhushan




saasira wrote:
> 
> Use <f:attribute name="idparam" value="#{menu.id}"/> instead and you can
> get
> the attribute value in your actionListener by calling
> event.getComponent().getAttributes().get("idparam");
> 
> I think trinidad is not processing  the <f:param>  elements in case of
> commandLinks, but it does process param tags in case of goLinks, if I
> remember it correctly.
> 
> You can even use <tr:setActionListener from="#{menu.id}"
> target="#{pageFlowScope.idparam}"/>
> and then retrieve in your bean as
> RequestContext.getCurrentInstance().getPageFlowScope().get("idparam");
> 
> I think there is yet another way of sending values;
> 
> with JSF 1.2 libraries, I think you can even write like this:
> <f:setPropertyActionListener name="" value="" />, and I read some where
> that
> trinidad's setActionListener is going to be deprecated as RI's
> setPropertyActionListener tag addresses the same need. I don't know which
> would be preferred by Trinidad Gurus
> 
> 
> I hope this helps,
> Samba
> 
> 
> 
> On Fri, Jun 13, 2008 at 12:09 PM, Bhushan <bhushanbn@chn.dnb.co.in> wrote:
> 
>>
>> Hi,
>>
>> I am using Trinidad 1.0.8 with my faces 1.1.5. when I am trying to pass
>> the
>> parameters to command link I am getting NullPointer Exceptions. I guss it
>> the problem with f:param as it is not evaluating expression under
>> tr:commnadLink.
>>
>> Sample code:
>> <tr:commandLink text="#{menu.label}" id="leftMenuLevel1"
>> actionListener="#{pageManager.onMenuClick}">
>>    <f:param name="idparam" value="#{menu.id}" />
>>    <f:param name="level" value="#{menu.level}" />
>>    <f:param name="MENU_POINTER" value="LEFT_MENU" />
>> </tr:commandLink>
>>
>>
>> public final String getParameterValue(String key) {
>> (HttpServletRequest)
>>
>> request=(HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
>> String[] parameterValues  = (String[])request.getParameterMap().get(key);
>> return (getParameterValues(key) != null ? getParameterValues(key)[0] :
>> null);
>> }
>>
>>
>> Any work arrounds or suggestions?
>>
>>
>> Thanks,
>> Bhushan
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/%3Cf%3Aparam-is-not-working-under-%3Ctr%3AcommandLink-in-Trinidad-1.0.8-%28JSF1.1%29-tp17816107p17816107.html
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Regards...
> Samba.
> 
> 

-- 
View this message in context: http://www.nabble.com/%3Cf%3Aparam-is-not-working-under-%3Ctr%3AcommandLink-in-Trinidad-1.0.8-%28JSF1.1%29-tp17816107p17877942.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Mime
View raw message