Re: [Wicket-user] Multiple wicket:child tags in the same page

2007-06-24 Thread rc.china

yehh, that's excellent! I know now, thank you, igor.vaynberg.


igor.vaynberg wrote:
 
 no they do not, all that is taken care off by wicket markup inheritance.
 for
 example:
 
 class basepage extends  webpage {
   abstract componentwithassociatedmarkup newarea1(string id);
   abstract componentwithassociatedmarkup newarea2(string id);
 }
 
 basepage.html
 html
 body
 before1 div wicket:id=area1/div before2 div
 wicket:id=area2/div
 wicket:child/
 /body
 /html
 
 class page1 extends basepage {
//implementation of newarea1 and 2
 }
 
 page1.html
 wicket:extend
 wicket:fragment for area 1/wicket:fragment
 wicket:fragment for area 2/wicket:fragment
 /wicket:extend
 
 as you can see in page1.html you do not need to repeat before1 and before2
 markup.
 
 -igor
 

-- 
View this message in context: 
http://www.nabble.com/Multiple-wicket%3Achild-tags-in-the-same-page-tf3775143.html#a11272841
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


Re: [Wicket-user] Multiple wicket:child tags in the same page

2007-06-23 Thread Igor Vaynberg

On 6/22/07, rc.china [EMAIL PROTECTED] wrote:





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



points one and two are not true. you would use wicket's markup inheritance
so the derived pages do not have to repeat anything from basepage.

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=labelaaa/label
 input wicket:id=input value=test/
  /wicket:child



also not strictly true. it doesnt need to be a panel, it can as easily be a
fragment which means it would be defined inline in the derived page. instead
of wicket:extend you would use wicket:fragment

all that said, like i said before there is nothing stopping you from
implementing what you want. all the api to do so is exposed - it is just not
the default the wicket team prefers.

-igor



--

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

-
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


Re: [Wicket-user] Multiple wicket:child tags in the same page

2007-06-23 Thread rc.china


igor.vaynberg wrote:
 
 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
 
 
 points one and two are not true. you would use wicket's markup inheritance
 so the derived pages do not have to repeat anything from basepage.
 
 
I mean that derived pages's html files have to repeat all the common parts
in BasePage.html and that if we change the common parts in BasePage.html, we
have to do the same change in all of its descendant html files. I know that
we have no need to make any change in its descendant java files.


igor.vaynberg wrote:
 
 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=labelaaa/label
  input wicket:id=input value=test/
   /wicket:child
 
 
 also not strictly true. it doesnt need to be a panel, it can as easily be
 a
 fragment which means it would be defined inline in the derived page.
 instead
 of wicket:extend you would use wicket:fragment
 
It seems that wicket:fragment is ok:)



igor.vaynberg wrote:
 
 all that said, like i said before there is nothing stopping you from
 implementing what you want. all the api to do so is exposed - it is just
 not
 the default the wicket team prefers.
 
I am just a fan of Wicket. and want to get a thorough understanding of
Wicket:)

-- 
View this message in context: 
http://www.nabble.com/Multiple-wicket%3Achild-tags-in-the-same-page-tf3775143.html#a11271116
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


Re: [Wicket-user] Multiple wicket:child tags in the same page

2007-06-23 Thread Igor Vaynberg

On 6/23/07, rc.china [EMAIL PROTECTED] wrote:




igor.vaynberg wrote:

 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


 points one and two are not true. you would use wicket's markup
inheritance
 so the derived pages do not have to repeat anything from basepage.


I mean that derived pages's html files have to repeat all the common parts
in BasePage.html and that if we change the common parts in BasePage.html,
we
have to do the same change in all of its descendant html files. I know
that
we have no need to make any change in its descendant java files.



no they do not, all that is taken care off by wicket markup inheritance. for
example:

class basepage extends  webpage {
 abstract componentwithassociatedmarkup newarea1(string id);
 abstract componentwithassociatedmarkup newarea2(string id);
}

basepage.html
html
body
before1 div wicket:id=area1/div before2 div wicket:id=area2/div
wicket:child/
/body
/html

class page1 extends basepage {
  //implementation of newarea1 and 2
}

page1.html
wicket:extend
wicket:fragment for area 1/wicket:fragment
wicket:fragment for area 2/wicket:fragment
/wicket:extend

as you can see in page1.html you do not need to repeat before1 and before2
markup.

-igor

igor.vaynberg wrote:


 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=labelaaa/label
  input wicket:id=input value=test/
   /wicket:child


 also not strictly true. it doesnt need to be a panel, it can as easily
