tags
Posted by Ryan Holmes <ry...@hyperstep.com>.
The label doesn't need to be at the same level as the form, just
inside the form. Wicket doesn't care about non-wicket HTML elements
between the form and the label. From Wicket's point of view, your
label component is a direct child of the form.
Maybe I'm missing something obvious here, but your code and HTML
hierarchies look to be in sync. Review basic things like: are you
sure the code you posted is what's actually running in your web server?
-Ryan
On Sep 10, 2007, at 12:09 AM, Kevin Liu wrote:
> Thank you for your help! But the major problem is The Label Is Not
> at the same level as the form , the Label is deep inside those
> table tags. Is there any solution to this kind of problem.
> Thanks again~
> Kevin Liu <mr...@yahoo.com> wrote: I have a html page that
> displays "welcome ,XXX" ,or something like that, the "XXX" is the
> current user name, and I use Label to display it. But there is an
> exception when it runs.
>
> Unable to find component with id 'userName' in [MarkupContainer
> [Component id = _relative_path_prefix_14, page =
> com.cmip.web.pages.TopFrame, path =
> 3:topForm:_relative_path_prefix_13:_relative_path_prefix_14.WebMarkupC
> ontainer, isVisible = true, isVersioned = true]]. This means that
> you declared wicket:id=userName in your markup, but that you either
> did not add the component to your page at all, or that the
> hierarchy does not match.
>
>
> The code:
> public TopFrame(){
> super();
> String name = ((CMIPSession)this.getSession()).getUser().getUserName
> ();
> Label userName = new Label("userName",new Model(name));
> Form topForm = new Form("topForm");
> topForm.add(userName);
> this.add(topForm);
>
>
> html:
>
>
>
>
>
>
>
>
>
>
> °æ±¾ºÅ£ºV1.0
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> ¡¡ Welcome
>
>
>
>
>
>
>
>
> updateTime();
>
>
>
>
>
> -Kevin Liu
>
> ---------------------------------
> Pinpoint customers who are looking for what you sell.
>
>
> -Kevin Liu
>
> ---------------------------------
> Pinpoint customers who are looking for what you sell.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How to handle these nested
tags
Posted by Kevin Liu <j2...@yahoo.com>.
Thank you for your help! But the major problem is The Label Is Not at the same level as the form , the Label is deep inside those table tags. Is there any solution to this kind of problem.
Thanks again~
Kevin Liu <mr...@yahoo.com> wrote: I have a html page that displays "welcome ,XXX" ,or something like that, the "XXX" is the current user name, and I use Label to display it. But there is an exception when it runs.
Unable to find component with id 'userName' in [MarkupContainer [Component id = _relative_path_prefix_14, page = com.cmip.web.pages.TopFrame, path = 3:topForm:_relative_path_prefix_13:_relative_path_prefix_14.WebMarkupContainer, isVisible = true, isVersioned = true]]. This means that you declared wicket:id=userName in your markup, but that you either did not add the component to your page at all, or that the hierarchy does not match.
The code:
public TopFrame(){
super();
String name = ((CMIPSession)this.getSession()).getUser().getUserName();
Label userName = new Label("userName",new Model(name));
Form topForm = new Form("topForm");
topForm.add(userName);
this.add(topForm);
html:
°æ±¾ºÅ£ºV1.0
¡¡ Welcome
updateTime();
-Kevin Liu
---------------------------------
Pinpoint customers who are looking for what you sell.
-Kevin Liu
---------------------------------
Pinpoint customers who are looking for what you sell.