You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Rich Livingstone <na...@bananasoft.net> on 2007/10/16 01:39:58 UTC

WicketMessage: Expected close tag for '' Possible attempt to embed component(s) '' in the body of this component which discards its body

I'm getting this error WicketMessage: Expected close tag for '<tr
wicket:id="sorting">' Possible attempt to embed component(s) '' in the body
of this component which discards its body 

when I'm actually running something which is near as dammit borrowed from
the wicketstuff sorted page example. The full text of the generated HTML is
included in the error (see below) and my code is fairly simple and as far as
I can see, identical to the example (well, clearly it isn't but I can't see
the problem anyway). Anyone with sharper eyes than me or am i doing
something invalid full stop ?

I've read the other posts on this error and they are all embedding invalid
tags inside others - but my code is straight from an example so how come it
barfs ?

My sorting table view:

// the iterator definitely returns a booking here (the code is part of a
bookings system)
        BookingsDataProvider bp = new BookingsDataProvider(bookings);

       	final DataView dataView = new DataView("sorting", bp)
               {
            protected void populateItem(final Item item)
            {
                Booking booking = (Booking)item.getModelObject();
                
                BookingEntryModel bem = new BookingEntryModel();

                // in correct formats now
                try {
// initialises fields in correct formats etc
                	bem.updateDisplayFromBooking(booking);
                }
                catch (Exception e)  {
            	}
                
                item.add(new ActionPanel("actions", item.getModel()));

			    item.add(new Label("bookingid", bem.getCurrentBooking())); 

      		item.add(new
Label("bookingStartRun",DateUtil.format(bem.getBookingStartRun(),DatePattern.s_datetimedisplay)));
      		item.add(new
Label("bookingEndRun",DateUtil.format(bem.getBookingEndRun(),DatePattern.s_datetimedisplay)));


            item.add(new Label("campaign", bem.getCampaign())); 
            item.add(new Label("status", bem.getStatus()));
            add(new Label("programProfile", bem.getProgramProfile()));
            add(new Label("weightingProfile", bem.getWeightingProfile()));

        
                item.add(new AttributeModifier("class", true, new
AbstractReadOnlyModel()
                {
                    public Object getObject()
                    {
                        return (item.getIndex() % 2 == 1) ? "even" : "odd";
                    }
                }));
            }
        };

The HTML according to the error message:

<html xmlns:wicket="http://wicket.apache.org/">
<head>
    <title>Perception Panel Bookings</title>
<!--    <link rel="stylesheet" type="text/css" href="style.css"/>-->
</head>
<body>

    
    <h2>Create/Amend/Delete Bookings</h2>


Selected Booking: [selected booking]
<br/>
Feedback messages go here
<wicket:child><wicket:extend>
    
<br/><br/>

[dataview navigator]
<table cellspacing="0" class="dataview">
    <tr>
        <th>Actions</th>
        <th>Booking Id</th>
        <th wicket:id="bookingStartRun">Start Time</th>
        <th>End Time</th>
        <th>Campaign</th>
        <th>Status</th>
        <th>Program Profile</th>
        <th>Weighting Profile</th>
    </tr>
    <tr wicket:id="sorting">
        <td>[actions]</td>
        <td>[bookingid] </td>
        <td>[bookingStartRun]</td>
        <td>[bookingEndRun]</td>
        <td>[campaign]</td>
        <td>[status]</td>
        <td>[programProfile]</td>
        <td>[weightingProfile]</td>
</tr>
          <tr>
          <td colspan="2">
              <input value="Add Booking" type="submit"
wicket:id="newButton"/>
          </td>
          </tr>
</table>

</wicket:extend></wicket:child>

</body>
</html>
-- 
View this message in context: http://www.nabble.com/WicketMessage%3A-Expected-close-tag-for-%27%3Ctr-wicket%3Aid%3D%22sorting%22%3E%27-Possible-attempt-to-embed-component%28s%29-%27%3Cspan-wicket%3Aid%3D%22actions%22%3E%27-in-the-body-of-this-component-which-discards-its-body-tf4631132.html#a13224261
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: WicketMessage: Expected close tag for '' Possible attempt to embed component(s) '' in the body of this component which discards its body

Posted by Rich Livingstone <na...@bananasoft.net>.
Ok, all working - the bug was as expected, user error.

add(new Label("programProfile", bem.getProgramProfile()));
add(new Label("weightingProfile", bem.getWeightingProfile()));


should've been

item.add(new Label("programProfile", bem.getProgramProfile()));
item.add(new Label("weightingProfile", bem.getWeightingProfile()));