be
 a
 fragment which means it would be defined inline in the derived page.
 instead
 of wicket:extend you would use wicket:fragment

It seems that wicket:fragment is ok:)



igor.vaynberg wrote:

 all that said, like i said before there is nothing stopping you from
 implementing what you want. all the api to do so is exposed - it is just
 not
 the default the wicket team prefers.

I am just a fan of Wicket. and want to get a thorough understanding of
Wicket:)

--
View this message in context:
http://www.nabble.com/Multiple-wicket%3Achild-tags-in-the-same-page-tf3775143.html#a11271116
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

-
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


Re: [Wicket-user] Multiple wicket:child tags in the same page

2007-06-22 Thread Eelco Hillenius
Yes. Markup inheritance is meant to go one-on-one with Java
inheritance which is limited to single parents. If people feel a
markup inheritance-like pattern would be useful, we could discuss it,
but it has to be a different kind of concept.

Eelco


On 6/21/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
 natural is an extremely subjective term. the core team does not entirely
 think so. but there is nothing stopping you from writing tag handlers to do
 exactly what you want.

 -igor



  On 6/21/07, rc.china [EMAIL PROTECTED] wrote:
 
  Panels and fragments are useful. As of page layout, however,
 wicket:extend
  / wicket:child is more natual than Panels and fragments.
 
  Some possible solutions is:
  1) use different tag values to differentiate:
  ...
  wicket:child childid=1/
  ...
  wicket:child childid=2/
  ...
  ==
  ...
  wicket:extend extendid=1
  ...
  /wicket:extend
  ...
  wicket:extend extendid=2
  ...
  /wicket:extend
  ...
 
  2)use wicket:extendN wicket:childN (N=1,2,3,...) instead of
  wicket:extend wicket:child
  ...
  wicket:child1/
  ...
  wicket:child2/
  ...
  ==
  ...
  wicket:extend1
  ...
  /wicket:extend1
  ...
  wicket:extend2
  ...
  /wicket:extend2
  ...
  --
  View this message in context:
 http://www.nabble.com/Multiple-wicket%3Achild-tags-in-the-same-page-tf3775143.html#a11245019
  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
 


 -
 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


Re: [Wicket-user] Multiple wicket:child tags in the same page

2007-06-22 Thread Eelco Hillenius
On 6/22/07, Scott Swank [EMAIL PROTECTED] 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.

Yeah, that something we use a lot here as well.

Eelco

-
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


Re: [Wicket-user] Multiple wicket:child tags in the same page

2007-06-22 Thread Scott Swank
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.


On 6/21/07, Eelco Hillenius [EMAIL PROTECTED] wrote:
 Yes. Markup inheritance is meant to go one-on-one with Java
 inheritance which is limited to single parents. If people feel a
 markup inheritance-like pattern would be useful, we could discuss it,
 but it has to be a different kind of concept.

 Eelco


 On 6/21/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
  natural is an extremely subjective term. the core team does not entirely
  think so. but there is nothing stopping you from writing tag handlers to do
  exactly what you want.
 
  -igor
 
 
 
   On 6/21/07, rc.china [EMAIL PROTECTED] wrote:
  
   Panels and fragments are useful. As of page layout, however,
  wicket:extend
   / wicket:child is more natual than Panels and fragments.
  
   Some possible solutions is:
   1) use different tag values to differentiate:
   ...
   wicket:child childid=1/
   ...
   wicket:child childid=2/
   ...
   ==
   ...
   wicket:extend extendid=1
   ...
   /wicket:extend
   ...
   wicket:extend extendid=2
   ...
   /wicket:extend
   ...
  
   2)use wicket:extendN wicket:childN (N=1,2,3,...) instead of
   wicket:extend wicket:child
   ...
   wicket:child1/
   ...
   wicket:child2/
   ...
   ==
   ...
   wicket:extend1
   ...
   /wicket:extend1
   ...
   wicket:extend2
   ...
   /wicket:extend2
   ...
   --
   View this message in context:
  http://www.nabble.com/Multiple-wicket%3Achild-tags-in-the-same-page-tf3775143.html#a11245019
   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
  
 
 
  -
  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



-- 
Scott Swank
reformed mathematician

-
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


Re: [Wicket-user] Multiple wicket:child tags in the same page

2007-06-22 Thread rc.china



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=labelaaa/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


Re: [Wicket-user] Multiple wicket:child tags in the same page

2007-06-21 Thread rc.china

Panels and fragments are useful. As of page layout, however, wicket:extend
/ wicket:child is more natual than Panels and fragments.

