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

[1390 byte] By [lin_javaa] at [2007-11-27 11:38:01]
# 1

Use HtmlDataTable#getRowData() to get the selected row. You don't need to pass parameters.

This article might give new insights: http://balusc.xs4all.nl/srv/dev-jep-dat.html

BalusCa at 2007-7-29 17:17:46 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...