Wicket
  1. Wicket
  2. WICKET-943

java.lang.NullPointerException at wicket.markup.html.list.ListView.renderItem(ListView.java:676)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.2.6
    • Fix Version/s: 1.2.7
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Window XP SP3, Java 1.6, Tomcat 5.0_09

      Description

      This problem happens if parent component has been hidden by authorization strategy during the previous page render, but on the next render parent component becomes visible. This problem is common for all repeaters. The problem here is in internalOnAttach() method of repeaters. This method will not populate items if it not visible in hierarchy, but when it checks this it use old visible state (Component.FLAG_IS_RENDER_ALLOWED) of component (itself and parent components), this state is changed after setRenderAllowed() method in Component.java on 1630 line returns, but internalAttach() method is called earlier in Component.java on 1624 line. After that component become visible and will be rendered. But it can't be rendered because items were not populated, so null pointer exception occurs.

      This problem can be fixed if method calls of internalAttach() and setRenderAllowed(isActionAuthorized(RENDER)) will be swapped or logic of repeaters (ListView, DataView, etc) components will be changed.

        Activity

          People

          • Assignee:
            Johan Compagner
            Reporter:
            Alexander Suslov
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development