you have to add it to the listItem
listItem.add(new ListView("rows....
instead of just
add(new ListView("rows...
ryantxu wrote:
>
> Hello-
>
> I'm struggling with how to nest repeaters - a list within a list. I
> have a data structure that returns a List of Lists. My Panel.java code
> looks like:
>
> add(new ListView("fields", new FacetFieldsModel( rsp ) )
> {
> @Override
> public void populateItem(final ListItem listItem)
> {
> final FacetField field = (FacetField)listItem.getModelObject();
> listItem.add(new Label("name", new PropertyModel( field, "name" ) ));
>
> add(new ListView("rows", field.getValues() ) {
> @Override
> protected void populateItem(ListItem item) {
> Count cnt = (Count)item.getModelObject();
> item.add( new Label( "row", cnt.toString() ) );
> }
> });
> }
> });
>
> the markup looks like:
>
> <wicket:panel>
>
> <div wicket:id="fields" >
> <h3></h3>
>
>
> <br/>
>
>
> </div>
>
> </wicket:panel>
>
> This gives the error:
> java.lang.IllegalArgumentException: A child with id 'rows' already exists:
> [MarkupContainer [Component id = fields, page = wicket.solr.QueryPage,
> path = 0:facets:fields.FacetsPanel$1, isVisible = true, isVersioned =
> false]]
>
> I feel like I'm missing something basic. Thanks for any pointers!
>
> ryan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
-----
Michael Sparer
http://talk-on-tech.blogspot.com
--
View this message in context:
http://www.nabble.com/nesting-repeaters----A-child-with-id-%27rows%27-already-exists-tp14602993p14603027.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]