Re: Wicket EnclosureContainer - any changes to behaviour from 6.x -> 7.x?

2021-09-13 Thread Chris Colman



On 13/09/2021 5:19 pm, Martin Grigorov wrote:

On Mon, Sep 13, 2021 at 9:44 AM Martin Grigorov 
wrote:



On Mon, Sep 13, 2021 at 9:27 AM Chris Colman
 wrote:


You shouldn't use  if you use EnclosureContainer.
Use a  instead.

It's weird how it's worked perfectly for many years for us in Wicket 6.x.

Maybe an extra note could be added to the 6.x -> 7.x migration guide in
case others experience this in their migration efforts.


We didn't do any changes in this area. Or at least I don't remember such.

What we could do is to improve EnclosureContainer to complain when used
with .


This won't work without adding more logic to Enclosure (the .java component
behind ).
While trying to get the markup for EnclosureContainer Wicket triggers the
auto-component logic for  and it fails with the error you
reported, so there is no way to get the ComponentTag at all.
I am against adding more logic to Enclosure.java because it has too many
problems already.

What I could do is to improve EnclosureContainer's javadoc to mention this.
Improve javadoc should to the trick: At least if people are made aware 
that they need to avoid using the  tag altogether they 
should be fine.





Regards,
Chris

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket EnclosureContainer - any changes to behaviour from 6.x -> 7.x?

2021-09-13 Thread Martin Grigorov
On Mon, Sep 13, 2021 at 10:19 AM Martin Grigorov 
wrote:

>
>
> On Mon, Sep 13, 2021 at 9:44 AM Martin Grigorov 
> wrote:
>
>>
>>
>> On Mon, Sep 13, 2021 at 9:27 AM Chris Colman
>>  wrote:
>>
>>>
>>> > You shouldn't use  if you use EnclosureContainer.
>>> > Use a  instead.
>>>
>>> It's weird how it's worked perfectly for many years for us in Wicket 6.x.
>>>
>>> Maybe an extra note could be added to the 6.x -> 7.x migration guide in
>>> case others experience this in their migration efforts.
>>>
>>
>> We didn't do any changes in this area. Or at least I don't remember such.
>>
>> What we could do is to improve EnclosureContainer to complain when used
>> with .
>>
>
> This won't work without adding more logic to Enclosure (the .java
> component behind ).
> While trying to get the markup for EnclosureContainer Wicket triggers the
> auto-component logic for  and it fails with the error you
> reported, so there is no way to get the ComponentTag at all.
> I am against adding more logic to Enclosure.java because it has too many
> problems already.
>
> What I could do is to improve EnclosureContainer's javadoc to mention this.
>

https://issues.apache.org/jira/browse/WICKET-6919


>
>
>>
>>
>>>
>>> Regards,
>>> Chris
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>


Re: Wicket EnclosureContainer - any changes to behaviour from 6.x -> 7.x?

2021-09-13 Thread Martin Grigorov
On Mon, Sep 13, 2021 at 9:44 AM Martin Grigorov 
wrote:

>
>
> On Mon, Sep 13, 2021 at 9:27 AM Chris Colman
>  wrote:
>
>>
>> > You shouldn't use  if you use EnclosureContainer.
>> > Use a  instead.
>>
>> It's weird how it's worked perfectly for many years for us in Wicket 6.x.
>>
>> Maybe an extra note could be added to the 6.x -> 7.x migration guide in
>> case others experience this in their migration efforts.
>>
>
> We didn't do any changes in this area. Or at least I don't remember such.
>
> What we could do is to improve EnclosureContainer to complain when used
> with .
>

This won't work without adding more logic to Enclosure (the .java component
behind ).
While trying to get the markup for EnclosureContainer Wicket triggers the
auto-component logic for  and it fails with the error you
reported, so there is no way to get the ComponentTag at all.
I am against adding more logic to Enclosure.java because it has too many
problems already.

What I could do is to improve EnclosureContainer's javadoc to mention this.


>
>
>>
>> Regards,
>> Chris
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>


Re: Wicket EnclosureContainer - any changes to behaviour from 6.x -> 7.x?

2021-09-13 Thread Martin Grigorov
On Mon, Sep 13, 2021 at 9:27 AM Chris Colman
 wrote:

>
> > You shouldn't use  if you use EnclosureContainer.
> > Use a  instead.
>
> It's weird how it's worked perfectly for many years for us in Wicket 6.x.
>
> Maybe an extra note could be added to the 6.x -> 7.x migration guide in
> case others experience this in their migration efforts.
>

We didn't do any changes in this area. Or at least I don't remember such.

What we could do is to improve EnclosureContainer to complain when used
with .


>
> Regards,
> Chris
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Wicket EnclosureContainer - any changes to behaviour from 6.x -> 7.x?

2021-09-13 Thread Chris Colman




You shouldn't use  if you use EnclosureContainer.
Use a  instead.


It's weird how it's worked perfectly for many years for us in Wicket 6.x.

