Backing bean with parameter in method called in JSF selectOneMenu
Hi,
The title sounds a little bit weird, sorry for that,but I don't know how to describe it with a less of characters. Let me explain my problem.
I have a <h:selectOneMenu> tag that gets it <f:selectItems> through a backing bean. The selectOneMenu is then filled with a list of categories one can choose from. f.e.:
<h:selectOneMenu id="category"
value="#{CategoryListControlBean.category}"
onchange="submit();">
<f:param name="EntityId" value="#{EntityCoreBean.CONTENT}"/>
<f:selectItems value="#{CategoryListControlBean.items}"/>
<f:valueChangeListener type="#{CategoryListControlBean.category}"/>
</h:selectOneMenu>
Now, the problem is that I have two situations. The 1st one is the items displayed in the menu are just a bunch of categories, all categories. In the 2nd situation, the list of categories that should be returned is based by the type of object (EntityCoreBean.CONTENT). As you can see I would like to pass the type of object as a parameter. When then the #{CategoryListControlBean.items} is executed / called the parameter is obtained in the CategoryListControlBean object in order to determine what type of categories should be returned. To obtain the parameter set through the <f:param > tag I created an object that returns in a little flexible way the parameter:
ARSAttributeStore store = new ARSAttributeStore(IARSAttributeStoreTypes.REQUEST_PARAMETERS);
String entityId = Integer.valueOf(store.getRequestParameter("EntityId").toString()).intValue();
The store object is nothing less then the an object that is initialized by the storetype (REQUEST_PARAMETERS). The Map with requestparameters is created and a parameter can then be retrieved through the store.getRequestParameter(String paramname) method.
I debugged the app,but store.getRequestParameter("EntityId") returns null.
Can anyone help me ont this on? Is there another way to make use of parameters either like this or maybe by using something like:
<f:selectItems value="#{CategoryListControlBean.items("EntityId")}"/>
Thanks.

