Ok I'll try...

I was experimenting with the following with 2 panels... bascially
ChildPanel.getVariation() will override the SuperPanel.getVariation() so I
cannot have say a "Blue" SuperPanel" and a "Red" ChildPanel... which would
then make it possible to have flexible combination of layouts by extending
the panels...

I am not sure if this is the right approach, so would like some advice.
right now I have move to just sticking to 1 variation to 1 hierachy....

thanks
Joshua


////// SuperPanel //////

////// SuperPanel.Html

   <wicket:panel>
       <DIV style="border:1px solid #000">
       This is Super Panel
       <wicket:child/>
       </DIV>
   </wicket:panel>

////// SuperPanel_Red.html

   <wicket:panel>
       <DIV style="border:1px solid #F00">
       This is Red Super Panel
           <wicket:child />
       </DIV>
   </wicket:panel>

////// SuperPanel.java

public class SuperPanel extends Panel
{
   public String getVariation()
   {
       return "Red";
   }
}

////// ChildPanel //////

////// ChildPanel.html

   <wicket:extend>
       <DIV style="border:1px solid #000">
       This is Child Panel
       </DIV>
   </wicket:extend>

////// ChildPanel_Blue.html

   <wicket:extend>
       <DIV style="border:1px solid #00F">
       This is Blue Child Panel
       </DIV>
   </wicket:extend>

////// ChildPanel.java

public class ChildPanel extends SuperPanel
{
   public String getVariation()
   {
       return "Blue";
   }
}




On 5/11/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:

could you more clearly define what you think the behavior should be, and
what it is now?

-igor


On 5/10/07, Joshua Lim < [EMAIL PROTECTED]> wrote:

> Hi
>
> I have got a SuperPanel class that extends Panel, I have a few
> variations of html for this SuperPanel and am overriding the getVariation()
> method for to get what I want ...that's all good.
>
> Then I wanted to add a ChildPanel extending SuperPanel. and also I would
> like to have ChildPanel to have also a few variations hence giving me more
> flexibility in generating dynamic panels as a result...
>
> getVariation() gets resolved at the ChildPanel level only. since
> overriding the getVariation on ChildPanel hides SuperPanel.getVariation
> ().
>
> Am I stretching this too far?? :p and should just work with one
> variation per component hierarchy
>
> Joshua
>
>
> -------------------------------------------------------------------------
> 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
>
>

-------------------------------------------------------------------------
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


-------------------------------------------------------------------------
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