Maybe an extra note could be added to the 6.x -> 7.x migration guide in 
case others experience this in their migration efforts.


Regards,
Chris

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket EnclosureContainer - any changes to behaviour from 6.x -> 7.x?

2021-09-11 Thread Martin Grigorov
On Sun, Sep 12, 2021, 08:03 Chris Colman
 wrote:

> We're in the middle of migrating a large enterprise content management
> system (>1000 UI classes) from 6.x to 7.x.
>
> We've finally got it compiling with Wicket 7.x but we're having an issue
> with an EnclosureContainer that worked fine in Wicket 6.x.
>
> org.apache.wicket.WicketRuntimeException: Could not find child with id:
> menuTitle in the wicket:enclosure
>  at
> org.apache.wicket.markup.html.internal.Enclosure.checkChildComponent(Enclosure.java:295)
>
> ~[wicket-core-7.18.0.jar:7.18.0]
>  at
> org.apache.wicket.markup.html.internal.Enclosure.getChildComponent(Enclosure.java:273)
>
> ~[wicket-core-7.18.0.jar:7.18.0]
>  at
> org.apache.wicket.markup.html.internal.Enclosure.getChild(Enclosure.java:136)
>
> ~[wicket-core-7.18.0.jar:7.18.0]
>  at
> org.apache.wicket.markup.html.internal.Enclosure.onConfigure(Enclosure.java:178)
>
> ~[wicket-core-7.18.0.jar:7.18.0]
>  at org.apache.wicket.Component.configure(Component.java:1056)
> ~[wicket-core-7.18.0.jar:7.18.0]
>  at
> org.apache.wicket.Component.internalBeforeRender(Component.java:941)
> ~[wicket-core-7.18.0.jar:7.18.0]
>  at org.apache.wicket.Component.beforeRender(Component.java:1018)
> ~[wicket-core-7.18.0.jar:7.18.0]
>  at
> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1826)
>
> ~[wicket-core-7.18.0.jar:7.18.0]
>  at org.apache.wicket.Component.onBeforeRender(Component.java:3921)
> ~[wicket-core-7.18.0.jar:7.18.0]
>  at
> com.sas.av.ui.wicket.templates.original.OrganizationPanel.onBeforeRender(OrganizationPanel.java:576)
>
> ~[classes/:?]
> ...
>
>
> I created a Wicket quickstart in 7.18.0 and was able to reproduce the
> issue with the following  code:
>
>
> Markup:
>
> 
> http://wicket.apache.org;>
>  
>  
>  Apache Wicket Quickstart
>  
>  
>  Apache Wicket
>  
>

You shouldn't use  if you use EnclosureContainer.
Use a  instead.

 Title
>  
>  
> 
>
> Java:
>
> package com.sas;
>
> import org.apache.wicket.request.mapper.parameter.PageParameters;
> import org.apache.wicket.markup.html.basic.Label;
> import org.apache.wicket.markup.html.WebPage;
> import org.apache.wicket.markup.html.basic.*;
>
> public class HomePage extends WebPage {
>  private static final long serialVersionUID = 1L;
>
>  public HomePage(final PageParameters parameters) {
>  super(parameters);
>
>  Label menuTitleLabel = new Label("menuTitle", "Fred");
>  EnclosureContainer ec = new EnclosureContainer("menuTitleEc",
> menuTitleLabel);
>  ec.add(menuTitleLabel);
>  menuTitleLabel.setVisible(true);
>  add(ec);
>  }
> }
>
>
> If I don't use an explicit EnclosureContainer and remove the wicket:id=
> from the wicket:enclosure element it works but I need to explicitly
> declare the enclosure in the component hierarchy.
>
> Regards,
> Chris
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Wicket EnclosureContainer - any changes to behaviour from 6.x -> 7.x?

2021-09-11 Thread Chris Colman
I found a workaround (which may be the intended usage but the API docs 
don't seem very explicit in regard to EnclosureContainer)


When using an EnclosureContainer don't use the wicket:enclosure tag like 
you do when not using an EnclosureContainer!


Use some standard HTML e.g. div or span instead of wicket:enclosure:

        
            Title
        

With the above markup the Wicket 6.x Java code works unchanged in Wicket 7.x

On 12/09/2021 11:30 am, Chris Colman wrote:
We're in the middle of migrating a large enterprise content management 
system (>1000 UI classes) from 6.x to 7.x.


We've finally got it compiling with Wicket 7.x but we're having an 
issue with an EnclosureContainer that worked fine in Wicket 6.x.


org.apache.wicket.WicketRuntimeException: Could not find child with 
id: menuTitle in the wicket:enclosure
    at 
org.apache.wicket.markup.html.internal.Enclosure.checkChildComponent(Enclosure.java:295) 
~[wicket-core-7.18.0.jar:7.18.0]
    at 
org.apache.wicket.markup.html.internal.Enclosure.getChildComponent(Enclosure.java:273) 
~[wicket-core-7.18.0.jar:7.18.0]
    at 
org.apache.wicket.markup.html.internal.Enclosure.getChild(Enclosure.java:136) 
~[wicket-core-7.18.0.jar:7.18.0]
    at 
org.apache.wicket.markup.html.internal.Enclosure.onConfigure(Enclosure.java:178) 
~[wicket-core-7.18.0.jar:7.18.0]
    at org.apache.wicket.Component.configure(Component.java:1056) 
~[wicket-core-7.18.0.jar:7.18.0]
    at 
org.apache.wicket.Component.internalBeforeRender(Component.java:941) 
~[wicket-core-7.18.0.jar:7.18.0]
    at org.apache.wicket.Component.beforeRender(Component.java:1018) 
~[wicket-core-7.18.0.jar:7.18.0]
    at 
org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1826) 
~[wicket-core-7.18.0.jar:7.18.0]
    at org.apache.wicket.Component.onBeforeRender(Component.java:3921) 
