Hi,

This is the working code, right ?
Can you show us the non-working one ?


On Sat, Jan 26, 2013 at 2:08 AM, mohallo <[email protected]> wrote:

> I have the following code with a label and a model .Which works as expected
> .I added a timer which refreshes the component and hence the getObject of
> the model is called .
> If I use the same code and Replace the timerLabel with a panel I would have
> thought it would work the same way .
>
> The Idea is to attach a model to the Panel and when the panel gets
> refreshed
> it will call the getObject on the model .
>
> public void init(){
>
>                 timerTaskForm = new TimerTaskForm("timertaskform");
>                 this.add(timerTaskForm);
>         }
>
>         private class TimerTaskForm extends Form {
>
>                 public TimerTaskForm(String id) {
>                         super(id);
>
>
>                         timerLabel = new Label("status",new Model(){
>
>                                 @Override
>                                 public Serializable getObject(){
>
>                                         Date dt = new Date();
>                                         SimpleDateFormat sdfout = new
> SimpleDateFormat("dd-MMMM-yyyy
> hh:mm:ss");
>                                         String convertedValue =
> sdfout.format(dt);
>                                         return convertedValue;
>
>                                 }
>
>                         });
>                         ajaxTimer = new
> AjaxSelfUpdatingTimerBehavior(Duration.seconds(5));
>                         timerLabel.add(ajaxTimer);
>                         this.add(timerLabel);
>                 }
>
>
>
>         }
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Issue-with-panel-model-refresh-tp4655775.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Reply via email to