Markup inheritance (http://cwiki.apache.org/WICKET/markup-inheritance.html) certainly looks more straight forward, I'll move over to using it.

Is there any situation where borders might be preferable though?

--------------------------------------------------
From: "James Carman" <[EMAIL PROTECTED]>
Sent: Thursday, April 24, 2008 7:13 PM
To: <[email protected]>
Subject: Re: Best way to use borders tranparently

Try using markup inheritance.  It's way easier than borders.

On Thu, Apr 24, 2008 at 2:07 PM, Joel Halbert <[EMAIL PROTECTED]> wrote:
Hi,

 I'm trying to work out the best way to use borders within my app.

 After looking at the following docs:
 http://wicket.apache.org/examplenavomatic.html
http://cwiki.apache.org/WICKET/consistent-page-layout-using-borders.html (out of date)

I have settled on an approach based off the suggestion in the second link and was wondering if anyone could see any issues with it or suggest a better way:

I've created a base page MyBorderPage.java from which all other pages in my app extend. This page takes care of creating the border. Components are added to the border through a custom addTo(Component) method which delegates to border.add.

 public abstract class MyBorderPage extends WebPage {

      private MyBorder border;

      MyBorderPage() {
          super();
          border = new MyBorder("border");
          super.add(border);
       }


     protected void addTo(Component c) {
          border.add(c);
     }
 }


This seems to work fine but my main concern is that because I can not override add() directly (since it is final) it is not very transparent because the user need to know to use my addTo() method.

 Is there a better way?

 Thanks,

 Joel

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to