Could be caused by https://issues.apache.org/jira/browse/WICKET-745
(read the last comment)

-Matej

On Nov 30, 2007 9:37 AM, Johan Maasing <[EMAIL PROTECTED]> wrote:
> On Nov 30, 2007 6:41 AM, Иванов Дмитрий <[EMAIL PROTECTED]> wrote:
> > Everybody hello.
> >
> > As far as i know:
> >   - if ypu add to some component ajax timer behaviour and then add
> >     this component to ajax target while handling another ajax
> >     behaviour - there's no header contributed javascript added to
> >     response at the second time. So, after first updating
> >     there's no script to call. I have had 'fix' this like
> >     this:
>
> Thanks for the hint. I thought that perhaps there was some JavaScript
> missing when replacing in a component that didn't start the timer.
> I'll try your fix later and report the result.
>
>
> > ------
> > // link wich start some long living process
> > final AjaxSubmitLink importRefreshLink = new 
> > AjaxSubmitLink("import_refresh_link")
> > {
> >     // handling clicking on link
> >     protected void onSubmit(AjaxRequestTarget target, Form form)
> >     {
> >         // some code for starting process skipped
> >         // ...
> >
> >         // adding progress info to ajax response - it's just a label
> >         // with dynamic content (long living process completion status
> >         // - without timer behaviour at this moment)
> >         target.addComponent(progressInfo);
> >
> >         // here we are adding timer behaviour to label
> >         progressInfo.add(new AbstractAjaxTimerBehavior(Duration.seconds(5))
> >         {
> >             // our own 'stop' state - kind of fix related to header
> >             // javascript
> >             boolean stoppedFlag = false;
> >
> >             // handling our logic
> >             protected void onTimer(AjaxRequestTarget tgt)
> >             {
> >                  // some code to determine state of long living
> >                  // process skipped
> >
> >                  // here we also stop timer and set stoppedFlag to
> >                  // true when long living process finish
> >             }
> >
> >             // redefine head rendering so while our process is live
> >             // - we add timer - js to ajax response
> >             public void renderHead(IHeaderResponse response)
> >             {
> >                  super.renderHead(response);
> >                  if (!stoppedFlag)
> >                      
> > response.renderOnLoadJavascript(getJsTimeoutCall(getUpdateInterval()));
> >             }
> >
> >        }
> >    }
> > }
> > ------
> >
> >
> >
> > JM> If I have a panel that nests a border which in turn nests som labels.
> > JM> The border has the self updating behaviour. If I run on 1.3.0-beta3
> > JM> the self updating seems to work when this panel is inserted into a
> > JM> page through the replace.
> > JM> If I run this on 1.3.0-rc1 it does not update. Sadly the sample
> > JM> applications are similar but not the same. I will try to run the exact
> > JM> same sample in a few days, but anyway here is the code that does not
> > JM> work.
> >
> > JM> ----------
> >
> > JM> public class MemoryIndexPanel extends Panel {
> >
> > JM>     public MemoryIndexPanel(String id) {
> > JM>         super(id);
> > JM>         Border someBorder = new BoxBorder("someborder");
> > JM>         someBorder.add(new
> > JM> AjaxSelfUpdatingTimerBehavior(Duration.seconds(3)));
> > JM>         someBorder.setOutputMarkupId(true);
> > JM>         add(someBorder);
> > JM>         someBorder.add(new Label("heap", new HeapModel()));
> > JM>     }
> >
> > JM>     static class HeapModel extends AbstractReadOnlyModel {
> > JM>         @Override
> > JM>         public Object getObject() {
> > JM>             final Locale userLocale = new Locale("sv", "SE");
> > JM>             final NumberFormat numberFormat = NumberFormat
> > JM>                     .getInstance(userLocale);
> >
> > JM>             final long freeMemory = Runtime.getRuntime().freeMemory();
> >
> > JM>             return numberFormat.format(freeMemory);
> > JM>         }
> > JM>     }
> > JM> }
> >
> >
> > JM> -------------------
> > JM> // HelloPanel is just a dumb panel with no components
> >
> > JM>     class SwitchPanelLink extends AjaxLink {
> > JM>         public SwitchPanelLink(String id) {
> > JM>             super(id);
> > JM>         }
> >
> > JM>         @Override
> > JM>         public void onClick(AjaxRequestTarget target) {
> > JM>             if (hello) {
> > JM>                 panel = new HelloPanel("switchingpanel");
> > JM>                 hello = false ;
> > JM>             } else {
> > JM>                 panel = new MemoryIndexPanel("switchingpanel");
> > JM>                 hello = true ;
> > JM>             }
> > JM>             panel.setOutputMarkupId(true);
> > JM>             Index.this.replace(panel) ;
> > JM>             target.addComponent(panel);
> > JM>         }
> >
> > JM>     }
> > JM> ------------------
> >
> >
> > JM> 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]
> > >>
> > >>
> >
> > JM> ---------------------------------------------------------------------
> > JM> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > JM> For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> > WBR, Dmitry.
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>

Reply via email to