Trouble with setActionExpression
Hello,
I have a web application that gets all of its information from an xml file created by another application. Everything is working fine with the exception of one page which may have multiple DataTables. I am able to create the tables and add them to the page but I cannot seem to get the setActionExpression to work. I am using JSF 1.2 so 1.1 solutions will not work for me. The code I am currently trying is below:
// Inside init()
MultiValueMap map = getSessionBean1().getSeasonal();
Set keys = map.keySet();
Iterator it = keys.iterator();
while (it.hasNext()){
ArrayList linkList =new ArrayList();
Object header = it.next();
Collection collect = map.getCollection(header);
Object [] ob = collect.toArray();
for (int i = 0; i < ob.length; i++){
SeasonalHelper sh = (SeasonalHelper)ob[i];
linkList.add(sh);
}
HtmlDataTable dt =new HtmlDataTable();
DefaultTableDataModel model =new DefaultTableDataModel();
model.setWrappedData(linkList);
dt.setValue(model);
dt.setId("dataTable");
dt.setVar("currentRow");
UIOutput head =new UIOutput();
head.setId("Header1");
head.setValue(header);
UIColumn column =new UIColumn();
column.setHeader(head);
ExpressionFactory expFactory = FacesContext.getCurrentInstance().
getApplication().getExpressionFactory();
ELContext elContext = FacesContext.getCurrentInstance().getELContext();
ValueExpression ve = expFactory.createValueExpression(elContext,
"#{currentRow['name']}", String.class);
MethodExpression me = expFactory.createMethodExpression(
elContext,"#{seasonal.hyperlink_action}", String.class,
new Class[]{});
Hyperlink link =new Hyperlink();
link.setActionExpression(me);
link.setTransient(true);
link.setId("hyperlink");
link.setValueExpression("value", ve);
column.getChildren().add(link);
dt.getChildren().add(column);
form1.getChildren().add(dt);
}
// End init()
public String hyperlink_action(){return"case1";}
SeasonHelper is a class I have holding two string properties, name and url.
I have done some pretty extensive searching for the solution to this but it appears most people are still using JSF 1.1. I also haven't seen any examples of people creating dynamic tables in this way.

