myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <skitch...@apache.org>
Subject RE: aliasBean + f:actionListener (addendum)
Date Tue, 10 Jan 2006 11:41:58 GMT
It's late at night for me too:-)

>>From a peek at the ActionListenerTag class, it seems that the "type"
attribute is evaluated when the parent component is first created. An
instance of that type is created and attached to the parent component. 

So note that the type can never change; it is evaluated on first render
of the page, and is fixed for the lifetime of that view tree.

However I would have thought that if there was an enclosing AliasBean
tag, then encodeBegin would have been called on the component, and hence
the alias would exist. So it seems to me your code should work...

Regards,

Simon

On Tue, 2006-01-10 at 02:44 -0800, Saumil Mehta wrote:
> Sorry for being a scatterbrain (its late at night). 
> 
> So the f:actionListener *does* take EL with the base bean defined in
> examples.config.xml. 
> 
> So this:
> 
> 	<f:actionListener type="#{myBean.fullName}"/>
> 
> is legit, while:
> 
> 	<f:actionListener type="#{aliasBean.fullName}"/>
> 
> is not. 
> 
> I know for a fact that the aliasBean is defined correctly since I am
> picking up other values using the aliased bean, except for the
> f:actionListener tag. 
> 
> Cool, thanks for reading...
> 
> -S
> 
> ________________________________________
> From: Saumil Mehta 
> Sent: Tuesday, January 10, 2006 2:26 AM
> To: users@myfaces.apache.org
> Subject: t:aliasBean + f:actionListener
> 
> So I've been using the aliasBean tag for a little while with some
> success, but the f:actionListener tag has tripped me up. I have a
> commandlink in the "included page" that is nested in the <t:aliasBean>
> tag. Ths commandLink already has an actionListener attribute defined,
> and I need to use the f:actionListener tag to attach another to the
> commandlink. 
> 
> This is a problem because the <f:actionListener> barfs out on all EL
> expressions for attribute "type" (forget aliasBean, it wont even take EL
> for beans directly mapped in faces.config.xml). How can I rectify this?
> Seems pretty strange that <f:actionListener> has to take a static string
> as opposed to EL. 
> 
> Note that the Javadoc for the f:actionListener tag includes the generic
> "will take EL unless otherwise specified" after which the attribute
> description for attribute "type" simply claims that the fully qualified
> class name of the actionlistener is required. 
> 
> Any ideas, clues, hacks?
> 
> -Saumil
> 


Mime
View raw message