File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes parameter passing to Seam backing bean method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "parameter passing to Seam backing bean method" Watch "parameter passing to Seam backing bean method" New topic

parameter passing to Seam backing bean method

mark weatherill

Joined: Jan 21, 2006
Posts: 6
Problem statement: i have implemented the RichFaces suggestionbox tag using Java statements in a method of a Seam backing bean. In order to customize its behaviour, i am trying to pass a parameter to the method of the backing bean; the catch is, the method which sets up the suggestionbox is invoked in the Seam bean using the @Create annotation.
The JSF statement is:
<a4jutputPanel binding="#{tabManager.autocompletePanels[tabID]}"/>
The getAutocompletePanels() method just returns an instance of autocompletePanels (a HashMap).
In the Seam backing bean, the annotation is:
public void afterCreate() {
I know it is possible to pass parameters to backing bean methods using a JSF page nested tag like: <f:param name="paramName" value="paramValue"/>, and
then accessing such a request parameter in the bean method using:
FacesContext context = FacesContext.getCurrentInstance();
Map map = context.getExternalContext().getRequestParameterMap();
String paramName = (String) map.get("paramValue");

The problem is how to pass a parameter into the method which is called from the Seam annotation to create an instance of the backing bean when one doesn't exist in the session?

Any useful suggestions gratefully received, otherwise back to the drawing board!

Mark Weatherill.
I agree. Here's the link:
subject: parameter passing to Seam backing bean method
It's not a secret anymore!