3

日付ボックスでフィルターを作成しようとしています。日付が挿入されていない場合、これはクエリに追加されません。日付が挿入されると、彼はこの日付から数えます。

これはすべて非常にうまく機能します。私が持っている唯一のばかげた小さな問題は、日付をクリアするためのボタンがあることです。または、@command(...) を使用して、私の queryObject.date を null に設定すると、魔女は私の検索を正しく更新しますが、日付はまだ日付ボックスにあります。(日付ボックスに autowired を使用したくない)

または、 searchBeginDate.setText(null) を実行すると、テキストはなくなりましたが、私のリストは更新されません。

両方を行うにはどのようなオプションがありますか?

edit : プロジェクトのサンプルコード。

 <datebox id="searchBeginDate" value="@bind(vm.loggingVmQueryObject.beginDate)" onOK="@command('filter')" />
 <button onClick="searchBeginDate.setText(null);vm.loggingVmQueryObject.setBeginDate(null)"  image="/img/delete.PNG" />

これにより、日付ボックスがホイップされますが、リストは更新されません。

<datebox id="searchBeginDate" value="@bind(vm.loggingVmQueryObject.beginDate)" onOK="@command('filter')" />
<button onClick="@command('clearBeginDate')"  image="/img/delete.PNG" />

これにより、リストが正しく更新されます。コードでは、loggingVmQueryObject.beginDate が null に設定されていますが、日付ボックスには最後に設定された日付が表示されています。

さようなら。

4

1 に答える 1

2

あなたは私にコードを見せてください、私は解決策を示します;)

ズールで

<datebox id="searchBeginDate" value="@bind(vm.loggingVmQueryObject.beginDate)" onOK="@command('filter')" />
<button onClick="@command('clearBeginDate', date = searchBeginDate)"  image="/img/delete.PNG" />

Javaで

public void clearBeginDate(@BindingParam("date")Datebox date){
//your other code here
date.setText(null);

}
于 2013-10-07T15:43:02.303 に答える