Hi Jonathan,

Thanks for the suggestions. I've corrected my typo and added the label to "myLink" as you suggested but got this time the error:

java.lang.IllegalArgumentException: A child with id 'row' already exists: ...

Could you please demonstrate your suggestions with code?

Thanks in advance.

F.

----- Original Message ----- From: "Jonathan Locke" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, July 28, 2005 01:02
Subject: Re: [Wicket-user] NestedLint example



nesting of tags is strict.  you must add label to myLink, not row.
also, you typoed wicket as wicket.

Francis Amanfo wrote:

Hi,

Still struggling to get this work. I'm pasting part of the source in here.

Nested.html
==========

<html xmlns:wicket>
<wicket:panel>
 <ul>
   <span wicket:id="rows">
     <li wicket:id="row">
       <a wicked:id="myLink">
         <span wicket:id="label">the label</span>
       </a>
     </li>
     <span wicket:id="nested"/>
   </span>
 </ul>
</wicket:panel>
</html>

The populateItem method in NestedList.java
===============================
protected void populateItem(ListItem listItem)
       {
           Object modelObject = listItem.getModelObject();

           if(modelObject instanceof List)
           {
               // create a panel that renders the sub lis
NestedList nested = new NestedList("nested", (List)modelObject);
               listItem.add(nested);
// if the current element is a list, we create a dummy row/ label element // as we have to confirm to our HTML definition, and set it's visibility // property to false as we do not want LI tags to be rendered.
               WebMarkupContainer row = new WebMarkupContainer("row");
               row.setVisible(false);
               row.add(new WebMarkupContainer("label"));

               listItem.add(row);
           }
           else
           {
// if the current element is not a list, we create a dummy panel element // to confirm to our HTML definition, and set this panel's visibility
               // property to false to avoid having the UL tag rendered
               NestedList nested = new NestedList("nested", null);
               nested.setVisible(false);
               listItem.add(nested);
// add the row (with the LI element attached, and the label with the
               // row's actual value to display
               WebMarkupContainer row = new WebMarkupContainer("row");
ExternalLink el = new ExternalLink("myLink", "http://www.google.com";, "Click this link to go to Google");
               el.add(new Label("label", modelObject.toString()));
               row.add(el);
               listItem.add(row);
           }
       }

I get the error:
wicket.markup.MarkupException: Unable to find component with id 'label' in [MarkupContainer ...

Any suggestion as to what I'm doing wrong?

Thanks.

F






----- Original Message ----- From: "Igor Vaynberg" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, July 27, 2005 19:29
Subject: RE: [Wicket-user] NestedLint example


<UL>
    <li><a href="www.javalobby.org">Click here</a></li>
    ...
<UL>


Also looks like

<a wicked:id="myLink">
   <li wicket:id="row"
        <span wicket:id="label">the label</span>
    </li>
</a>


Needs to be

<li wicket:id="row">
<a wicked:id="myLink">
<span wicket:id="label">the label</span>
</a>
</li>

This also means the label component "label" needs to be added to the link
component instead of listview item

Igor




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user






-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user






-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to