Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

parameter passing to Seam backing bean method  RSS feed

mark weatherill
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:
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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!