[Wicket-ja-user 400] TextAreaに進行状況を表示させる方法について

Back to archive index

yoshiro_hagiy****@mnec***** yoshiro_hagiy****@mnec*****
2010年 1月 26日 (火) 13:10:17 JST



萩谷です。

FileUploadFieldを使用して、テキストデータをDBに登録するプログラムを作っ
ています。

その際に、テキストデータを読み込んでいる途中や、DBにデータ登録中の状態を
TextAreaに表示出来るようにしたいと思っています。

以下のように書いてみたのですが、target.addComponent()で、更新されるのは、
ボタンの処理が全て終わってからで、リアルタイムには表示されません。

-----------------------------------------------------------------------

String textAreaF;

textArea = new TextArea("textArea", new PropertyModel(this, "textAreaF"));
textArea.setOutputMarkupId(true);
uploadForm.add(textArea);

AjaxButton uploadBtn = new AjaxButton("uploadBtn") {

   @Override
   protected void onSubmit(AjaxRequestTarget target, Form<?> form) {

     String returnCode = System.getProperty("line.separator");
     textAreaF += "データベースに登録開始・・・" + returnCode;
     target.addComponent(textArea);
     // DBへの登録処理等の実行
     textAreaF += "データベースに登録完了" + returnCode;
     target.addComponent(textArea);
   }
};
uploadForm.add(uploadBtn);

-----------------------------------------------------------------------

また、textAreaに、AjaxSelfUpdatingTimerBehaviorを利用してみましたが、
それもうまくいきませんでした。


このような場合、どのようにしたら希望するように処理できるでしょうか?
どなたかご教授頂けましたら幸いです。

よろしくお願い致します。




Wicket-ja-user メーリングリストの案内
Back to archive index