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>
>>
>>                                 <p>The 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>
>>                     <h1>Hi 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to