You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Kevin Liu <mr...@yahoo.com> on 2007/09/10 06:58:41 UTC

How to handle these nested tags
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:
   
  <body style="padding: 0px 0px 0px 0px;margin: 0px 0px 0px 0px;">
  <form wicket:id="topForm">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td width="485"><img src="images/logo_top.gif" width="485" height="85"></td>
    <td background="images/bg_top.gif">&nbsp;</td>
    <td width="260" align="right" background="images/bg_top.gif">
<table width="242" height="80" border="0" cellpadding="5" cellspacing="0">
        <tr valign="top"> 
<td colspan="2" align="right" class="whiteText">°æ±¾ºÅ£ºV1.0</td>
        </tr>
        <tr align="center"> 
            <td height="37"><a href="Main.html" target="mainframe"><img src="images/button_desktop.gif" width="112" height="27" border="0" alt="·µ»ØÖ÷Ò³" onClick="javascript:self.location='Top.html'"></a></td>
          <td><a href="../public/Logout.html" target="mainframe"><img src="images/button_logout.gif" width="112" height="27" border="0"></a></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
  
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="485" height="1"><img src="images/spacer.gif" width="1" height="1"></td>
  </tr>
  <tr bgcolor="#38E089"> 
    <td height="4"><img src="images/spacer.gif" width="4" height="4"></td>
  </tr>
  <tr> 
    <td height="1"><img src="images/spacer.gif" width="1" height="1"></td>
  </tr>
  <tr background="images/bg_3D_bar.gif"> 
    <td height="28" background="images/bg_3D_bar.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="140" align="center" class="whiteText"><span id="serverTime"> </span></td>
          <td width="2"><img src="images/pic_shr.gif" width="2" height="23"></td>
          <td><table width="316" border="0" cellspacing="0" cellpadding="1">
              <tr> 
                <td width="28">&nbsp;</td>
                <td width="284" align="center" class="welcomeBox">
        ¡¡  Welcome <label wicket:id="userName"></label>
                </td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
 <script language="javascript">
           updateTime();
    </script>
</form>
</body>


-Kevin Liu
       
---------------------------------
Pinpoint customers who are looking for what you sell. 

Re: How to handle these nested

tagsPosted by Igor Vaynberg <ig...@gmail.com>.
if he would post a quickstart we would be able to do more.

-igor

