You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Yazeed Isaacs <Ya...@switch.tj> on 2008/11/25 11:45:20 UTC

AjaxSelfUpdatingTimerBehavior not updating

Hi

The AjaxSelfUpdatingTimerBehavior does not update/refresh the content.


I have a WebPage with an AjaxLink and a WebMarkupContainer that contains
default ListView.

WebPage
 |_AjaxLink
 |_WebMarkupContainer
    |_ListView


When the AjaxLink is clicked, the ListView is replaced by an
AjaxTabbedPanel. I do this by repainting the WebMarkupContainer in the
AjaxLink.onClick method.

Here is the overridden onClick Method:

@Override
public void onClick(AjaxRequestTarget target) {
  ArrayList tabs = new ArrayList();
  AbstractTab tab1 = new AbstractTab(new Model("Data")) {
    public Panel getPanel(String panelId) {
      return new MyTabPanel(panelId);
    }
  };
  tabs.add(tab1);

  AjaxTabbedPanel tabsPanel = new AjaxTabbedPanel("thetabs", tabs);
  container.replace(tabsPanel);
  container.setOutputMarkupId(true);
  container.setRenderBodyOnly(false);
  target.addComponent(container);
}

The AjaxSelfUpdatingTimerBehavior is added in the MyTabPanel constructor
as:

// timed updater
add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(10)));


What am I doing wrong?


Yazeed Isaacs - Java Developer
yazeed@transactionjunction.co.za


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: AjaxSelfUpdatingTimerBehavior not updating

Posted by James Carman <ja...@carmanconsulting.com>.
No problem.  Glad to help.

On Tue, Nov 25, 2008 at 9:21 AM, Yazeed Isaacs <Ya...@switch.tj> wrote:

> Thank you James, onBeforeRender() worked for me, in which all I did was
> replaced components. Really simple solution.
>
> Regards,
> Yazeed Isaacs - Java Developer
> yazeed@transactionjunction.co.za
>
>
>
> -----Original Message-----
> From: James Carman [mailto:james@carmanconsulting.com]
> Sent: 25 November 2008 03:19 PM
> To: users@wicket.apache.org
> Subject: Re: AjaxSelfUpdatingTimerBehavior not updating
>
> On Tue, Nov 25, 2008 at 7:41 AM, Yazeed Isaacs <Ya...@switch.tj> wrote:
> > If the AjaxSelfUpdatingTimerBehavior is added to the MyTabPanel panel,
> > will the MyTabPanel() constructor be called at each update interval?
>
> No.  But, the onBeforeRender() will be called.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

RE: AjaxSelfUpdatingTimerBehavior not updating

Posted by Yazeed Isaacs <Ya...@switch.tj>.
Thank you James, onBeforeRender() worked for me, in which all I did was
replaced components. Really simple solution.

Regards,
Yazeed Isaacs - Java Developer
yazeed@transactionjunction.co.za



-----Original Message-----
From: James Carman [mailto:james@carmanconsulting.com] 
Sent: 25 November 2008 03:19 PM
To: users@wicket.apache.org
Subject: Re: AjaxSelfUpdatingTimerBehavior not updating

On Tue, Nov 25, 2008 at 7:41 AM, Yazeed Isaacs <Ya...@switch.tj> wrote:
> If the AjaxSelfUpdatingTimerBehavior is added to the MyTabPanel panel,
> will the MyTabPanel() constructor be called at each update interval?

No.  But, the onBeforeRender() will be called.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: AjaxSelfUpdatingTimerBehavior not updating

Posted by James Carman <ja...@carmanconsulting.com>.
On Tue, Nov 25, 2008 at 7:41 AM, Yazeed Isaacs <Ya...@switch.tj> wrote:
> If the AjaxSelfUpdatingTimerBehavior is added to the MyTabPanel panel,
> will the MyTabPanel() constructor be called at each update interval?

No.  But, the onBeforeRender() will be called.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: AjaxSelfUpdatingTimerBehavior not updating

Posted by Yazeed Isaacs <Ya...@switch.tj>.
If the AjaxSelfUpdatingTimerBehavior is added to the MyTabPanel panel,
will the MyTabPanel() constructor be called at each update interval?

Please assist with this one guys. :D

Yazeed Isaacs - Java Developer
yazeed@transactionjunction.co.za



-----Original Message-----
From: Yazeed Isaacs [mailto:Yazeed@switch.tj] 
Sent: 25 November 2008 12:45 PM
To: users@wicket.apache.org
Subject: AjaxSelfUpdatingTimerBehavior not updating

Hi

The AjaxSelfUpdatingTimerBehavior does not update/refresh the content.


I have a WebPage with an AjaxLink and a WebMarkupContainer that contains
default ListView.

WebPage
 |_AjaxLink
 |_WebMarkupContainer
    |_ListView


When the AjaxLink is clicked, the ListView is replaced by an
AjaxTabbedPanel. I do this by repainting the WebMarkupContainer in the
AjaxLink.onClick method.

Here is the overridden onClick Method:

@Override
public void onClick(AjaxRequestTarget target) {
  ArrayList tabs = new ArrayList();
  AbstractTab tab1 = new AbstractTab(new Model("Data")) {
    public Panel getPanel(String panelId) {
      return new MyTabPanel(panelId);
    }
  };
  tabs.add(tab1);

  AjaxTabbedPanel tabsPanel = new AjaxTabbedPanel("thetabs", tabs);
  container.replace(tabsPanel);
  container.setOutputMarkupId(true);
  container.setRenderBodyOnly(false);
  target.addComponent(container);
}

The AjaxSelfUpdatingTimerBehavior is added in the MyTabPanel constructor
as:

// timed updater
add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(10)));


What am I doing wrong?


Yazeed Isaacs - Java Developer
yazeed@transactionjunction.co.za


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org