示例:此方案使得选择的数据表行中的两个值在运行时可用,然后将它们传递至“详细信息”页。从绑定至数据库,例如,Cloudscape™ 或 DB2® 中的“关系记录列表”的数据表或包含 java.util.Map 对象的类型为 java.util.List 的 bean 值开始。然后,创建与行操作相关联的参数。
// TODO Auto-generated method // Get the index of the selected row // int row = getRowAction1().getRowIndex(); // // Copy key values from the selection to the request so they can be used in a database filter // For example, if the table has a column "keyvalue" and there is an SDO object that uses the // filter "request.keyvalue", then this code sets up the request so the filter will work // correctly // For V5.1 server use: // Object keyvalue = getData().getDataObjectAccessBean(row).get("keyvalue"); // For V6 server use: // Object keyvalue = ((DataObject)getData.get(row)).get("keyvalue"); // // getRequestScope().put("keyvalue", keyvalue); // // Specify the return value (a string) which is used by the navigation map to determine // the next page to display