One thing that I found out rather later than I'd have liked to is that
you can access EL variables from the backing bean - and particularly
useful is that you can access a table iterator's current value e.g.

<h:table value="blah.values" var="item">
  <h:outputText value="item.name"/> <h:commandLink
actionListener="#{blah.delete}" value="Delete"/>
</h:table>

I can get the value of 'item' in the actionListener using:
 
    FacesContext fContext = FacesContext.getCurrentInstance();
    VariableResolver requestResolver =
fContext.getApplication().getVariableResolver();
    Blah blah = requestResolver.resolveVariable(fContext, "item");

Which I thought was pretty cool when I found out and meant that I didn't
have to fiddle around accessing it through a bound table control or a
data model.

Hope that's of some help.

Jim
--
Jim Moores

-----Original Message-----
From: Jana Parvanova [mailto:[EMAIL PROTECTED] 
Sent: 20 February 2006 14:29
To: MyFaces Discussion
Subject: Re: How to add url parameter in JSF?

What about something lik this:

<h:commandLink styleClass="table-header"
actionListener="#{inboxBean.sort}">
<f:param name="column" value="name"/>
</h:commandLink>

Usually you won't need using parameters though.


----- Original Message -----
From: "Anthony Hong" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, February 20, 2006 4:20 PM
Subject: How to add url parameter in JSF?


> As in html, a requrest url can be something like abc.jsp?a=1&b=2
> In JSF, links are managed by backend and it is event driven by jsf 
> component.
> How can I do in original way? As my parameters are generated
dynamicly.
>
> --
>
> Anthony Hong
> 

Reply via email to