Scott Swank wrote:
> 
> I've often seen folk want what I see as "abstract" tags that can then
> be implemented by subclasses.  The way I've handled that for our
> application is by creating an abstract component (say it's a page)
> with div tags with appropriate wicket:ids.
> 
> public class BasePage extends WebPage
> {
>   public BasePage()
>   {
>     add(buildFoo("foo"));
>     add(buildBar("bar"));
>   }
> 
>   public abstract Panel buildFoo(String id);
>   public abstract Component buildBar(String id);
> }
> 
> Then subclass appropriately.
> 

This solution has some limitations while multiple <wicket:child> has not: 
1)We have to repeat the common parts of BasePage.html in all of its
descendants (such as DerivedPage1.html, DerivedPage2.html ...).
  ==> If we have multiple <wicket:child>, we have no need to do this.
2)If we chang the common parts in BasePage.html, we have to do the same
change in all of its descendants.
  ==> If we have multiple <wicket:child>, we just do the change in
BasePage.html
3)The descendants have to provide a XXXPanel to encapsulate some components
  ==> If we have multiple <wicket:child>, we can just put these components
between <wichet:child> and </wicket:child>, such as
      <wicket:child>
         <label wicket:id="label">aaa</label>
         <input wicket:id="input" value="test/>
      </wicket:child>

-- 
View this message in context: 
http://www.nabble.com/Multiple-wicket%3Achild-tags-in-the-same-page-tf3775143.html#a11263485
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to