Some possible solutions is:
1) use different tag values to differentiate: 
...
wicket:child childid=1/
...
wicket:child childid=2/
...
==
...
wicket:extend extendid=1
...
/wicket:extend
...
wicket:extend extendid=2
...
/wicket:extend
...

2)use wicket:extendN wicket:childN (N=1,2,3,...) instead of
wicket:extend wicket:child
...
wicket:child1/
...
wicket:child2/
...
==
...
wicket:extend1
...
/wicket:extend1
...
wicket:extend2
...
/wicket:extend2
...
-- 
View this message in context: 
http://www.nabble.com/Multiple-wicket%3Achild-tags-in-the-same-page-tf3775143.html#a11245019
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


[Wicket-user] Multiple wicket:child tags in the same page

2007-05-20 Thread Chris Colman
 This extend  child thing really didn't seem to be intuitive at all.
 However, once I completely removed it things became more clear.
 
 1) It has no id tag.. So w/o asking or rtfm you're not going to know
 what's going on
 2) Wouldn't naming the hierarchy parent  child be more logical? In
 english.. extend + child have no relation...

I suppose it's a philosophical question on a number of levels. The first
level is whether inheritance is a parent/child relationship - I mean no
offence to anyone reading this but, clearly, inheritance is not a
parent/child relationship. To confuse parent/child with
superclass/subclass (or base class/derived class in the more accurate
but old fashion terminology) is a mistake. Subclasses are not children
of their superclass.

If I have a Vehicle class and extend that to make MotorCycle and
Automobile classes then these subclasses are not 'children' of the
vehicle class. They 'extend' vehicle but they are not 'owned by it' or
'born from it'. Parent/child is not an inheritance relationship - it's
an association relationship. Anyone who uses the world 'child' in an
inheritance context probably skipped the first lecture of their OO 1.0.1
course and stayed at the bar.

So let's pretend to ignore that word 'child' is used in this way in
wicket and move to the next philosophical issue: Is the extent/child tag
'the' inheritance relationship or is it just the mechanism that allows
us to take advantage of inheritance in the markup domain (for the first
time in any framework I've seen - which is why I like wicket so much)
and allows a derived class' markup to provide markup to fill a gap
specified in the base class' markup. I believe that in wicket the
'extend/child' tag is the latter.

It's really just like a virtual method in a class definition. You're
declaring some aspect within the base class for which no implementation
is provided in that base class but which must be provided in some class
that extends that base class. We do this all the time in OO - and we are
allowed to provide multiple instances of these in any class, not just
one instance per class, and we therefore give each instance a different
name. The implementation is provided in a subclass by a method that has
a matching name. This is how true and more powerful markup inheritance
could work in wicket. Naming would only be necessary in situations where
more than one markup chuck needs to be 'overridden' or provided in a
subclass.

Sure some of this could be done by creating extra Panel components but
sometimes I just have some markup that is common to only a portion of my
hierarchy. It seems fudgy to have to create new Panel components to
achieve what can be achieved at a markup level quite quickly and easily
and with less code and less classes.

 3) Instead of relying on the idea of child tags.. Just add more panels
 or other components that fit your need.  You have to break out of the
OO
 mindset a bit, but there's a lot of potential once you think outside
the
 bun.

I've aborted the adoption of all other Java UI frameworks I've ever
found because they forced me to break out of the OO mindset. I came to
wicket, and I'm guessing many other OOers have also because it, more
than any other UI framework, let's me keep my OO mindset that has been
the source of all my successes and the production of robust, high
quality, maintainable solutions for my clients over the last 15 years.

-
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


Re: [Wicket-user] Multiple wicket:child tags in the same page

2007-05-20 Thread Igor Vaynberg

like ive said before, instead of writing all this philosophical stuff you
could just implement it and give us a patch, or add an rfe. what is in
wicket now, terminology and semantics, is the first of its kind (like you
said), so perhaps we didnt get it exactly right. but it works for us now.
you are asking for something totally new, but right now we are busy fixing
bugs to get 1.3.0 shipped out of the door. we will be glad to point you in
the right direction and help you along if you choose to do it.

-igor


On 5/20/07, Chris Colman [EMAIL PROTECTED] wrote:


 This extend  child thing really didn't seem to be intuitive at all.
 However, once I completely removed it things became more clear.

 1) It has no id tag.. So w/o asking or rtfm you're not going to know
 what's going on
 2) Wouldn't naming the hierarchy parent  child be more logical? In
 english.. extend + child have no relation...

