[ 
https://issues.apache.org/jira/browse/WICKET-6608?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16703130#comment-16703130
 ] 

Sven Meier edited comment on WICKET-6608 at 11/29/18 4:58 PM:
--------------------------------------------------------------

All components directly *queued into a page* are *immediately* dequeued, 
*including* all queued component in the child hierarchy:
 * when you queue your form to the page, all components are immediately 
dequeued into the component hierarchy
 * but when you add your form to the page, all queued components inside of it 
*stay queued* until rendering

In the latter case PageAndComponentProvider does not find the component in the 
page, thus rendering it once to find the queued (not yet added) component.
 So the label is already configured before the button is submitted and is able 
to change the model object.


was (Author: svenmeier):
All components directly *queued into a page* are *immediately* dequeued, 
*including* all queued component in the child hierarchy:
 * when you queue your form to the page, all components are immediately 
dequeued into the component hierarchy
 * but when you add your form to the page, all queued components inside of it 
*stay queued* until rendering

In the latter case PageAndComponentProvider does not find the component in the 
page, thus rendering it once to find the queued (not yet added) component.
So the label is already configured before the button is submitted changes the 
model object.

> Stateless page, mix of queue and add can cause unforseen consequences
> ---------------------------------------------------------------------
>
>                 Key: WICKET-6608
>                 URL: https://issues.apache.org/jira/browse/WICKET-6608
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 8.1.0
>            Reporter: Oddgeir Bell
>            Assignee: Andrea Del Bene
>            Priority: Minor
>             Fix For: 8.2.0, 9.0.0
>
>         Attachments: statelessQueueAdd.zip
>
>
> 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.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to