dev@jsftemplating.java.net

Re: JSFTemplating: Table data not showing up

From: Karam Singh Badesha <Karam.Badesha_at_Sun.COM>
Date: Mon, 29 Jan 2007 08:47:16 -0800

Ken,
I fiinally got it working. Here is the code to make it work if anyone
else is interested.

In the table, I have an afterCreate event:

<!afterCreate
                    getClientId(component="$this{component}"
clientId=>$pageSession{tableRowGroupId});
                    />

Then I have this in the button command event:

<!command
            getTable1Data(lavaVersion="#{pageSession.lava}"
buildVersion="#{pageSession.build}" lavaProject="#{pageSession.project}"
table1Data=>$pageSession{table1DataList});
            getUIComponent(clientId="$pageSession{tableRowGroupId}"
component=>$attribute{tblRowGrp});
            updateTableData(newDataList={"$pageSession{table1DataList}"}
tableRowGroup="$attribute{tblRowGrp}");
            />

And this is the handler:

@Handler(id="updateTableData",
    input={
        @HandlerInput(name="newDataList", type=java.util.List.class),
        @HandlerInput(name="tableRowGroup",
type=com.sun.webui.jsf.component.TableRowGroup.class)
    })
    public static void updateTableRowGroupData(HandlerContext context) {
        List tData = new ArrayList();
        tData = (List) context.getInputValue("newDataList");
        TableRowGroup trGroup = (TableRowGroup)
context.getInputValue("tableRowGroup");
       
        MultipleListDataProvider dp = (MultipleListDataProvider)
trGroup.getAttributes().get("sourceData");
        dp.setLists(tData);
    }


thanks,
-Karam