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="label">aaa</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

Reply via email to