Great, it's working.
Thanks for the quick response,

Philip



2011/11/17 Igor Vaynberg <igor.vaynb...@gmail.com>

> you can replace the lazy load panel instance:
>
> //check other selections
> myLazyLoadPanel=myLazyLoadPanel.replaceWith(new
> MyLazyLoadPanel(myLazyLoadPanel.getId(), ..)
> target.addComponent(myLazyLoadPanel);
>
> this will reset the state of lazyloadpanel to the "not-yet-loaded"
>
> -igor
>
> On Thu, Feb 3, 2011 at 11:40 AM, Matt Schmidt <mschmid...@gmail.com>
> wrote:
> > I currently have a DataGridView loaded inside of an AjaxLazyLoadPanel,
> > including the service call to get the data.
> >
> > myLazyLoadPanel = new AjaxLazyLoadPanel("id", new
> CollectionModel<Pojo>()) {
> >    public Component getLazyLoadComponent(String markupId) {
> >        if(getDefaultModelObject() == null) {
> >            setDefaultModelObject(myPojoService.readAll());
> >        }
> >        return new MyDataGridView(markupId, getDefaultModel()); //ignoring
> > casting for simplicity
> >    }
> > }
> >
> > That works great for loading the page before the service call is
> complete.
> >
> > But now I need to add a DropDownChoice to change the collection in the
> data
> > grid via Ajax after the page is loaded. Is there anyway to get the
> > DataGridView to be replaced with an Ajax indicator (like on page load)
> > during an Ajax "onchange" event for the DropDownChoice? I've added an
> Ajax
> > indicator to the DropDownChoice, but I would like the same behavior I
> get on
> > page load for the AjaxLazyLoadPanel.
> >
> > This is what I have for the drop down for starters:
> >
> > myDropDownChoice.add(new AjaxFormComponentUpdateBehavior("onchange") {
> >    protected void onUpdate(AjaxRequestTarget target) {
> >        if(myDropDownChoice.getModelObject().equals(foo)) {
> >
>  myLazyLoadPanel.setDefaultModelObject(myPojoService.readFoo());
> >        }
> >        //check other selections
> >       target.addComponent(myLazyLoadPanel);
> >    }
> > }
> >
> > I may be looking at this entirely wrong... Any suggestions?
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to