I suppose it's a philosophical question on a number of levels. The first
level is whether inheritance is a parent/child relationship - I mean no
offence to anyone reading this but, clearly, inheritance is not a
parent/child relationship. To confuse parent/child with
superclass/subclass (or base class/derived class in the more accurate
but old fashion terminology) is a mistake. Subclasses are not children
of their superclass.

If I have a Vehicle class and extend that to make MotorCycle and
Automobile classes then these subclasses are not 'children' of the
vehicle class. They 'extend' vehicle but they are not 'owned by it' or
'born from it'. Parent/child is not an inheritance relationship - it's
an association relationship. Anyone who uses the world 'child' in an
inheritance context probably skipped the first lecture of their OO 1.0.1
course and stayed at the bar.

So let's pretend to ignore that word 'child' is used in this way in
wicket and move to the next philosophical issue: Is the extent/child tag
'the' inheritance relationship or is it just the mechanism that allows
us to take advantage of inheritance in the markup domain (for the first
time in any framework I've seen - which is why I like wicket so much)
and allows a derived class' markup to provide markup to fill a gap
specified in the base class' markup. I believe that in wicket the
'extend/child' tag is the latter.

It's really just like a virtual method in a class definition. You're
declaring some aspect within the base class for which no implementation
is provided in that base class but which must be provided in some class
that extends that base class. We do this all the time in OO - and we are
allowed to provide multiple instances of these in any class, not just
one instance per class, and we therefore give each instance a different
name. The implementation is provided in a subclass by a method that has
a matching name. This is how true and more powerful markup inheritance
could work in wicket. Naming would only be necessary in situations where
more than one markup chuck needs to be 'overridden' or provided in a
subclass.

Sure some of this could be done by creating extra Panel components but
sometimes I just have some markup that is common to only a portion of my
hierarchy. It seems fudgy to have to create new Panel components to
achieve what can be achieved at a markup level quite quickly and easily
and with less code and less classes.

 3) Instead of relying on the idea of child tags.. Just add more panels
 or other components that fit your need.  You have to break out of the
OO
 mindset a bit, but there's a lot of potential once you think outside
the
 bun.

I've aborted the adoption of all other Java UI frameworks I've ever
found because they forced me to break out of the OO mindset. I came to
wicket, and I'm guessing many other OOers have also because it, more
than any other UI framework, let's me keep my OO mindset that has been
the source of all my successes and the production of robust, high
quality, maintainable solutions for my clients over the last 15 years.

-
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


[Wicket-user] Multiple wicket:child tags in the same page

2007-05-18 Thread Chris Colman
 It is not possible in wicket...
 You can have at most one wicket:child tag per page...
 This is because Java does not support multiple inheritance...
 This question has been posted on the mailing list earlier. Give a
search
 to find out more about this subject.

I don't believe that this is an issue that requires a multiple
inheritance.

I see individual wicket:child sections as more like abstract/(virtual)
methods whose implementation is not provided in the base class but it is
provided in a derived class. Now Java supports multiple abstract methods
in a class without a problem. All that is needed is a way to name the
individual wicket:child sections so that wicket knows which bits in
the derived markup are providing the implementations via wicket:extend
(which could refer to the child section they are 'overriding'. 

-
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


Re: [Wicket-user] Multiple wicket:child tags in the same page

2007-05-18 Thread Charlie Dobbie
As Alex says, wicket:child tags can't solve this because that's not
the way they're intended to be used.

There are various ways to solve the problem, though: you could place
the common content into a Panel, have a method on the base page return
this panel, and then include it as normal on your child pages; or
restructure your child pages so the before and after content
exists in panels, have two abstract methods on the base page that
return these panels, then the base page can obtain and add the content
itself.

I expect you could do something with fragments as well, but I haven't
looked into them!

Charlie.



On 5/18/07, Chris Colman [EMAIL PROTECTED] wrote:
 Let's say I have a page which can be almost completely marked up in a
 base class markup. There are only two sections of the page that change
 in the derived pages/classes. Is it possible to use the wicket:child
 tag twice in
 the one page and then have two wicket:extend tags in the derived
 pages?

 Markup for base page:

 body
 div id=master

 span wicket:id=organizationHeader/

 div id=bodywrap

 wicket:child
 /wicket:child

 pThe stuff in here is common to all
 pages and so I only want to define it once in this base page markup/p

 wicket:child
 /wicket:child

   span wicket:id=organizationFooter/

 /div

 /div
 /body

 Markup for the derived page:

 body
 wicket:extend
 div id=maincol
 span wicket:id=welcomePanel/
 /div
 /wicket:extend

 This text is ignored - only the extend parts will be
 used

 wicket:extend
 h1Hi there!/h1
 /wicket:extend
 /body

 I've tried this and I get the following error message:

 WicketMessage: The component [MarkupContainer [Component id = _child,
 page = com.sas.av.ui.wicket.HomePage, path =
 4:_body:_child.MarkupInheritanceResolver$TransparentWebMarkupContainer
 , isVisible = true, isVersioned = true]] has the same wicket:id as
 another component already added at the same level

 Root cause:

 wicket.markup.MarkupException: The component [MarkupContainer [Component
 id = _child, page = com.sas.av.ui.wicket.HomePage, path =
 4:_body:_child.MarkupInheritanceResolver$TransparentWebMarkupContainer
 , isVisible = true, isVersioned = true]] has the same wicket:id as
 another component already added at the same level
 at wicket.Page.componentRendered(Page.java:936)
 at wicket.Component.rendered(Component.java:1755)
 at wicket.Component.render(Component.java:1534)
 at wicket.MarkupContainer.renderNext(MarkupContainer.java:1334)
 at
 wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982)
 at wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:917)

 -
 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


