Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 6.0.0
    • Fix Version/s: 6.1.0
    • Component/s: wicket-extensions
    • Labels:
      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.

        Issue Links

          Activity

          Jakub Rinkes created issue -
          Hide
          Martin Grigorov added a comment -

          Please paste the exception.

          Show
          Martin Grigorov added a comment - Please paste the exception.
          Sven Meier made changes -
          Field Original Value New Value
          Link This issue relates WICKET-4593 [ WICKET-4593 ]
          Hide
          Sven Meier added a comment -

          In 6.x TabbedPanel is improved to be able to bind it to your own models.

          You can provide a model to the constructor if you don't want the TabbedPanel to lookup its model from a possibly parental CompoundPropertyModel.

          Alternatively we might change TabbedPanel to behave like Button, which supports a model but explicitly disables working with CompoundPropertyModel, see Button#initModel() javadoc.

          Show
          Sven Meier added a comment - In 6.x TabbedPanel is improved to be able to bind it to your own models. You can provide a model to the constructor if you don't want the TabbedPanel to lookup its model from a possibly parental CompoundPropertyModel. Alternatively we might change TabbedPanel to behave like Button, which supports a model but explicitly disables working with CompoundPropertyModel, see Button#initModel() javadoc.
          Hide
          Jakub Rinkes added a comment -

          Exception is about looking variable which have name like TabbedPanel id added in panel where is CompoundPropertyModel.

          I think the alternative with Button#initModel() will be better. This model isn't for data but for working TabbedPanel and try to find it in CompoundPropertyModel from parent will be rarely situation. At least what I think.

          Show
          Jakub Rinkes added a comment - Exception is about looking variable which have name like TabbedPanel id added in panel where is CompoundPropertyModel. I think the alternative with Button#initModel() will be better. This model isn't for data but for working TabbedPanel and try to find it in CompoundPropertyModel from parent will be rarely situation. At least what I think.
          Sven Meier made changes -
          Assignee Sven Meier [ svenmeier ]
          Hide
          Sven Meier added a comment -

          Changed as suggested: don't use model from parent

          Show
          Sven Meier added a comment - Changed as suggested: don't use model from parent
          Sven Meier made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 6.0.1 [ 12322956 ]
          Resolution Fixed [ 1 ]
          Emond Papegaaij made changes -
          Fix Version/s 6.1.0 [ 12322957 ]
          Fix Version/s 6.0.1 [ 12322956 ]
          Gavin made changes -
          Link This issue relates to WICKET-4593 [ WICKET-4593 ]
          Gavin made changes -
          Link This issue relates to WICKET-4593 [ WICKET-4593 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          1d 4h 46m 1 Sven Meier 05/Sep/12 17:34

            People

            • Assignee:
              Sven Meier
              Reporter:
              Jakub Rinkes
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development