Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

parameter passing to Seam backing bean method

 
mark weatherill
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
@Create
public void afterCreate() {
methodToSetupSuggestionbox();
}
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!
Cheers,

Mark Weatherill.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic