基本的なカスタマイズ > ユーザーインタフェースのカスタマイズ > UI の情報の表示 > JSP フレームワークを使用したテーブルの構築とレンダリング > カスタマイズポイント > 非事前選択行の設定 > カスタムデータユーティリティに基づいた事前選択可能な行
  
カスタムデータユーティリティに基づいた事前選択可能な行
事前選択可能な列として使用する列のカスタムデータユーティリティを作成して登録します。
カスタムデータユーティリティを作成します
"com.ptc.core.components.factory.dataUtilities.AbstractBooleanValueDataUtility" を拡張することで独自のデータユーティリティを作成します。
getBooleanAttributeValue () メソッドをオーバーライドします。
例:
package com.customPkg;
import com.ptc.core.components.factory.dataUtilities.
AbstractBooleanValueDataUtility;
public class TestCustomDataUtility extends
AbstractBooleanValueDataUtility {
public boolean getBooleanAttributeValue(String
component_id, Object datum,
ModelContext mc) throws
WTException {
/* this method will return true if the row is pre selectable */
}
}
カスタムデータユーティリティを登録します
1. 新規作成したデータユーティリティを列 ID に対して設定します。
<Service name="com.ptc.core.components.descriptor.DataUtility">
<Option serviceClass="com.customPkg.TestCustomDataUtility "
requestor="java.lang.Object" selector="col1” cardinality="duplicate"/>
</Service>
TableConfig table = factory.newTableConfig ();
--------
ColumnConfig col = factory.newColumnConfig(<'''columnId'''>, false);
col.setNeed (<Attribute>); // Specify the attribute which will decide the
row is pre selectable or not.
col.setDataStoreOnly (true); // this will make your Column hidden
table.addComponent (col);
table.setPreSelectableColumn (col);
2. 新規作成したデータユーティリティをセレクタ ID に対して設定します。
<Service name="com.ptc.core.components.descriptor.DataUtility">
<Option serviceClass="<DataUtility>" requestor="java.lang.Object"
selector="<selectorId>” cardinality="duplicate"/>
</Service>
TableConfig table = factory.newTableConfig ();
--------
ColumnConfig col = factory.newColumnConfig(<columnId>, false);
col.setNeed (<Attribute>); // Specify the attribute which will decide
the row is selectable or not.
((JcaColumnConfig)col) setDataUtilityId (<selectorId>);
col.setDataStoreOnly (true); // this will make your Column hidden
table.addComponent (col);
table.setPreSelectableColumn (col);