[Wicket-user] Multiple wicket:child tags in the same page

2007-05-18 Thread Chris Colman
 As Alex says, wicket:child tags can't solve this because that's not
 the way they're intended to be used.

I can't see why wicket could not be easily enhanced to support multiple
overridden child sections. Just like the astract methods of a class -
there is no limit on the number of them: a class can have any number
abstract methods and they can be overridden by any derived class - not
just immediate descendents and they don't have to all be overridden in
the same class - just so long as an implementation is provided somewhere
in the inheritance hierarchy for any concrete class.

In wicket the wicket:child is just a placeholder for content that will
be implemented/provided in a derived class. It just seems strange that
the number of possible placeholders, n, was arbitrarily set to n = 1 in
the architecture.

Having only 1 alleviates the need to identify the placeholder in a
derived class but that is the only reason I can see why the maximum
number of placeholders should have been limited to just 1.

I can see many uses for providing implementations of different child
sections at different levels of the hierarchy. You could have navigation
column, main column and footer being child sections. With a deep
hierarchy you could provide 'extend' sections that provide the content
for the child sections at various points in the hierarchy. You might
provide footer markup via one common base class and then in classes that
extend that class provide different navigation and main column markup
but they all share a common footer. Another class might provide a
different footer and have other classes extending it that provide
different navigation and main column markup.

For backwards compatibility with the current system you could say that
if there is only one child section then no label is required but if you
choose to add more than one child section then you must label them (just
like providing an abstract method signature).

-
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


Re: [Wicket-user] Multiple wicket:child tags in the same page

2007-05-18 Thread Alex Objelean

You should read wicket:child tag  as extends keyword... This way wicket
works. Why are you looking for different solution when there are many more
which works great?


Chris Colman wrote:
 
 As Alex says, wicket:child tags can't solve this because that's not
 the way they're intended to be used.
 
 I can't see why wicket could not be easily enhanced to support multiple
 overridden child sections. Just like the astract methods of a class -
 there is no limit on the number of them: a class can have any number
 abstract methods and they can be overridden by any derived class - not
 just immediate descendents and they don't have to all be overridden in
 the same class - just so long as an implementation is provided somewhere
 in the inheritance hierarchy for any concrete class.
 
 In wicket the wicket:child is just a placeholder for content that will
 be implemented/provided in a derived class. It just seems strange that
 the number of possible placeholders, n, was arbitrarily set to n = 1 in
 the architecture.
 
 Having only 1 alleviates the need to identify the placeholder in a
 derived class but that is the only reason I can see why the maximum
 number of placeholders should have been limited to just 1.
 
 I can see many uses for providing implementations of different child
 sections at different levels of the hierarchy. You could have navigation
 column, main column and footer being child sections. With a deep
 hierarchy you could provide 'extend' sections that provide the content
 for the child sections at various points in the hierarchy. You might
 provide footer markup via one common base class and then in classes that
 extend that class provide different navigation and main column markup
 but they all share a common footer. Another class might provide a
 different footer and have other classes extending it that provide
 different navigation and main column markup.
 
 For backwards compatibility with the current system you could say that
 if there is only one child section then no label is required but if you
 choose to add more than one child section then you must label them (just
 like providing an abstract method signature).
 
 -
 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
 
 

-- 
View this message in context: 
http://www.nabble.com/Multiple-wicket%3Achild-tags-in-the-same-page-tf3775143.html#a10682394
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


[Wicket-user] Multiple wicket:child tags in the same page

