something like this should work

public class MyPanel extends Panel {
  public MyPanel() {
  }

  protected void onBeforeRender() {
      removeAll();
      populatePanel();
      super.onBeforeRender();
   }

   protected populatePanel() {
       add(new label("foo"));
       ....
   }
}

that way the panel will rebuild its components every request. this is
the most inefficient way of doing it, you can start optimizing it as
you go along by changing the way it works. for example instead of
always removeall()+complete rebuild you can only remove some
components that truelly cannot be updated, while reusing others that
can be updated by utilizing a detachable model.

-igor


On Jan 22, 2008 3:54 PM, Ned Collyer <[EMAIL PROTECTED]> wrote:
>
>
> igor.vaynberg wrote:
> >
> > you can try using a repeater like a listview, and also make sure you
> > are using detachable models. perhaps if you gave more description of
> > what the component looks like/what it does and a screenshot that could
> > help us help you more.
> > -igor
> >
>
> Hi Igor, thanks for the reply :)
>
> Here is a basic screenshot of what i'm trying to achieve.  (i'm not a
> creative ;) sorry for the colours).
>
> The panel on the left should be able to reload all its internal information
> each request based on a single call to the service layer (ie, not doing a
> call for each individual item in the list).  This will show things like the
> extra child folders, or any attributes that may have changed (these could be
> calculated and set from the service call).  It is expected that multiple
> users will be using the same models (ill worry about actual concurrent edits
> of the data later - i'm not too fussed by it right now).
> http://www.nabble.com/file/p15031759/component.png
>
> The panel in the middle should maintain state.  Both use the same base model
> (a folder), so I'm not sure the detached model stuff is appropriate.
>
> There is some text in the attached image which will hopefully shed some
> light on what I am trying to achieve.
>
> Sorry if my example is vague - my domain model and its behaviour.. are
> pretty sensitive.
>
> Rgds
>
> Ned
> --
> View this message in context: 
> http://www.nabble.com/Reloading-component-on-each-request.-tp15017178p15031759.html
>
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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