Session Binding Question
843844Jan 26 2010 — edited Jan 27 2010I want to bind dynamically to elements of a HashMap. I want each new component to bind to the new
map entry's value.
I tried to bind my components to the map facade 'myOpt' below but the Browser crashed saying
it couldn't find the session object. Binding like this:
"#{sessBean.myOpt[myKey]}".
When I tried to add access methods and bind directly to myMap, it executed but
the output showed the cumulative map contents for each new component. So it bound to the
entire map. Can someone help me understand how to bind each new component to a map entry?
Then I tried to bind directly
private HashMap<String, Option[]> myMap = new HashMap<String, MyList[]>();
MyList[] myOpt = new MyList[] {};
public MyList[] getMyOpt(String tid)
{
return myMap.get(tid);
}
public void setMyOpt(String tid, MyList[] opt)
{
myMap.put(tid, opt);
}