Wednesday, December 22, 2010

Tapestry 5.2 Multiple Context Values

This is sample for declaring multiple values on context.
In .tml file:
<t:actionlink t:id="exportToExcel" t:context="[workingUnitId, strDateFrom, strDateTo]">Export to Excel</t:actionlink>

In .java method:
Object onActionFromExportToExcel(Long workingUnitId, String strDateFrom, String strDateTo)

And this is sample for using multiple context values on .java onActivate and onPassivate: 
void onActivate(Long workingUnitId, String strDateFrom, String strDateTo)

List<Object> onPassivate() {
        List list = new ArrayList<Object>();
        list.add(workingUnitId);
        list.add(strDateFrom);
        list.add(strDateTo);
        return list;
    }


Source: http://tapestry.1045711.n5.nabble.com/multiple-context-values-td2429828.html

No comments:

Post a Comment