2007-05-18 Thread Chris Colman
 You should read wicket:child tag  as extends keyword... 
 This way wicket works.

I would like to read wicket:child as the 'abstract' keyword - then,
like abstract methods, I'm telling wicket that an implementation will be
provided for this 'placeholder' in a markup that extends this markup
and, like abstract methods, I can have more than one of them per markup.

The 'extends' part is already declared by the hierarchy of my Java
classes. I have inheritance (extends) in my page class hierarchy
regardless of whether or not I choose to use the wicket:extend keyword
- which is much more akin to declaring deferred method implementation
(overloading) than class extension (although obviously it requires the
class to be extended for overloading to work).

 Why are you looking for different solution when there are many more
 which works great?

I use panels extensively but I wish to be able to use my extensive page
class hierarchy to cleverly dictate which panels get loaded by the
different classes in various places in the page class hierarchy.

-
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


Re: [Wicket-user] Multiple wicket:child tags in the same page

2007-05-18 Thread John Krasnay
This question does come up quite a bit on the list, though. I admit
thinking the same thing when I was coming to grips with Wicket not so
long ago. I think the problem is not that markup extension is hard to
understand, but rather that it's very intuitive, so much so that new
Wicket users want to use it to solve related problems.

jk

On Fri, May 18, 2007 at 06:37:11AM -0700, Alex Objelean wrote:
 
 You should read wicket:child tag  as extends keyword... This way wicket
 works. Why are you looking for different solution when there are many more
 which works great?
 
 
 Chris Colman wrote:
  
  As Alex says, wicket:child tags can't solve this because that's not
  the way they're intended to be used.
  
  I can't see why wicket could not be easily enhanced to support multiple
  overridden child sections. Just like the astract methods of a class -
  there is no limit on the number of them: a class can have any number
  abstract methods and they can be overridden by any derived class - not
  just immediate descendents and they don't have to all be overridden in
  the same class - just so long as an implementation is provided somewhere
  in the inheritance hierarchy for any concrete class.
  
  In wicket the wicket:child is just a placeholder for content that will
  be implemented/provided in a derived class. It just seems strange that
  the number of possible placeholders, n, was arbitrarily set to n = 1 in
  the architecture.
  
  Having only 1 alleviates the need to identify the placeholder in a
  derived class but that is the only reason I can see why the maximum
  number of placeholders should have been limited to just 1.
  
  I can see many uses for providing implementations of different child
  sections at different levels of the hierarchy. You could have navigation
  column, main column and footer being child sections. With a deep
  hierarchy you could provide 'extend' sections that provide the content
  for the child sections at various points in the hierarchy. You might
  provide footer markup via one common base class and then in classes that
  extend that class provide different navigation and main column markup
  but they all share a common footer. Another class might provide a
  different footer and have other classes extending it that provide
  different navigation and main column markup.
  
  For backwards compatibility with the current system you could say that
  if there is only one child section then no label is required but if you
  choose to add more than one child section then you must label them (just
  like providing an abstract method signature).
  
  -
  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
  
  
 
 -- 
 View this message in context: 
 http://www.nabble.com/Multiple-wicket%3Achild-tags-in-the-same-page-tf3775143.html#a10682394
 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

-
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


Re: [Wicket-user] Multiple wicket:child tags in the same page

2007-05-18 Thread Aaron Hiniker

Why not something like this?

public abstract class MyContainerPage extends WebPage
{
   public MyContainerPage()
   {
  add( getHeaderPanel( header ) );
  add( getLeftMenuPanel( left-menu ) );
   }

   public abstract WebMarkupContainer getLeftMenuPanel( String id );
   public abstract WebMarkupContainer getHeaderPanel( String id );
}


body
 div wicket:id=header/div
 div wicket:id=left-menu/div
/body


Aaron


Chris Colman wrote:
You should read wicket:child tag  as extends keyword... 
This way wicket works.



I would like to read wicket:child as the 'abstract' keyword - then,
like abstract methods, I'm telling wicket that an implementation will be
provided for this 'placeholder' in a markup that extends this markup
and, like abstract methods, I can have more than one of them per markup.

The 'extends' part is already declared by the hierarchy of my Java
classes. I have inheritance (extends) in my page class hierarchy
regardless of whether or not I choose to use the wicket:extend keyword
- which is much more akin to declaring deferred method implementation
(overloading) than class extension (although obviously it requires the
class to be extended for overloading to work).

  

Why are you looking for different solution when there are many more
which works great?



I use panels extensively but I wish to be able to use my extensive page
class hierarchy to cleverly dictate which panels get loaded by the
different classes in various places in the page class hierarchy.

