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

Stateless page, mix of queue and add can cause unforseen consequences

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Later
    • Affects Version/s: 8.1.0
    • Fix Version/s: None
    • Component/s: wicket
    • Labels:
      None

      Description

      We are in the process of upgrading a Wicket 6.x application to Wicket 8.1, mostly because we needed stateless ajax.

      In the process we discovered something quite unexpected (took a few days to figure out the cause).

      This is the issue:

      Stateless page.

      Hierarchy like so:

      Page

           ->Container

                  ->Label

                  ->AjaxButton

       

      The label should only be visible when it's model has data, so we override onConfigure and set visible = (getDefaultModelObject != null).

      This works if all components are added with add(Component).

      It also works if all components are added with queue(Component).

      BUT, if the container is added with add(Component) and the AjaxButton is added with queue(Component), it doesn't work.

      Actually, if just one component is added to the page with queue(Component), things seem to work (as long as it is queue-ed AFTER the container is add-ed)

      I could not find any information on dangers of mixing add/queue with my google-fu, so it may look like it's a bug?

       

      Attached quickstart that shows the issue.

       

        Attachments

        1. statelessQueueAdd.zip
          45 kB
          Oddgeir Bell

          Issue Links

            Activity

              People

              • Assignee:
                svenmeier Sven Meier
                Reporter:
                kizer Oddgeir Bell
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: