this is exactly the interface i described earlier in this thread, and yeah it will work for this usecase as well even though i explained another one.

you just have to be careful to provide the page as the parent when the border component itself is added - but you can do that by checking the id.

so the interface would actually need to have getAlernateParent(Component c); so you can be selective - which also means we need to set the id before the parent. this is where the danger comes in - getAlternateParent is dealing with an uninitialized component object. so maybe getAlternatePrent(Class clazz, String id, IModel model) would be better because those 3 things we know upfront and they are safe to touch.

-Igor


On 9/14/06, Juergen Donnerstag <[EMAIL PROTECTED]> wrote:
While starting to removing the bordered page code pieces it came to me
that an Interface such as

interface IAlternateParentProvider
{
   MarkupContainer getAlternateParent()
}

could do the trick in 2.0 if in Container.<init> we do

if (parent instanceof IAlternateParentProvider)
{
   this.parent = ((IAlternateParentProvider) parent).getParent();
}
else
{
   this.parent = parent;
}

The outcome is that your bordered page needs to implement the
interface, you provide the border component, and that's it. Any
component create in Page will be added to border instead. It is
non-intrusive and to me it is much more intuitive as well compared to
border.setTransparent().

Juergen

On 9/14/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> On 9/14/06, Juergen Donnerstag < [EMAIL PROTECTED]> wrote:
> > Some more food for thought or what we should support and what not.
> >
> > Transparent containers allow you to add a component to the transparent
> > container and the markup is expected to be in the transparent
> > containers parent. Thats why it is called transparent. I'm fine with
> > this use case and I think we should support it.
> >
> > In contrast with a bordered page you add the component to a container
> > (e.g. Page) and the markup can be found in any transparent container
> > which is also a child of Page. In order to find the markup for the
> > component you hence must scan the Pages markup file the components
> > markup as well as the markup associated with all transparent
> > containers also add to Page. This use case (e.g. bordered pages), IMHO
> > we shouldn't support.
> >
> > I currently believe there is too much magic involved in the latter use
> > case and as already mentioned you'll find quite some clunky code in
> > the code base already to just support that use case. I'd much try to
> > stay as close as possible to the 1:1 mapping of component hierarchy
> > and markup hierarchy.
>
> +1
>
> Eelco
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Wicket-develop mailing list
> Wicket-develop@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
>

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to