Shows that staring at too much code at 2 am isn't good for you - much better
to go & dig over your veg patch and come back to the problem :-)

-- 
View this message in context: http://www.nabble.com/WicketMessage%3A-Expected-close-tag-for-%27%3Ctr-wicket%3Aid%3D%22sorting%22%3E%27-Possible-attempt-to-embed-component%28s%29-%27%3Cspan-wicket%3Aid%3D%22actions%22%3E%27-in-the-body-of-this-component-which-discards-its-body-tf4631132.html#a13233215
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: WicketMessage: Expected close tag for '' Possible attempt to embed component(s) '' in the body of this component which discards its body

Posted by Rich Livingstone <na...@bananasoft.net>.
I should add that I'm using Wicket 1.3 whereas the examples were all 1.2 -
though in this area it seems that nothing substantial has changed
-- 
View this message in context: http://www.nabble.com/WicketMessage%3A-Expected-close-tag-for-%27%3Ctr-wicket%3Aid%3D%22sorting%22%3E%27-Possible-attempt-to-embed-component%28s%29-%27%3Cspan-wicket%3Aid%3D%22actions%22%3E%27-in-the-body-of-this-component-which-discards-its-body-tf4631132.html#a13224667
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: WicketMessage: Expected close tag for '' Possible attempt to embed component(s) '' in the body of this component which discards its body

Posted by Rich Livingstone <na...@bananasoft.net>.
Thanks for the reply, Igor - I probably didn't explain myself well, the HTML
I listed in my post was part of the error message thrown by Wicket and not
my source code. In my source HTML I had this (read span for spanx, if I put
in span it doesn't show up in the post !!):

[dataview navigator]
<table cellspacing="0" class="dataview">
    <tr>
        <th>Actions</th>
        <th>Booking Id</th>
        <th wicket:id="bookingStartRun">Start Time</th>
        <th>End Time</th>
        <th>Campaign</th>
        <th>Status</th>
        <th>Program Profile</th>
        <th>Weighting Profile</th>
	</tr>
    <tr wicket:id="sorting">
        <td><spanX wicket:id="actions">[actions]</td>
        <td><spanX wicket:id="bookingid">[bookingid] </td>
        <td><spanX wicket:id="bookingStartRun">[bookingStartRun]</td>
        <td><spanX wicket:id="bookingEndRun">[bookingEndRun]</td>
        <td><spanX wicket:id="campaign">[campaign]</td>
        <td><spanX wicket:id="status">[status]</td>
        <td><spanX wicket:id="programProfile">[programProfile]</td>
        <td><spanX wicket:id="weightingProfile">[weightingProfile]</td>
</tr>
</table>


and just in case I've also tried this:


[dataview navigator]
<table cellspacing="0" class="dataview">
    <tr>
        <th>Actions</th>
        <th>Booking Id</th>
        <th wicket:id="bookingStartRun">Start Time</th>
        <th>End Time</th>
        <th>Campaign</th>
        <th>Status</th>
        <th>Program Profile</th>
        <th>Weighting Profile</th>
	</tr>
    <tr wicket:id="sorting">
        <td wicket:id="actions">[actions]</td>
        <td wicket:id="bookingid">[bookingid] </td>
        <td wicket:id="bookingStartRun">[bookingStartRun]</td>
        <td wicket:id="bookingEndRun">[bookingEndRun]</td>
        <td wicket:id="campaign">[campaign]</td>
        <td wicket:id="status">[status]</td>
        <td wicket:id="programProfile">[programProfile]</td>
        <td wicket:id="weightingProfile">[weightingProfile]</td>
</tr>
</table>

They both give the error I stated. It is lifted more or less entirely from
the Wicketstuff SortedGrid example so I'm not clear on what I'm doing wrong,
unless it is an incompatibility with Wicket 1.3 ?
-- 
View this message in context: http://www.nabble.com/WicketMessage%3A-Expected-close-tag-for-%27%3Ctr-wicket%3Aid%3D%22sorting%22%3E%27-Possible-attempt-to-embed-component%28s%29-%27%3Cspan-wicket%3Aid%3D%22actions%22%3E%27-in-the-body-of-this-component-which-discards-its-body-tf4631132.html#a13228299
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: WicketMessage: Expected close tag for '' Possible attempt to embed component(s) '' in the body of this component which discards its body

Posted by Igor Vaynberg <ig...@gmail.com>.
you are missing wicket:ids in the second set of tds...

 <tr wicket:id="sorting">
       <td>[actions]</td>

should actually be <td wicket:id="actions">[actions]</td> :)