On 9/10/07, Ryan Holmes <ry...@hyperstep.com> wrote:
>
> No, LABEL is a valid HTML element for a Label component (it would be
> pretty twisted if it wasn't ;)). Besides, if a tag check was failing,
> the error message would say so.
>
> But keep the guesses coming. That's all I've been able to for Kevin
> so far...
>
> -Ryan
>
> On Sep 10, 2007, at 12:00 AM, Roland Huss wrote:
>
> >
> > Hi,
> >
> >>                 <td width="284" align="center" class="welcomeBox">
> >>         ¡¡  Welcome <label wicket:id="userName"></label>
> >
> > Could it be, that <label> is not supported as markup for a Label
> > component
> > and that you should use something like  instead ?
> >
> > ... roland
> >
> > --
> > View this message in context: http://www.nabble.com/How-to-handle-
> > these-nested-%3Ctable%3E-tags-tf4412208.html#a12587601
> > Sent from the Wicket - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > 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: How to handle these nested

tagsPosted by Ryan Holmes <ry...@hyperstep.com>.
No, LABEL is a valid HTML element for a Label component (it would be  
pretty twisted if it wasn't ;)). Besides, if a tag check was failing,  
the error message would say so.

But keep the guesses coming. That's all I've been able to for Kevin  
so far...

-Ryan

On Sep 10, 2007, at 12:00 AM, Roland Huss wrote:

>
> Hi,
>
>>                 <td width="284" align="center" class="welcomeBox">
>>         ¡¡  Welcome <label wicket:id="userName"></label>
>
> Could it be, that <label> is not supported as markup for a Label  
> component
> and that you should use something like  instead ?
>
> ... roland
>
> -- 
> View this message in context: http://www.nabble.com/How-to-handle- 
> these-nested-%3Ctable%3E-tags-tf4412208.html#a12587601
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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: How to handle these nested

tagsPosted by Roland Huss <na...@tichny.org>.
Hi,

>                 <td width="284" align="center" class="welcomeBox">
>         ¡¡  Welcome <label wicket:id="userName"></label>

Could it be, that <label> is not supported as markup for a Label component
and that you should use something like  instead ?

... roland

-- 
View this message in context: http://www.nabble.com/How-to-handle-these-nested-%3Ctable%3E-tags-tf4412208.html#a12587601
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
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

tagsPosted by Ryan Holmes <ry...@hyperstep.com>.
hmmm... the hierarchies seem to match. The only weird things I see  
are that your img tags are unclosed (Wicket may require valid xml  
templates -- I'm not sure because I always use xhtml) and your call  
to add the topForm component uses an explicit "this" reference. I  
can't remember if "this" with a method call does nothing or if it can  
actually interfere with dynamic binding. Either way, you don't want  
to do it. Just call "add(topForm)".

If neither of those suggestions work (and I kind of doubt they will),  
think about whether your page's superclass might be causing the  
problem. For instance, a weird markup inheritance scenario could  
conceivably cause this.

-Ryan

On Sep 9, 2007, at 9:58 PM, Kevin Liu 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:
>
>   <body style="padding: 0px 0px 0px 0px;margin: 0px 0px 0px 0px;">
>   <form wicket:id="topForm">
>   <table width="100%" border="0" cellspacing="0" cellpadding="0">
>   <tr>
>     <td width="485"><img src="images/logo_top.gif" width="485"  
> height="85"></td>
>     <td background="images/bg_top.gif">&nbsp;</td>
>     <td width="260" align="right" background="images/bg_top.gif">
> <table width="242" height="80" border="0" cellpadding="5"  
> cellspacing="0">
>         <tr valign="top">
> <td colspan="2" align="right" class="whiteText">°æ±¾ºÅ£ºV1.0</td>
>         </tr>
>         <tr align="center">
>             <td height="37"><a href="Main.html"  
> target="mainframe"><img src="images/button_desktop.gif" width="112"  
> height="27" border="0" alt="·µ»ØÖ÷Ò³"  
> onClick="javascript:self.location='Top.html'"></a></td>
>           <td><a href="../public/Logout.html"  
> target="mainframe"><img src="images/button_logout.gif" width="112"  
> height="27" border="0"></a></td>
>         </tr>
>       </table>
>     </td>
>   </tr>
> </table>
>
> <table width="100%" border="0" cellpadding="0" cellspacing="0">
>   <tr>
>     <td width="485" height="1"><img src="images/spacer.gif"  
> width="1" height="1"></td>
>   </tr>
>   <tr bgcolor="#38E089">
>     <td height="4"><img src="images/spacer.gif" width="4"  
> height="4"></td>
>   </tr>
>   <tr>
>     <td height="1"><img src="images/spacer.gif" width="1"  
> height="1"></td>
>   </tr>
>   <tr background="images/bg_3D_bar.gif">
>     <td height="28" background="images/bg_3D_bar.gif"><table  
> width="100%" border="0" cellspacing="0" cellpadding="0">
>         <tr>
>           <td width="140" align="center" class="whiteText"><span  
> id="serverTime"> </span></td>
>           <td width="2"><img src="images/pic_shr.gif" width="2"  
> height="23"></td>
>           <td><table width="316" border="0" cellspacing="0"  
> cellpadding="1">
>               <tr>
>                 <td width="28">&nbsp;</td>
>                 <td width="284" align="center" class="welcomeBox">
>         ¡¡  Welcome <label wicket:id="userName"></label>
>                 </td>
>               </tr>
>             </table></td>
>         </tr>
>       </table></td>
>   </tr>
> </table>
>  <script language="javascript">
>            updateTime();
>     </script>
> </form>
> </body>
>
>
> -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

tagsPosted by Igor Vaynberg <ig...@gmail.com>.
this is already fixed in trunk

-igor


On 9/10/07, Kent Tong <ke...@cpttm.org.mo> wrote:
>
>
>
> Kevin Liu-4 wrote:
> >
> >   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.
> >
>
> Please file a bug report at http://issues.apache.org/jira/browse/WICKET.
> The
> bug is,
> RelativePathPrefixHandler creates auto-components but are not marking them
> as
> transparent resolver:
>
>         public boolean resolve(MarkupContainer container, MarkupStream
> markupStream, ComponentTag tag)
>         {
>                 if (WICKET_RELATIVE_PATH_PREFIX_CONTAINER_ID.equals(
> tag.getId()))
>                 {
>                         final Component wc;
>                         String id =
> WICKET_RELATIVE_PATH_PREFIX_CONTAINER_ID +
>                                         container.getPage
> ().getAutoIndex();
>                         if (tag.isOpenClose())
>                         {
>                                 wc = new WebComponent(id);
>                         }
>                         else
>                         {
>                                 //problem:
>                                 wc = new WebMarkupContainer(id);
>                                 //I think it should be:
>                                 //wc = new
> TransparentWebMarkupContainer(id);
>                         }
>                         container.autoAdd(wc, markupStream);
>                         return true;
>                 }
>                 return false;
>         }
>
>
> --
> View this message in context:
> http://www.nabble.com/How-to-handle-these-nested-%3Ctable%3E-tags-tf4412208.html#a12595047
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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

tagsPosted by Kent Tong <ke...@cpttm.org.mo>.

Kevin Liu-4 wrote:
> 
>   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.
> 

Please file a bug report at http://issues.apache.org/jira/browse/WICKET. The
bug is, 
RelativePathPrefixHandler creates auto-components but are not marking them
as
transparent resolver:

	public boolean resolve(MarkupContainer container, MarkupStream
markupStream, ComponentTag tag)
	{
		if (WICKET_RELATIVE_PATH_PREFIX_CONTAINER_ID.equals(tag.getId()))
		{
			final Component wc;
			String id = WICKET_RELATIVE_PATH_PREFIX_CONTAINER_ID +
					container.getPage().getAutoIndex();
			if (tag.isOpenClose())
			{
				wc = new WebComponent(id);
			}
			else
			{
				//problem:
				wc = new WebMarkupContainer(id);
				//I think it should be:
				//wc = new TransparentWebMarkupContainer(id);
			}
			container.autoAdd(wc, markupStream);
			return true;
		}
		return false;
	}


-- 
View this message in context: http://www.nabble.com/How-to-handle-these-nested-%3Ctable%3E-tags-tf4412208.html#a12595047
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
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

tagsPosted 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

tagsPosted 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.