This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes JSF 2.0 and calling a backing bean method with a parameter - method not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF 2.0 and calling a backing bean method with a parameter - method not found" Watch "JSF 2.0 and calling a backing bean method with a parameter - method not found" New topic
Author

JSF 2.0 and calling a backing bean method with a parameter - method not found

Richard Coats
Greenhorn

Joined: Mar 10, 2011
Posts: 1
Hi - there have been a couple of other posts on this subject, but none seem to have resolved my problem. I believe I should be able to pass a parameter with an EL method in JSF 2.0. So I have the following code:



and in a backing bean:



If I remove the parameter from the call in the xhtml and in the Java method all works fine, but with the parameter Glassfish 3 gives the following run time error (extract):

SEVERE: javax.el.ELException: /search.xhtml @48,103 styleClass="#{monitor.cellStyle(77)}": Method cellStyle not found
javax.faces.FacesException: javax.el.ELException: /search.xhtml @48,103 styleClass="#{monitor.cellStyle(77)}": Method cellStyle not found
at javax.faces.component.UIComponentBase$AttributesMap.get(UIComponentBase.java:2214)
at org.richfaces.renderkit.ExtendedDataTableRenderer.encodeRow(ExtendedDataTableRenderer.java:809)
at org.richfaces.renderkit.AbstractRowsRenderer.process(AbstractRowsRenderer.java:89)


I've tried some of the other solutions mentioned elsewhere, i.e. including and explicit dependancy for EL:



and setting the following in web.xml:



and making sure faces-config is correct:



But I still get the same error. Does anyone have any suggestions?

Many thanks.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15964
    
  19

Well, I'm not really comfortable with putting method calls on the JSF View definition, parameterized or not, but the first thing to check is to make sure you have the EL 2.2 processor running. JSF2 alone isn't enough, if the EL processor you're using doesn't know how to parse the method call properly.


Customer surveys are for companies who didn't pay proper attention to begin with.
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2841
    
  11

I'm working in straight JSF at the moment, and in a version that simply doesn't allow passing parameters like that. However, the last project I did was in Seam, which did allow it. If I remember right though, we had to use full method name. In your case:



Have you tried that?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JSF 2.0 and calling a backing bean method with a parameter - method not found
 
Similar Threads
JSF 2 - Problem with ManagedBean
config my-faces & tomahawk & Trinidad
Problem with setValue method of an HtmlOutputText object in a JSF backing bean
Funny exception with StringBuffer with jsf
How to change jetty binding port number in maven.