-igor

On 10/15/07, Rich Livingstone <na...@bananasoft.net> wrote:
>
>
> I'm getting this error WicketMessage: Expected close tag for '<tr
> wicket:id="sorting">' Possible attempt to embed component(s) '' in the
> body
> of this component which discards its body
>
> when I'm actually running something which is near as dammit borrowed from
> the wicketstuff sorted page example. The full text of the generated HTML
> is
> included in the error (see below) and my code is fairly simple and as far
> as
> I can see, identical to the example (well, clearly it isn't but I can't
> see
> the problem anyway). Anyone with sharper eyes than me or am i doing
> something invalid full stop ?
>
> I've read the other posts on this error and they are all embedding invalid
> tags inside others - but my code is straight from an example so how come
> it
> barfs ?
>
> My sorting table view:
>
> // the iterator definitely returns a booking here (the code is part of a
> bookings system)
>         BookingsDataProvider bp = new BookingsDataProvider(bookings);
>
>         final DataView dataView = new DataView("sorting", bp)
>                {
>             protected void populateItem(final Item item)
>             {
>                 Booking booking = (Booking)item.getModelObject();
>
>                 BookingEntryModel bem = new BookingEntryModel();
>
>                 // in correct formats now
>                 try {
> // initialises fields in correct formats etc
>                         bem.updateDisplayFromBooking(booking);
>                 }
>                 catch (Exception e)  {
>                 }
>
>                 item.add(new ActionPanel("actions", item.getModel()));
>
>                             item.add(new Label("bookingid",
> bem.getCurrentBooking()));
>
>                 item.add(new
> Label("bookingStartRun",DateUtil.format(bem.getBookingStartRun(),
> DatePattern.s_datetimedisplay)));
>                 item.add(new
> Label("bookingEndRun",DateUtil.format(bem.getBookingEndRun(),
> DatePattern.s_datetimedisplay)));
>
>
>             item.add(new Label("campaign", bem.getCampaign()));
>             item.add(new Label("status", bem.getStatus()));
>             add(new Label("programProfile", bem.getProgramProfile()));
>             add(new Label("weightingProfile", bem.getWeightingProfile()));
>
>
>                 item.add(new AttributeModifier("class", true, new
> AbstractReadOnlyModel()
>                 {
>                     public Object getObject()
>                     {
>                         return (item.getIndex() % 2 == 1) ? "even" :
> "odd";
>                     }
>                 }));
>             }
>         };
>
> The HTML according to the error message:
>
> <html xmlns:wicket="http://wicket.apache.org/">
> <head>
>     <title>Perception Panel Bookings</title>
> <!--    <link rel="stylesheet" type="text/css" href="style.css"/>-->
> </head>
> <body>
>
>
>     <h2>Create/Amend/Delete Bookings</h2>
>
>
> Selected Booking: [selected booking]
> <br/>
> Feedback messages go here
> <wicket:child><wicket:extend>
>
> <br/><br/>
>
> [dataview navigator]
> <table cellspacing="0" class="dataview">
>     <tr>
>         <th>Actions</th>
>         <th>Booking Id</th>
>         <th wicket:id="bookingStartRun">Start Time</th>
>         <th>End Time</th>
>         <th>Campaign</th>
>         <th>Status</th>
>         <th>Program Profile</th>
>         <th>Weighting Profile</th>
>     </tr>
>     <tr wicket:id="sorting">
>         <td>[actions]</td>
>         <td>[bookingid] </td>
>         <td>[bookingStartRun]</td>
>         <td>[bookingEndRun]</td>
>         <td>[campaign]</td>
>         <td>[status]</td>
>         <td>[programProfile]</td>
>         <td>[weightingProfile]</td>
> </tr>
>           <tr>
>           <td colspan="2">
>               <input value="Add Booking" type="submit"
> wicket:id="newButton"/>
>           </td>
>           </tr>
> </table>
>
> </wicket:extend></wicket:child>
>
> </body>
> </html>
> --
> View this message in context:
> http://www.nabble.com/WicketMessage%3A-Expected-close-tag-for-%27%3Ctr-wicket%3Aid%3D%22sorting%22%3E%27-Possible-attempt-to-embed-component%28s%29-%27%3Cspan-wicket%3Aid%3D%22actions%22%3E%27-in-the-body-of-this-component-which-discards-its-body-tf4631132.html#a13224261
> 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
>
>