wizard in JSF using savestate or keepalive

Hello everyone,

I want to implement wizard in my application. In that on one page i have a datatable, this datatable has one column as checkbox. I go to this page using next button and i select some checkboxes then i go back or to next page. After that if i come back to this page using prev/next button i should see all the selected and unselected checkboxes as the were.

I tried using savestate but its not working properly. Please help me to get through this.

Thanks.

[496 byte] By [sonal_ka] at [2007-11-26 16:11:09]
# 1
Use session scoped beans.CowKing
IamCowKinga at 2007-7-8 22:33:36 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
You might want to look at JBoss Seam conversations, or Apache Shale dialogs.
guy.colemana at 2007-7-8 22:33:36 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

I cant use session. Just tell me how do i save the state of my checkbox array. That means initially all my checkboxes are unselected then i select 2 or 3 of them then i go to next page and if i come back i should see the checkboxes selected by me as selected and unselected as unselected.

Thanks.

sonal_ka at 2007-7-8 22:33:36 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

You want to store values in session (save state), but you can't use session?

Please think about it twice ;) Well, here are some suggestions:

1) Split the backing beans in one request scoped bean for page actions and one session scoped bean for session data (the checkbox list for example).

2) Use FacesContext.getCurrentInstance().getExternalContext().getSessionMap() to retrieve and store the checkbox list in, instead of a bean property.

public class MyBean {

public List getCheckboxList() {

return ext.getSessionMap().get("MyBeanCheckboxList");

}

public void setCheckboxList(List checkboxList) {

ext.getSessionMap().put("MyBeanCheckboxList", checkboxList);

}

}

BalusCa at 2007-7-8 22:33:36 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...