If I have a panel that nests a border which in turn nests som labels.
The border has the self updating behaviour. If I run on 1.3.0-beta3
the self updating seems to work when this panel is inserted into a
page through the replace.
If I run this on 1.3.0-rc1 it does not update. Sadly the sample
applications are similar but not the same. I will try to run the exact
same sample in a few days, but anyway here is the code that does not
work.

----------

public class MemoryIndexPanel extends Panel {

    public MemoryIndexPanel(String id) {
        super(id);
        Border someBorder = new BoxBorder("someborder");
        someBorder.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(3)));
        someBorder.setOutputMarkupId(true);
        add(someBorder);
        someBorder.add(new Label("heap", new HeapModel()));
    }

    static class HeapModel extends AbstractReadOnlyModel {
        @Override
        public Object getObject() {
            final Locale userLocale = new Locale("sv", "SE");
            final NumberFormat numberFormat = NumberFormat
                    .getInstance(userLocale);

            final long freeMemory = Runtime.getRuntime().freeMemory();

            return numberFormat.format(freeMemory);
        }
    }
}


-------------------
// HelloPanel is just a dumb panel with no components

    class SwitchPanelLink extends AjaxLink {
        public SwitchPanelLink(String id) {
            super(id);
        }

        @Override
        public void onClick(AjaxRequestTarget target) {
            if (hello) {
                panel = new HelloPanel("switchingpanel");
                hello = false ;
            } else {
                panel = new MemoryIndexPanel("switchingpanel");
                hello = true ;
            }
            panel.setOutputMarkupId(true);
            Index.this.replace(panel) ;
            target.addComponent(panel);
        }

    }
------------------

On Nov 29, 2007 9:46 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> what wicket version are you using? and in the output see if the
> javascript to update it is included...
>
> -igor
>
>
>
> On Nov 29, 2007 12:44 PM, Johan Maasing <[EMAIL PROTECTED]> wrote:
> > Sorry for my bad explanation. No the other way around. I have a "dumb"
> > panel which I then replace with the self updating one.
> > The SelfUpdating panel is displayed but it triggers no update of itself.
> > If I just add the self updating panel to the page (no AjaxLink to
> > replace it in) it updates itself.
> >
> >
> > On Nov 29, 2007 9:37 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > > you replace the component that has the updating behavior with another
> > > one that doesnt and then it doesnt update? because the new panel
> > > doesnt have the updating behavior added to it....
> > >
> > > -igor
> > >
> > >
> > >
> > > On Nov 29, 2007 12:34 PM, Johan Maasing <[EMAIL PROTECTED]> wrote:
> > > > I have a panel that updates regularly like this:
> > > > updatingPanel.add(new 
> > > > AjaxSelfUpdatingTimerBehavior(Duration.seconds(3)));
> > > >
> > > > Now, if I have a page that includes an AjaxLink that does a replace of
> > > > one panel in the page to the panel that have the update behaviour it
> > > > does not update.
> > > > Is this because the replace of one component for another does not
> > > > include the necessary JavaScript för SelfUpdating to work? Is this
> > > > expected?
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to