-
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


Re: [Wicket-user] Multiple wicket:child tags in the same page

2007-05-18 Thread Igor Vaynberg

as others have stated, wicket:extend and wicket:child are used to work in
conjunction with class heiararchies. so since you only have one superclass
you only have one wicket:child.

however, none of the stuff that implements this uses any private api. you
can create your own markup filters and class resolvers and tags that work
the way you want. if it works out great we can include it into core if you
want to donate.

-igor


On 5/17/07, Chris Colman [EMAIL PROTECTED] wrote:


Let's say I have a page which can be almost completely marked up in a
base class markup. There are only two sections of the page that change
in the derived pages/classes. Is it possible to use the wicket:child
tag twice in
the one page and then have two wicket:extend tags in the derived
pages?

Markup for base page:

body
div id=master

span wicket:id=organizationHeader/

div id=bodywrap

wicket:child
/wicket:child

pThe stuff in here is common to all
pages and so I only want to define it once in this base page markup/p

wicket:child
/wicket:child

  span wicket:id=organizationFooter/

/div

/div
/body

Markup for the derived page:

body
wicket:extend
div id=maincol
span wicket:id=welcomePanel/
/div
/wicket:extend

This text is ignored - only the extend parts will be
used

wicket:extend
h1Hi there!/h1
/wicket:extend
/body

I've tried this and I get the following error message:

WicketMessage: The component [MarkupContainer [Component id = _child,
page = com.sas.av.ui.wicket.HomePage, path =
4:_body:_child.MarkupInheritanceResolver$TransparentWebMarkupContainer
, isVisible = true, isVersioned = true]] has the same wicket:id as
another component already added at the same level

Root cause:

wicket.markup.MarkupException: The component [MarkupContainer [Component
id = _child, page = com.sas.av.ui.wicket.HomePage, path =
4:_body:_child.MarkupInheritanceResolver$TransparentWebMarkupContainer
, isVisible = true, isVersioned = true]] has the same wicket:id as
another component already added at the same level
at wicket.Page.componentRendered(Page.java:936)
at wicket.Component.rendered(Component.java:1755)
at wicket.Component.render(Component.java:1534)
at wicket.MarkupContainer.renderNext(MarkupContainer.java:1334)
at
wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982)
at wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:917)

-
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


Re: [Wicket-user] Multiple wicket:child tags in the same page

2007-05-18 Thread C. Bergström
Igor Vaynberg wrote:


 On 5/17/07, Chris Colman [EMAIL PROTECTED] wrote:

 Let's say I have a page which can be almost completely marked up in a
 base class markup. There are only two sections of the page that change
 in the derived pages/classes. Is it possible to use the wicket:child
 tag twice in
 the one page and then have two wicket:extend tags in the derived
 pages?

 Markup for base page:

 body
 div id=master

 span wicket:id=organizationHeader/

 div id=bodywrap

 wicket:child
 /wicket:child

 pThe stuff in here is common to all
 pages and so I only want to define it once in this base page markup/p

 wicket:child
 /wicket:child

   span wicket:id=organizationFooter/

 /div

 /div
 /body

 Markup for the derived page:

 body
 wicket:extend
 div id=maincol
 span wicket:id=welcomePanel/
 /div
 /wicket:extend

 This text is ignored - only the extend parts will be
 used

 wicket:extend
 h1Hi there!/h1
 /wicket:extend
 /body

 I've tried this and I get the following error message:

 WicketMessage: The component [MarkupContainer [Component id = _child,
 page = com.sas.av.ui.wicket.HomePage, path =
 4:_body:_child.MarkupInheritanceResolver$TransparentWebMarkupContainer
 , isVisible = true, isVersioned = true]] has the same wicket:id as
 another component already added at the same level

 Root cause:

 wicket.markup.MarkupException: The component [MarkupContainer [Component
 id = _child, page = com.sas.av.ui.wicket.HomePage, path =
 4:_body:_child.MarkupInheritanceResolver$TransparentWebMarkupContainer
 , isVisible = true, isVersioned = true]] has the same wicket:id as
 another component already added at the same level
 at wicket.Page.componentRendered(Page.java:936)
 at wicket.Component.rendered(Component.java:1755)
 at wicket.Component.render(Component.java:1534)
 at wicket.MarkupContainer.renderNext(MarkupContainer.java:1334)
 at
 wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982)
 at wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:917)

 as others have stated, wicket:extend and wicket:child are used to work in
 conjunction with class heiararchies. so since you only have one
 superclass
 you only have one wicket:child.

 however, none of the stuff that implements this uses any private api. you
 can create your own markup filters and class resolvers and tags that work
 the way you want. if it works out great we can include it into core if
 you
 want to donate.

 -igor

