データ・テーブルに表示されるレコードで、読み取り、更新、削除などのアクションを実行することができます。アクションを実行する方法の 1 つとして、行アクション・サポートの追加があります。行アクションをデータ・テーブルに追加すると、新規列として追加されます。ユーザーは、その行の任意の場所をクリックして、その行でアクションを実行することができます。
例: このシナリオでは、選択したデータ・テーブル行からの 2 つの値が実行時に使用可能になり、それらの値が「詳細」ページに渡されます。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