JSF newbie: assigning value to bean variable
Hello Friends,
I am a JSF newbie, I need a little help to solve the problem explained below.
I have table t:dataTable which display the details of the authors, one column in
the table is defined as
<t:column>
<h:commandLink action="#{authorList.listWorks}" value="Add Important Works">
<f:param name="author_id" value="#{author.id}"/>
<f:param name="from" value="list"/>
</h:commandLink>
</t:column>
Once the user clicks the above link, a form, worksForm, is displayed to add the
important works of the selected author. I have a managed bean for ImporantWorks
which has the following variables
Long id;
Long parentId;
....
....
with setter and getter methods for all the variables.
I need to assign the author_id which I have stored in a context variable through the
authorList.java bean like this
FacesContext context = FacesContext.getCurrentInstance();
Map requestParam = context.getExternalContext().getRequestParameterMap();
context.getExternalContext().getSessionMap().put("author_id", requestParam.get("author_id"));
to parentId. parent_id is there in the worksForm available as h:inputHidden or
make it available for the setParentId() method.
please help.
Thank you.
Sudheer