~[wicket-core-7.18.0.jar:7.18.0]
    at 
com.sas.av.ui.wicket.templates.original.OrganizationPanel.onBeforeRender(OrganizationPanel.java:576) 
~[classes/:?]

   ...


I created a Wicket quickstart in 7.18.0 and was able to reproduce the 
issue with the following  code:



Markup:


http://wicket.apache.org;>
    
        
        Apache Wicket Quickstart
    
    
        Apache Wicket
        
            Title
        
    


Java:

package com.sas;

import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.*;

public class HomePage extends WebPage {
    private static final long serialVersionUID = 1L;

    public HomePage(final PageParameters parameters) {
        super(parameters);

        Label menuTitleLabel = new Label("menuTitle", "Fred");
        EnclosureContainer ec = new EnclosureContainer("menuTitleEc", 
menuTitleLabel);

        ec.add(menuTitleLabel);
        menuTitleLabel.setVisible(true);
        add(ec);
    }
}


If I don't use an explicit EnclosureContainer and remove the 
wicket:id= from the wicket:enclosure element it works but I need to 
explicitly declare the enclosure in the component hierarchy.


Regards,
Chris



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Wicket EnclosureContainer - any changes to behaviour from 6.x -> 7.x?

2021-09-11 Thread Chris Colman
We're in the middle of migrating a large enterprise content management 
system (>1000 UI classes) from 6.x to 7.x.


We've finally got it compiling with Wicket 7.x but we're having an issue 
with an EnclosureContainer that worked fine in Wicket 6.x.


org.apache.wicket.WicketRuntimeException: Could not find child with id: 
menuTitle in the wicket:enclosure
    at 
org.apache.wicket.markup.html.internal.Enclosure.checkChildComponent(Enclosure.java:295) 
~[wicket-core-7.18.0.jar:7.18.0]
    at 
org.apache.wicket.markup.html.internal.Enclosure.getChildComponent(Enclosure.java:273) 
~[wicket-core-7.18.0.jar:7.18.0]
    at 
org.apache.wicket.markup.html.internal.Enclosure.getChild(Enclosure.java:136) 
~[wicket-core-7.18.0.jar:7.18.0]
    at 
org.apache.wicket.markup.html.internal.Enclosure.onConfigure(Enclosure.java:178) 
~[wicket-core-7.18.0.jar:7.18.0]
    at org.apache.wicket.Component.configure(Component.java:1056) 
~[wicket-core-7.18.0.jar:7.18.0]
    at 
org.apache.wicket.Component.internalBeforeRender(Component.java:941) 
~[wicket-core-7.18.0.jar:7.18.0]
    at org.apache.wicket.Component.beforeRender(Component.java:1018) 
~[wicket-core-7.18.0.jar:7.18.0]
    at 
org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1826) 
~[wicket-core-7.18.0.jar:7.18.0]
    at org.apache.wicket.Component.onBeforeRender(Component.java:3921) 
~[wicket-core-7.18.0.jar:7.18.0]
    at 
com.sas.av.ui.wicket.templates.original.OrganizationPanel.onBeforeRender(OrganizationPanel.java:576) 
~[classes/:?]

   ...


I created a Wicket quickstart in 7.18.0 and was able to reproduce the 
issue with the following  code:



Markup:


http://wicket.apache.org;>
    
        
        Apache Wicket Quickstart
    
    
        Apache Wicket
        
            Title
        
    


Java:

package com.sas;

import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.*;

public class HomePage extends WebPage {
    private static final long serialVersionUID = 1L;

    public HomePage(final PageParameters parameters) {
        super(parameters);

        Label menuTitleLabel = new Label("menuTitle", "Fred");
        EnclosureContainer ec = new EnclosureContainer("menuTitleEc", 
menuTitleLabel);

        ec.add(menuTitleLabel);
        menuTitleLabel.setVisible(true);
        add(ec);
    }
}


If I don't use an explicit EnclosureContainer and remove the wicket:id= 
from the wicket:enclosure element it works but I need to explicitly 
declare the enclosure in the component hierarchy.


Regards,
Chris



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org