Wicket
  1. Wicket
  2. WICKET-1172

FormComponentFeedbackIndicator and FormComponentFeedbackBorder is broken

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.3.0-rc1
    • Fix Version/s: 1.3.0-rc2
    • Component/s: wicket
    • Labels:
      None

      Description

      FormComponentFeedbackIndicator is not work. FormComponentFeedbackIndicator always invisible because:
      first render forms contain no errors,
      method FormComponentFeedbackIndicator.onBeforeRender (line 78) sets component invisible.
      onBeforeRender() not call for invisible components.

      workaround: override isVisible method :

      @Override
      public boolean isVisible()

      { return Session.get().getFeedbackMessages().hasMessage(this.getFeedbackMessageFilter()); }

      method onBeforeRender don't need override in org.apache.wicket.markup.html.form.validation.FormComponentFeedbackIndicator

      same situation with FormComponentFeedbackBorder .

      1. IndicatorTest.java
        3 kB
        Marat Radchenko

        Activity

        Hide
        Johan Compagner added a comment -

        this is weird, because the FormComponentFeedbackBorder it self is still visible..
        Its the indicator that will be set to none visible which is a child of the FormComponentFeedbackBorder
        so onBeforeRender should be called on it because isVisible of the border itself should still return true.

        You are right about the FormComponentFeedbackIndicator that one sets itself none visible so then it goes wrong. But can you be sure/test that it also really goes wrong for FormComponentFeedbackBorder ?
        Do you have a simple test (junit if possible)

        Show
        Johan Compagner added a comment - this is weird, because the FormComponentFeedbackBorder it self is still visible.. Its the indicator that will be set to none visible which is a child of the FormComponentFeedbackBorder so onBeforeRender should be called on it because isVisible of the border itself should still return true. You are right about the FormComponentFeedbackIndicator that one sets itself none visible so then it goes wrong. But can you be sure/test that it also really goes wrong for FormComponentFeedbackBorder ? Do you have a simple test (junit if possible)
        Hide
        Marat Radchenko added a comment -

        Please find testcase in attached file.
        There are two tests:

        • testFixedVisible, which runs fixed FormComponentFeedBackIndicator (and passes)
        • testVisible, which runs current FormComponentFeedBackIndicator (and fails)
        Show
        Marat Radchenko added a comment - Please find testcase in attached file. There are two tests: testFixedVisible, which runs fixed FormComponentFeedBackIndicator (and passes) testVisible, which runs current FormComponentFeedBackIndicator (and fails)
        Hide
        Johan Compagner added a comment -

        I made 2 unit test one for the border and one for the indicator.
        The indicator did fail as you described, but the border did work fine.

        I fixed the indicator problem.

        Show
        Johan Compagner added a comment - I made 2 unit test one for the border and one for the indicator. The indicator did fail as you described, but the border did work fine. I fixed the indicator problem.

          People

          • Assignee:
            Johan Compagner
            Reporter:
            Dmitry Rzhevskiy
          • Votes:
            3 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development