You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Farrukh SATTOROV <fi...@gmail.com> on 2014/02/14 19:34:41 UTC

understanding looking for wicket:id

Hi everyone. I confused when i look to standard wicket heloworld example
and try understanding  snippet of <span wicket:id="mainNavigation"/>. How
HelloWorld.html works without <extend></extend> while id mainNavigation
located in superclass (WicketExamplePage). Explain to me mechanism of
looking for wicket:id in this case.

Re: understanding looking for wicket:id

Posted by Farrukh SATTOROV <fi...@gmail.com>.
Thanks, now, i make myself a cup of green tea and i going to learn user
guide in detail )


On Sat, Feb 15, 2014 at 7:20 PM, Paul Bors <pa...@bors.ws> wrote:

> Also take a look over the user guide's section on inheritance:
> http://wicket.apache.org/guide/guide/layout.html#layout_2
>
> ~ Thank you,
>    Paul Bors
>
>
> On Fri, Feb 14, 2014 at 3:42 PM, Richter, Marvin <
> Marvin.Richter@jestadigital.com> wrote:
>
> > That is definitely not a good way to do inheritance. This way you force
> > everyone who extends from MyBasePage to know that he has to have a tag in
> > his markup file with a wicket:id he might not know.
> >
> > The right way would be to have a markup file for MyBasePage.java and
> > include the <wicket:extend> tag.
> >
> > MyBasePage.html
> > <html>
> > <body>
> >         <span wicket:id="panel"/>
> >         <wicket:extend></wicket:extend>
> > </body>
> > </html>
> >
> > This way every page which extends MyBasePage.java inherits the panel and
> > the components you add in the subclasses will be placed in the place
> where
> > you defined <wicket:extend>
> >
> > Best,
> > Marvin
> >
> > Am 14.02.2014 um 20:04 schrieb Farrukh SATTOROV <fi...@gmail.com>:
> >
> > > my code work, if by definition each WebPage and Panel must have own
> > markup
> > > ?
> > >
> > > MyBasePage.java:
> > > public class MyBasePage extends WebPage {
> > >
> > > public MyBasePage() {
> > > add(new MyPanel("panel"));
> > > }
> > > }
> > >
> > > no MyBasePage.html, i remove it.
> > >
> > > SubPage.java:
> > > public class SubPage extends MyBasePage {
> > > public SubPage() {
> > > }
> > >
> > > }
> > >
> > > SubPage.html:
> > > <html>
> > > <body>
> > > <span wicket:id="panel"/>
> > > </body>
> > > </html>
> > >
> > > MyPanel.html
> > > <body>
> > > <wicket:panel>
> > > <span>MyPanel</span>
> > > </wicket:panel>
> > > </body>
> > >
> > >
> > > On Fri, Feb 14, 2014 at 10:56 PM, Sven Meier <sv...@meiers.net> wrote:
> > >
> > >> With a wicket:id declared in Html markup, a corresponding component
> with
> > >> the same id has to present as child.
> > >>
> > >> It doesn't matter when the child component is added: in the
> constructor
> > or
> > >> one of its super constructors (or even later).
> > >> This does not have anything to do with markup inheritance.
> > >>
> > >> Hope this helps
> > >> Sven
> > >>
> > >>
> > >> On 02/14/2014 07:34 PM, Farrukh SATTOROV wrote:
> > >>
> > >>> Hi everyone. I confused when i look to standard wicket heloworld
> > example
> > >>> and try understanding  snippet of <span wicket:id="mainNavigation"/>.
> > How
> > >>> HelloWorld.html works without <extend></extend> while id
> mainNavigation
> > >>> located in superclass (WicketExamplePage). Explain to me mechanism of
> > >>> looking for wicket:id in this case.
> > >>>
> > >>>
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >> For additional commands, e-mail: users-help@wicket.apache.org
> > >>
> > >>
> > >
> > >
> > > --
> > > С уважением и наилучшими пожеланиями
> > > *Фаррух*
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>