This extend  child thing really didn't seem to be intuitive at all. 
However, once I completely removed it things became more clear.

1) It has no id tag.. So w/o asking or rtfm you're not going to know
what's going on
2) Wouldn't naming the hierarchy parent  child be more logical? In
english.. extend + child have no relation...
3) Instead of relying on the idea of child tags.. Just add more panels
or other components that fit your need.  You have to break out of the OO
mindset a bit, but there's a lot of potential once you think outside the
bun.

I'm still learning and exploring.. So if I'm way off track just ignore me :)

Cheers,

./C

-
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


Re: [Wicket-user] Multiple wicket:child tags in the same page

2007-05-18 Thread Johan Compagner

if you want multiply sections use panels..

html
div wicket:id=above
div wicket:id=leftwicket:child/div wicket:id=right
div wicket:id=below
/html

and one child can have its own body with different left righ below above
panels what ever you want.

what would that mean that you have multiply childs?
then we have to name them because you have to target them which one you want
but that we are pretty much back at panels

johan




On 5/18/07, Chris Colman [EMAIL PROTECTED] wrote:


 As Alex says, wicket:child tags can't solve this because that's not
 the way they're intended to be used.

I can't see why wicket could not be easily enhanced to support multiple
overridden child sections. Just like the astract methods of a class -
there is no limit on the number of them: a class can have any number
abstract methods and they can be overridden by any derived class - not
just immediate descendents and they don't have to all be overridden in
the same class - just so long as an implementation is provided somewhere
in the inheritance hierarchy for any concrete class.

In wicket the wicket:child is just a placeholder for content that will
be implemented/provided in a derived class. It just seems strange that
the number of possible placeholders, n, was arbitrarily set to n = 1 in
the architecture.

Having only 1 alleviates the need to identify the placeholder in a
derived class but that is the only reason I can see why the maximum
number of placeholders should have been limited to just 1.

I can see many uses for providing implementations of different child
sections at different levels of the hierarchy. You could have navigation
column, main column and footer being child sections. With a deep
hierarchy you could provide 'extend' sections that provide the content
for the child sections at various points in the hierarchy. You might
provide footer markup via one common base class and then in classes that
extend that class provide different navigation and main column markup
but they all share a common footer. Another class might provide a
different footer and have other classes extending it that provide
different navigation and main column markup.

For backwards compatibility with the current system you could say that
if there is only one child section then no label is required but if you
choose to add more than one child section then you must label them (just
like providing an abstract method signature).

-
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


[Wicket-user] Multiple wicket:child tags in the same page

2007-05-17 Thread Chris Colman
Let's say I have a page which can be almost completely marked up in a
base class markup. There are only two sections of the page that change
in the derived pages/classes. Is it possible to use the wicket:child
tag twice in 
the one page and then have two wicket:extend tags in the derived
pages?

Markup for base page:

body
div id=master

span wicket:id=organizationHeader/

div id=bodywrap

wicket:child
/wicket:child

pThe stuff in here is common to all
pages and so I only want to define it once in this base page markup/p

wicket:child
/wicket:child

  span wicket:id=organizationFooter/

/div

/div
/body

Markup for the derived page:

body
wicket:extend
div id=maincol
span wicket:id=welcomePanel/
/div
/wicket:extend

This text is ignored - only the extend parts will be
used

wicket:extend
h1Hi there!/h1
/wicket:extend
/body

I've tried this and I get the following error message:

WicketMessage: The component [MarkupContainer [Component id = _child,
page = com.sas.av.ui.wicket.HomePage, path =
4:_body:_child.MarkupInheritanceResolver$TransparentWebMarkupContainer
, isVisible = true, isVersioned = true]] has the same wicket:id as
another component already added at the same level

Root cause:

wicket.markup.MarkupException: The component [MarkupContainer [Component
id = _child, page = com.sas.av.ui.wicket.HomePage, path =
4:_body:_child.MarkupInheritanceResolver$TransparentWebMarkupContainer
, isVisible = true, isVersioned = true]] has the same wicket:id as
another component already added at the same level
at wicket.Page.componentRendered(Page.java:936)
at wicket.Component.rendered(Component.java:1755)
at wicket.Component.render(Component.java:1534)
at wicket.MarkupContainer.renderNext(MarkupContainer.java:1334)
at
wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982)
at wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:917)

-
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