On Tue, 08 Jul 2008, Michael Sparer wrote:
> The detach method should be called by the component that uses the model,
> there should be no need for you to call detach manually. 

...unless the model is not the default model of any Component.
For example you can have

  public class EmployeePanel extends Panel {
      private final IModel<Position> positionToDisplay;

      public EmployeePanel(String id, IModel<Employee> employee,
          IModel<Position> positionToDisplay  {
          super(id, employee);
          this.positionToDisplay = positionToDisplay;
          ...
      }

      @Override
      public void onDetach() {
          positionToDisplay.detach();
          super.onDetach();
      }
      ...
  }

The same goes for nested models, the outer model (assigned to
a component) must delegate the detach call to the inner 
model.

Best wishes,
Timo

-- 
Timo Rantalaiho           
Reaktor Innovations Oy    <URL: http://www.ri.fi/ >

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

Reply via email to