-- 
Regards, Farrukh

Re: understanding looking for wicket:id

Posted by Paul Bors <pa...@bors.ws>.
Also take a look over the user guide's section on inheritance:
http://wicket.apache.org/guide/guide/layout.html#layout_2

~ Thank you,
   Paul Bors


On Fri, Feb 14, 2014 at 3:42 PM, Richter, Marvin <
Marvin.Richter@jestadigital.com> wrote:

> That is definitely not a good way to do inheritance. This way you force
> everyone who extends from MyBasePage to know that he has to have a tag in
> his markup file with a wicket:id he might not know.
>
> The right way would be to have a markup file for MyBasePage.java and
> include the <wicket:extend> tag.
>
> MyBasePage.html
> <html>
> <body>
>         <span wicket:id="panel"/>
>         <wicket:extend></wicket:extend>
> </body>
> </html>
>
> This way every page which extends MyBasePage.java inherits the panel and
> the components you add in the subclasses will be placed in the place where
> you defined <wicket:extend>
>
> Best,
> Marvin
>
> Am 14.02.2014 um 20:04 schrieb Farrukh SATTOROV <fi...@gmail.com>:
>
> > my code work, if by definition each WebPage and Panel must have own
> markup
> > ?
> >
> > MyBasePage.java:
> > public class MyBasePage extends WebPage {
> >
> > public MyBasePage() {
> > add(new MyPanel("panel"));
> > }
> > }
> >
> > no MyBasePage.html, i remove it.
> >
> > SubPage.java:
> > public class SubPage extends MyBasePage {
> > public SubPage() {
> > }
> >
> > }
> >
> > SubPage.html:
> > <html>
> > <body>
> > <span wicket:id="panel"/>
> > </body>
> > </html>
> >
> > MyPanel.html
> > <body>
> > <wicket:panel>
> > <span>MyPanel</span>
> > </wicket:panel>
> > </body>
> >
> >
> > On Fri, Feb 14, 2014 at 10:56 PM, Sven Meier <sv...@meiers.net> wrote:
> >
> >> With a wicket:id declared in Html markup, a corresponding component with
> >> the same id has to present as child.
> >>
> >> It doesn't matter when the child component is added: in the constructor
> or
> >> one of its super constructors (or even later).
> >> This does not have anything to do with markup inheritance.
> >>
> >> Hope this helps
> >> Sven
> >>
> >>
> >> On 02/14/2014 07:34 PM, Farrukh SATTOROV wrote:
> >>
> >>> Hi everyone. I confused when i look to standard wicket heloworld
> example
> >>> and try understanding  snippet of <span wicket:id="mainNavigation"/>.
> How
> >>> HelloWorld.html works without <extend></extend> while id mainNavigation
> >>> located in superclass (WicketExamplePage). Explain to me mechanism of
> >>> looking for wicket:id in this case.
> >>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> >
> > --
> > С уважением и наилучшими пожеланиями
> > *Фаррух*
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: understanding looking for wicket:id

Posted by "Richter, Marvin" <Ma...@jestadigital.com>.
That is definitely not a good way to do inheritance. This way you force everyone who extends from MyBasePage to know that he has to have a tag in his markup file with a wicket:id he might not know.

The right way would be to have a markup file for MyBasePage.java and include the <wicket:extend> tag.

MyBasePage.html
<html>
<body>
	<span wicket:id="panel“/>
	<wicket:extend></wicket:extend>
</body>
</html>

This way every page which extends MyBasePage.java inherits the panel and the components you add in the subclasses will be placed in the place where you defined <wicket:extend>

Best,
Marvin

Am 14.02.2014 um 20:04 schrieb Farrukh SATTOROV <fi...@gmail.com>:

