This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes Calling a function in a bean where the bean name is on another bean as a parameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Calling a function in a bean where the bean name is on another bean as a parameter" Watch "Calling a function in a bean where the bean name is on another bean as a parameter" New topic
Author

Calling a function in a bean where the bean name is on another bean as a parameter

Liron Golan
Greenhorn

Joined: Sep 14, 2008
Posts: 8
How can i call a function in a bean where the bean name is a parameter on another bean.
Something like this (This doesn't work):

#{#{bean1.getBeanName}.functionCall}

Thanks.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15951
    
  19

You can't "call a function on a bean", but you can invoke getters/setters and action processors indirectly. It's actually quite simple:

#{bean1.beanName.functionCall}

If you had a property named "beanName" in bean1 which was itself a bean with a property or action method named "functionCall", the preceeding code would invoke it. It's all part of the Expression Language (EL).


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling a function in a bean where the bean name is on another bean as a parameter
 
Similar Threads
Can't find bean in any scope
Implementing an Abstract method
setProperty
Usage of Request Parameter
Referencing a form object