Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-4749

TabbedPanel - IModel<?> initModel()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 6.0.0
    • 6.1.0
    • wicket-extensions
    • None

    Description

      TabbedPanel added on panel which have CompoundPropertyPanel get Exception.

      Problem is in TabbedPanel method IModel<?> initModel().

      @Override
      protected IModel<?> initModel()
      {
      IModel<?> model = super.initModel();
      if (model == null)

      { model = new Model<Integer>(-1); }

      return model;
      }

      I think problem is the line with IModel<?> model = super.initModel();

      When the tabbed panel is trying to get a model but found null then the model is trying to create. Call the initModel () and the calling super.initModel () executes initialization model ancestors. Which is the problem. Method for initModel () in the Component starts to look at his parents and returns CompoundPropertyModel from the panel where TabbedPanel added. And then isnt created new Model<Integer>(-1) which tabbed panel really need.

      When I override method initModel() from TabbedPanel again and delete line with super.initModel(), everything works fine.

      Attachments

        Issue Links

          Activity

            People

              svenmeier Sven Meier
              derethas Jakub Rinkes
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: