Yes - you're not understanding models.  You created a Label with a static
String - the current time at the time of creation.  You need to use a model,
which is a "data finder"....  something like:

new Label("msgStatutTransfert", new AbstractReadOnlyModel<Date>() {
     public Date getObject() {
          return new Date();
     }
});

Also, read: http://cwiki.apache.org/WICKET/working-with-wicket-models.html
and buy Wicket in Action.

-- 
Jeremy Thomerson
http://www.wickettraining.com

On Thu, Nov 13, 2008 at 3:58 PM, a_godin <[EMAIL PROTECTED]> wrote:

>
> I'm trying something very simple ... I have a form with many panels and in
> one of those panels, I want the current date and time to be refreshed
> periodically.
>
>        final Label msgStatutTransfert = new Label("msgStatutTransfert", new
> Date().toString());
>        msgStatutTransfert.setOutputMarkupId(true);
>        msgStatutTransfert.add(new
> AjaxSelfUpdatingTimerBehavior(Duration.seconds(5)));
>        frmInfosTransfert.add(msgStatutTransfert); // one of my panels
>
> When the page loads, it puts the current date in the label but then it
> doesn't reshesh ... I looked at the debug info ... here's what I get
>
> <?xml version="1.0" encoding="UTF-8"?><ajax-response><component
> id="InfosTransferts_frmInfosTransfert_msgStatutTransfert" ><![CDATA[Thu Nov
> 13 16:09:53 EST 2008]]></component><evaluate><![CDATA[setTimeout("var
>
> wcall=wicketAjaxGet('/ADHO/app/?wicket:interface=:3:InfosTransferts:frmInfosTransfert:msgStatutTransfert:-1:IUnversionedBehaviorListener&wicket:behaviorId=0&wicket:ignoreIfNotActive=true',
> function() { }, function() { });", 1000);]]></evaluate></ajax-response>
> INFO: Response parsed. Now invoking steps...
> INFO: Response processed successfully.
> INFO: Invoking post-call handler(s)...
> INFO:
> INFO: Initiating Ajax GET request on
>
> /ADHO/app/?wicket:interface=:3:InfosTransferts:frmInfosTransfert:msgStatutTransfert:-1:IUnversionedBehaviorListener&wicket:behaviorId=0&wicket:ignoreIfNotActive=true&random=0.9564825826726502
> INFO: Invoking pre-call handler(s)...
> INFO: Received ajax response (572 characters)
> INFO:
>
> Any clue what I'm forgetting ?  I'm using wicket-1.2.6 ...
> --
> View this message in context:
> http://www.nabble.com/Label-with-AjaxSelfUpdatingTimerBehavior-not-refreshing-tp20490454p20490454.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to