LittleSoft J-Programming
4.5. Velocity テンプレートの記述方法
Velocityテンプレートからテーブルオブジェクトへの記述方法がシンプルになりました。
MaxLength を自動的に設定したくない場合は textBindNoLength を使用します。
エスケープを行いたくない場合は、 rowValue を使用します。
NameBind
<!-- (旧) --><textarea $emp.nameBind('memo') >
<!-- (新) --><textarea $emp.memo.nameBind >
<!-- (新) --><textarea $emp.memo.nameBind >
TextBind
<!-- (旧) --><input type="text" $emp.textBind('name') />
<!-- (新) --><input type="text" $emp.name.textBind />
<!-- MaxLength なし(新) --><input type="text" $emp.name.textBindNoLength />
textBind では、カラムに設定されている Length が 自動的に MaxLength として設定されます。<!-- (新) --><input type="text" $emp.name.textBind />
<!-- MaxLength なし(新) --><input type="text" $emp.name.textBindNoLength />
MaxLength を自動的に設定したくない場合は textBindNoLength を使用します。
CheckBind
<!-- (旧) --><input type="radio" $emp.checkBind('sex','1') />
<!-- (新) --><input type="radio" $emp.sex.checkBind('1') />
<!-- (新) --><input type="radio" $emp.sex.checkBind('1') />
項目値の取得
<!-- (旧) -->#if($emp.get('DEPT_CODE')==$dept.get('deptCode')) selected="selected" #end
<!-- (新) -->#if($emp.deptCode==$dept.code) selected="selected" #end
<!-- エスケープなし(新) -->$memo.text.rawValue
項目値は自動的にエスケープされた文字列が取得されます。<!-- (新) -->#if($emp.deptCode==$dept.code) selected="selected" #end
<!-- エスケープなし(新) -->$memo.text.rawValue
エスケープを行いたくない場合は、 rowValue を使用します。
項目のリクエストパラメータ名取得
<!-- (新) -->$emp.deptCode.name