You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Frank Bille <fr...@apache.org> on 2008/01/03 19:57:00 UTC

Re: nesting repeaters? A child with id 'rows' already exists

add(new ListView("rows", field.getValues() ) {

=

listItem.add(new ListView("rows", field.getValues() ) {

On Jan 3, 2008 7:44 PM, Ryan McKinley <ry...@gmail.com> 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><span wicket:id="name" /></h3>
>
>     <span wicket:id="rows">
>       <span wicket:id="row" /><br/>
>     </span>
>
>   </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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: nesting repeaters? A child with id 'rows' already exists

Posted by Ryan McKinley <ry...@gmail.com>.
dooh!  Thank you!


Frank Bille wrote:
> add(new ListView("rows", field.getValues() ) {
> 
> =
> 
> listItem.add(new ListView("rows", field.getValues() ) {
> 
> On Jan 3, 2008 7:44 PM, Ryan McKinley <ry...@gmail.com> 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><span wicket:id="name" /></h3>
>>
>>     <span wicket:id="rows">
>>       <span wicket:id="row" /><br/>
>>     </span>
>>
>>   </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: 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