[TEEDA-360] ConditionとValidatorの同時使用 Created: 2007-09-06  Updated: 2007-09-20  Resolved: 2007-09-19

Status: Resolved
Project: Teeda
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0.11

Type: Bug Priority: Major
Reporter: shot Assignee: shot
Resolution: Fixed Votes: 0
Labels: None


 Description   

[Seasar-user:10342] [Teeda] ConditionとValidatorの同時使用は不可能ですか?

ConditionとValidatorを同時に使用する事は不可能なのでしょうか?
現在、以下の様な感じでConditionで表示/非表示を切り替えているTextboxに
必須入力Validatorをかけているのですが、
バリデーションでエラーになるとConditionでの表示/非表示が無効になり、
全てのTextboxが表示されてしまいます。。。

・HTML
<table>
<span id="isDayReport">
<tr>
<td>
<input id="inYearMonthDayFrom" />

<input id="inYearMonthDayTo" />
</td>
</tr>
</span>
<span id="isNotDayReport">
<tr>
<td>
<input id="inYearMonth" />
</td>
</tr>
</span>
</table>

・Java
// フィールド(GetterとSetterは省略)
private Date inYearMonthDayFrom;
private Date inYearMonthDayTo;
private Date inYearMonth;

// Condition
public boolean isDayReport() {
// メソッドの中身は省略
}

// Validator
public Validator getInYearMonthDayFromValidator() {
// メソッドの中身は省略
// (TRequiredValidatorを継承した自作Validatorで必須チェックを行う)
}
public Validator getInYearMonthDayToValidator() {
// メソッドの中身は省略
// (TRequiredValidatorを継承した自作Validatorで必須チェックを行う)
}
public Validator getInYearMonthValidator() {
// メソッドの中身は省略
// (TRequiredValidatorを継承した自作Validatorで必須チェックを行う)
}



 Comments   
Comment by shot [ 2007-09-20 ]

問題の対処が不十分だったので追記した.
レイアウト適用時にAbstractIncludeRendererでコンポーネントツリーがクリアされてしまうので、
それをRenderPreparable.postEncodeEnd()に移した.
また、RenderPreparableで呼ばれる順番を、

RenderPreparable.preEncodeBegin()
-一番親のコンポーネント
-子供をwalkしていき再帰的に呼び出す

実際の描画
-encodeBegin
-encodeChildren
-encodeEnd

RenderPreparable.postEncodeEnd()
-子供をwalkしていき再帰的に呼び出す.末端から呼ばれる
-一番親のコンポーネント

のように修正した.

Comment by shot [ 2007-09-19 ]

修正しました.

Comment by shot [ 2007-09-14 ]

Conditionのベーシックな問題の部分は解決.
ただしTEEDA-360自体はまだ.

Comment by shot [ 2007-09-10 ]

再現ケースコミットした.
DynamicValidatorは関係ない.

Comment by shot [ 2007-09-10 ]

現象は再現した.
isNotが悪さをしている模様.

Generated at Thu Apr 18 12:49:12 JST 2024 using Jira 9.15.0#9150000-sha1:9ead8528714127d8cfabf2446010d7e62c0a195c.