> my code work, if by definition each WebPage and Panel must have own markup
> ?
> 
> MyBasePage.java:
> public class MyBasePage extends WebPage {
> 
> public MyBasePage() {
> add(new MyPanel("panel"));
> }
> }
> 
> no MyBasePage.html, i remove it.
> 
> SubPage.java:
> public class SubPage extends MyBasePage {
> public SubPage() {
> }
> 
> }
> 
> SubPage.html:
> <html>
> <body>
> <span wicket:id="panel"/>
> </body>
> </html>
> 
> MyPanel.html
> <body>
> <wicket:panel>
> <span>MyPanel</span>
> </wicket:panel>
> </body>
> 
> 
> On Fri, Feb 14, 2014 at 10:56 PM, Sven Meier <sv...@meiers.net> wrote:
> 
>> With a wicket:id declared in Html markup, a corresponding component with
>> the same id has to present as child.
>> 
>> It doesn't matter when the child component is added: in the constructor or
>> one of its super constructors (or even later).
>> This does not have anything to do with markup inheritance.
>> 
>> Hope this helps
>> Sven
>> 
>> 
>> On 02/14/2014 07:34 PM, Farrukh SATTOROV wrote:
>> 
>>> Hi everyone. I confused when i look to standard wicket heloworld example
>>> and try understanding  snippet of <span wicket:id="mainNavigation"/>. How
>>> HelloWorld.html works without <extend></extend> while id mainNavigation
>>> located in superclass (WicketExamplePage). Explain to me mechanism of
>>> looking for wicket:id in this case.
>>> 
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>> 
>> 
> 
> 
> -- 
> С уважением и наилучшими пожеланиями
> *Фаррух*


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: understanding looking for wicket:id

Posted by Farrukh SATTOROV <fi...@gmail.com>.
my code work, if by definition each WebPage and Panel must have own markup
?

MyBasePage.java:
public class MyBasePage extends WebPage {

public MyBasePage() {
add(new MyPanel("panel"));
}
}

no MyBasePage.html, i remove it.

SubPage.java:
public class SubPage extends MyBasePage {
 public SubPage() {
}

}

SubPage.html:
<html>
<body>
<span wicket:id="panel"/>
</body>
</html>

MyPanel.html
<body>
<wicket:panel>
<span>MyPanel</span>
</wicket:panel>
</body>


On Fri, Feb 14, 2014 at 10:56 PM, Sven Meier <sv...@meiers.net> wrote:

> With a wicket:id declared in Html markup, a corresponding component with
> the same id has to present as child.
>
> It doesn't matter when the child component is added: in the constructor or
> one of its super constructors (or even later).
> This does not have anything to do with markup inheritance.
>
> Hope this helps
> Sven
>
>
> On 02/14/2014 07:34 PM, Farrukh SATTOROV wrote:
>
>> Hi everyone. I confused when i look to standard wicket heloworld example
>> and try understanding  snippet of <span wicket:id="mainNavigation"/>. How
>> HelloWorld.html works without <extend></extend> while id mainNavigation
>> located in superclass (WicketExamplePage). Explain to me mechanism of
>> looking for wicket:id in this case.
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
С уважением и наилучшими пожеланиями
*Фаррух*

Re: understanding looking for wicket:id

Posted by Sven Meier <sv...@meiers.net>.
With a wicket:id declared in Html markup, a corresponding component with 
the same id has to present as child.

It doesn't matter when the child component is added: in the constructor 
or one of its super constructors (or even later).
This does not have anything to do with markup inheritance.

Hope this helps
Sven

On 02/14/2014 07:34 PM, Farrukh SATTOROV wrote:
> Hi everyone. I confused when i look to standard wicket heloworld example
> and try understanding  snippet of <span wicket:id="mainNavigation"/>. How
> HelloWorld.html works without <extend></extend> while id mainNavigation
> located in superclass (WicketExamplePage). Explain to me mechanism of
> looking for wicket:id in this case.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org