You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "marioosh.net" <ma...@gmail.com> on 2010/02/16 15:06:59 UTC
Problem with simple layout using Border.
I have problem with Border. When i open Lesson2 page, i get nothing.
System.out.println(mb); show: [MarkupContainer [Component id = border]].
Anybody help? Sources below.
MainBorder.java:
public class MainBorder extends Border {
public MainBorder(String id) {
super(id);
add(new AjaxLink("lesson0"){
@Override
public void onClick(AjaxRequestTarget target) {
setResponsePage(Lesson0.class);
}
});
add(new AjaxLink("lesson1"){
@Override
public void onClick(AjaxRequestTarget target) {
setResponsePage(Lesson1.class);
}
});
}
}
MainBorder.html:
<wicket:border>
<div style="background-color: silver; padding: 5px;">
<a href="#" wicket:id="lesson0">Lesson1</a> |
<a href="#" wicket:id="lesson1">Lesson2</a> |
</div>
<wicket:body/>
</wicket:border>
BasePage.java:
public class BasePage extends WebPage {
protected MainBorder mb;
public BasePage() {
mb = new MainBorder("border");
add(mb);
}
}
BasePage.html:
[empty]
Lesson2.java:
public class Lesson2 extends BasePage {
public Lesson2() {
System.out.println(mb);
mb.add(add(new Label("label","content...")));
}
}
Lesson2.html:
<div wicket:id="border">
<span wicket:id="label">content</span>
</div>
--
Greeting,
marioosh
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Problem with simple layout using Border.
Posted by "marioosh.net" <ma...@gmail.com>.
2010/2/16 Igor Vaynberg <ig...@gmail.com>:
> mb.add(add(new Label("label","content...")));
>
> why are there two adds there?
>
> -igor
>
Thanks:) That it!
--
Greetings,
marioosh
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Problem with simple layout using Border.
Posted by Igor Vaynberg <ig...@gmail.com>.
mb.add(add(new Label("label","content...")));
why are there two adds there?
-igor
On Tue, Feb 16, 2010 at 6:06 AM, marioosh.net <ma...@gmail.com> wrote:
> I have problem with Border. When i open Lesson2 page, i get nothing.
> System.out.println(mb); show: [MarkupContainer [Component id = border]].
> Anybody help? Sources below.
>
> MainBorder.java:
> public class MainBorder extends Border {
> public MainBorder(String id) {
> super(id);
> add(new AjaxLink("lesson0"){
> @Override
> public void onClick(AjaxRequestTarget target) {
> setResponsePage(Lesson0.class);
> }
>
> });
> add(new AjaxLink("lesson1"){
> @Override
> public void onClick(AjaxRequestTarget target) {
> setResponsePage(Lesson1.class);
> }
> });
> }
> }
>
> MainBorder.html:
> <wicket:border>
> <div style="background-color: silver; padding: 5px;">
> <a href="#" wicket:id="lesson0">Lesson1</a> |
> <a href="#" wicket:id="lesson1">Lesson2</a> |
> </div>
> <wicket:body/>
> </wicket:border>
>
> BasePage.java:
> public class BasePage extends WebPage {
> protected MainBorder mb;
> public BasePage() {
> mb = new MainBorder("border");
> add(mb);
> }
> }
>
> BasePage.html:
> [empty]
>
> Lesson2.java:
> public class Lesson2 extends BasePage {
> public Lesson2() {
> System.out.println(mb);
> mb.add(add(new Label("label","content...")));
> }
> }
>
> Lesson2.html:
> <div wicket:id="border">
> <span wicket:id="label">content</span>
> </div>
>
> --
> Greeting,
> marioosh
>
> ---------------------------------------------------------------------
> 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