Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-1953 isEnabled called even if component is not Visible
  3. WICKET-2678

isEnabled called in AjaxRequestTarget for Behaviors even if component is not Visible in hierarchy

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.5
    • 1.4.6, 1.5-M1
    • wicket
    • None

    Description

      AjaxRequestTarget calls isEnabled for behaviors even if the related component is not visible in hierarchy.

      Exlpicit problems: hide using ajax a panel containing datefield having datepicker behavior and the javascript will crash in browser. Mozilla will survive but ie8 will not execute ajaxpostcallhandlers.

      Following code should probably call component.isVisibleInHierarchy instead of just isVisible:

      public class AjaxRequestTarget implements IPageRequestTarget
      {
      ...
      if (component instanceof MarkupContainer)
      {
      ((MarkupContainer)component).visitChildren(new Component.IVisitor<Component>()
      {
      public Object component(Component component)
      {
      if (component.isVisible())

      { component.renderHead(header); return CONTINUE_TRAVERSAL; }

      Attachments

        Activity

          People

            jdonnerstag Juegen Donnerstag
            mmakundi Martin Terra
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified