You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Jered Myers <je...@maplewoodsoftware.com> on 2011/11/14 21:39:52 UTC

Duplicate Markup Ids

I am getting components with duplicate markup ids in my label 
components.  What can cause this to happen?

I am letting Wicket set the markup ids.  Only one user is setup in a 
manner that creates the problem, so in general there is not a 
duplication problem.  As I understand it the markup id number is coming 
from the Session's nextSequenceValue method, so I don't see how it could 
be duplicated.  The components are getting built by multiple instances 
of the same class and added into the same array.  Here is an example 
reduced down to the basic parts:

Several classes build the MyDisplayRow objects and add them to the same 
ArrayList...
for (DataRow data : myData)
{
   MyDisplayRow row = new MyDisplayRow();
   row.setLabelComponent(new Label("headerLabel", data.getTextColumnData());
   getMyRowArrayList().add(row);
}

...
ListView<MyDispayRow> repeater = new ListView<MyDisplayRow>("repeater", 
myRowArrrayListModel)
{
  protected void populateItem(ListItem<MyDisplayRow> item)
  {
     // Here is where I see the duplicate markup ids
     log.debug(item.getModelObject().getLabelComponent().getMarkupId());
     item.add(item.getModelObject().getLabelComponent());
  }
}

-- 
Jered Myers


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Duplicate Markup Ids

Posted by Jered Myers <je...@maplewoodsoftware.com>.
The actual object I am working with is more complex than my code 
example.  There was a merge row function that was merging rows 
together.  The merge had a bug where it was merging the row and, in some 
scenarios, creating a new row at the same time.  This meant that both 
the merged row and the extra row had the same component.  It was blowing 
up because I was adding the same component to different rows in the 
repeater.  Doh!

On 11/14/2011 06:52 PM, Jeremy Thomerson wrote:
> Curious, what was it?
>
> PS - Sent from a tablet. Please excuse typos, spelling and compiler errors.
>
> -- Jeremy Thomerson http://wickettraining.com Need a CMS for Wicket? 
> Use Brix! http://brixcms.org On Nov 14, 2011 7:18 PM, "Jered Myers" 
> <je...@maplewoodsoftware.com> wrote:
>> >  I found the problem.  It was not a Wicket bug as expected.  Thanks for
>> >  taking the time to look at this anyway.
>> >
>> >  On 11/14/2011 03:36 PM, Jered Myers wrote:
>> >
>>> >>  I forgot to post Wicket version 1.4.18
>>> >>
>>> >>  On 11/14/2011 02:07 PM, Jered Myers wrote:
>>> >>
>>>> >>>  The HTML markup is always<span wicket:id="headerLabel"></**span>, so I
>>>> >>>  think the answer is no.  I end up with a markup id like "headerLabel8f".
>>>> >>>
>>>> >>>  On 11/14/2011 12:54 PM, Sven Meier wrote:
>>>> >>>
>>>>> >>>>  Do you have markup ids pre-defined in your html markup?
>>>>> >>>>
>>>>> >>>>  Sven
>>>>> >>>>
>>>>> >>>>  On 11/14/2011 09:39 PM, Jered Myers wrote:
>>>>> >>>>
>>>>>> >>>>>  I am getting components with duplicate markup ids in my label
>>>>>> >>>>>  components.  What can cause this to happen?
>>>>>> >>>>>
>>>>>> >>>>>  I am letting Wicket set the markup ids.  Only one user is setup in a
>>>>>> >>>>>  manner that creates the problem, so in general there is not a duplication
>>>>>> >>>>>  problem.  As I understand it the markup id number is coming from the
>>>>>> >>>>>  Session's nextSequenceValue method, so I don't see how it could be
>>>>>> >>>>>  duplicated.  The components are getting built by multiple instances of the
>>>>>> >>>>>  same class and added into the same array.  Here is an example reduced down
>>>>>> >>>>>  to the basic parts:
>>>>>> >>>>>
>>>>>> >>>>>  Several classes build the MyDisplayRow objects and add them to the
>>>>>> >>>>>  same ArrayList...
>>>>>> >>>>>  for (DataRow data : myData)
>>>>>> >>>>>  {
>>>>>> >>>>>    MyDisplayRow row = new MyDisplayRow();
>>>>>> >>>>>    row.setLabelComponent(new Label("headerLabel",
>>>>>> >>>>>  data.getTextColumnData());
>>>>>> >>>>>    getMyRowArrayList().add(row);
>>>>>> >>>>>  }
>>>>>> >>>>>
>>>>>> >>>>>  ...
>>>>>> >>>>>  ListView<MyDispayRow>  repeater = new ListView<MyDisplayRow>("**repeater",
>>>>>> >>>>>  myRowArrrayListModel)
>>>>>> >>>>>  {
>>>>>> >>>>>    protected void populateItem(ListItem<**MyDisplayRow>  item)
>>>>>> >>>>>    {
>>>>>> >>>>>      // Here is where I see the duplicate markup ids
>>>>>> >>>>>      log.debug(item.getModelObject(**).getLabelComponent().**
>>>>>> >>>>>  getMarkupId());
>>>>>> >>>>>      item.add(item.getModelObject()**.getLabelComponent());
>>>>>> >>>>>    }
>>>>>> >>>>>  }
>>>>>> >>>>>
>>>>>> >>>>>
>>>>> >>>>
>>>>> >>>>  ------------------------------**------------------------------**
>>>>> >>>>  ---------
>>>>> >>>>  To unsubscribe, e-mail:users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
>>>>> >>>>  For additional commands, e-mail:users-help@wicket.apache.org
>>>>> >>>>
>>>>> >>>>
>>>> >>>  ------------------------------**------------------------------**
>>>> >>>  ---------
>>>> >>>  To unsubscribe, e-mail:users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
>>>> >>>  For additional commands, e-mail:users-help@wicket.apache.org
>>>> >>>
>>>> >>>
>>> >>  ------------------------------**------------------------------**---------
>>> >>  To unsubscribe, e-mail:users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
>>> >>  For additional commands, e-mail:users-help@wicket.apache.org
>>> >>
>>> >>
>> >  ------------------------------**------------------------------**---------
>> >  To unsubscribe, e-mail:users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
>> >  For additional commands, e-mail:users-help@wicket.apache.org
>> >
>> >

Re: Duplicate Markup Ids

Posted by Jeremy Thomerson <je...@wickettraining.com>.
Curious, what was it?

PS - Sent from a tablet. Please excuse typos, spelling and compiler errors.

-- 
Jeremy Thomerson
http://wickettraining.com
Need a CMS for Wicket?  Use Brix! http://brixcms.org
On Nov 14, 2011 7:18 PM, "Jered Myers" <je...@maplewoodsoftware.com> wrote:

> I found the problem.  It was not a Wicket bug as expected.  Thanks for
> taking the time to look at this anyway.
>
> On 11/14/2011 03:36 PM, Jered Myers wrote:
>
>> I forgot to post Wicket version 1.4.18
>>
>> On 11/14/2011 02:07 PM, Jered Myers wrote:
>>
>>> The HTML markup is always <span wicket:id="headerLabel"></**span>, so I
>>> think the answer is no.  I end up with a markup id like "headerLabel8f".
>>>
>>> On 11/14/2011 12:54 PM, Sven Meier wrote:
>>>
>>>> Do you have markup ids pre-defined in your html markup?
>>>>
>>>> Sven
>>>>
>>>> On 11/14/2011 09:39 PM, Jered Myers wrote:
>>>>
>>>>> I am getting components with duplicate markup ids in my label
>>>>> components.  What can cause this to happen?
>>>>>
>>>>> I am letting Wicket set the markup ids.  Only one user is setup in a
>>>>> manner that creates the problem, so in general there is not a duplication
>>>>> problem.  As I understand it the markup id number is coming from the
>>>>> Session's nextSequenceValue method, so I don't see how it could be
>>>>> duplicated.  The components are getting built by multiple instances of the
>>>>> same class and added into the same array.  Here is an example reduced down
>>>>> to the basic parts:
>>>>>
>>>>> Several classes build the MyDisplayRow objects and add them to the
>>>>> same ArrayList...
>>>>> for (DataRow data : myData)
>>>>> {
>>>>>  MyDisplayRow row = new MyDisplayRow();
>>>>>  row.setLabelComponent(new Label("headerLabel",
>>>>> data.getTextColumnData());
>>>>>  getMyRowArrayList().add(row);
>>>>> }
>>>>>
>>>>> ...
>>>>> ListView<MyDispayRow> repeater = new ListView<MyDisplayRow>("**repeater",
>>>>> myRowArrrayListModel)
>>>>> {
>>>>>  protected void populateItem(ListItem<**MyDisplayRow> item)
>>>>>  {
>>>>>    // Here is where I see the duplicate markup ids
>>>>>    log.debug(item.getModelObject(**).getLabelComponent().**
>>>>> getMarkupId());
>>>>>    item.add(item.getModelObject()**.getLabelComponent());
>>>>>  }
>>>>> }
>>>>>
>>>>>
>>>>
>>>> ------------------------------**------------------------------**
>>>> ---------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>> ------------------------------**------------------------------**
>>> ---------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Duplicate Markup Ids

Posted by Jered Myers <je...@maplewoodsoftware.com>.
I found the problem.  It was not a Wicket bug as expected.  Thanks for 
taking the time to look at this anyway.

On 11/14/2011 03:36 PM, Jered Myers wrote:
> I forgot to post Wicket version 1.4.18
>
> On 11/14/2011 02:07 PM, Jered Myers wrote:
>> The HTML markup is always <span wicket:id="headerLabel"></span>, so I 
>> think the answer is no.  I end up with a markup id like "headerLabel8f".
>>
>> On 11/14/2011 12:54 PM, Sven Meier wrote:
>>> Do you have markup ids pre-defined in your html markup?
>>>
>>> Sven
>>>
>>> On 11/14/2011 09:39 PM, Jered Myers wrote:
>>>> I am getting components with duplicate markup ids in my label 
>>>> components.  What can cause this to happen?
>>>>
>>>> I am letting Wicket set the markup ids.  Only one user is setup in 
>>>> a manner that creates the problem, so in general there is not a 
>>>> duplication problem.  As I understand it the markup id number is 
>>>> coming from the Session's nextSequenceValue method, so I don't see 
>>>> how it could be duplicated.  The components are getting built by 
>>>> multiple instances of the same class and added into the same 
>>>> array.  Here is an example reduced down to the basic parts:
>>>>
>>>> Several classes build the MyDisplayRow objects and add them to the 
>>>> same ArrayList...
>>>> for (DataRow data : myData)
>>>> {
>>>>   MyDisplayRow row = new MyDisplayRow();
>>>>   row.setLabelComponent(new Label("headerLabel", 
>>>> data.getTextColumnData());
>>>>   getMyRowArrayList().add(row);
>>>> }
>>>>
>>>> ...
>>>> ListView<MyDispayRow> repeater = new 
>>>> ListView<MyDisplayRow>("repeater", myRowArrrayListModel)
>>>> {
>>>>  protected void populateItem(ListItem<MyDisplayRow> item)
>>>>  {
>>>>     // Here is where I see the duplicate markup ids
>>>>     
>>>> log.debug(item.getModelObject().getLabelComponent().getMarkupId());
>>>>     item.add(item.getModelObject().getLabelComponent());
>>>>  }
>>>> }
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>
> ---------------------------------------------------------------------
> 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: Duplicate Markup Ids

Posted by Jered Myers <je...@maplewoodsoftware.com>.
I forgot to post Wicket version 1.4.18

On 11/14/2011 02:07 PM, Jered Myers wrote:
> The HTML markup is always <span wicket:id="headerLabel"></span>, so I 
> think the answer is no.  I end up with a markup id like "headerLabel8f".
>
> On 11/14/2011 12:54 PM, Sven Meier wrote:
>> Do you have markup ids pre-defined in your html markup?
>>
>> Sven
>>
>> On 11/14/2011 09:39 PM, Jered Myers wrote:
>>> I am getting components with duplicate markup ids in my label 
>>> components.  What can cause this to happen?
>>>
>>> I am letting Wicket set the markup ids.  Only one user is setup in a 
>>> manner that creates the problem, so in general there is not a 
>>> duplication problem.  As I understand it the markup id number is 
>>> coming from the Session's nextSequenceValue method, so I don't see 
>>> how it could be duplicated.  The components are getting built by 
>>> multiple instances of the same class and added into the same array.  
>>> Here is an example reduced down to the basic parts:
>>>
>>> Several classes build the MyDisplayRow objects and add them to the 
>>> same ArrayList...
>>> for (DataRow data : myData)
>>> {
>>>   MyDisplayRow row = new MyDisplayRow();
>>>   row.setLabelComponent(new Label("headerLabel", 
>>> data.getTextColumnData());
>>>   getMyRowArrayList().add(row);
>>> }
>>>
>>> ...
>>> ListView<MyDispayRow> repeater = new 
>>> ListView<MyDisplayRow>("repeater", myRowArrrayListModel)
>>> {
>>>  protected void populateItem(ListItem<MyDisplayRow> item)
>>>  {
>>>     // Here is where I see the duplicate markup ids
>>>     log.debug(item.getModelObject().getLabelComponent().getMarkupId());
>>>     item.add(item.getModelObject().getLabelComponent());
>>>  }
>>> }
>>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Duplicate Markup Ids

Posted by Jered Myers <je...@maplewoodsoftware.com>.
The HTML markup is always <span wicket:id="headerLabel"></span>, so I 
think the answer is no.  I end up with a markup id like "headerLabel8f".

On 11/14/2011 12:54 PM, Sven Meier wrote:
> Do you have markup ids pre-defined in your html markup?
>
> Sven
>
> On 11/14/2011 09:39 PM, Jered Myers wrote:
>> I am getting components with duplicate markup ids in my label 
>> components.  What can cause this to happen?
>>
>> I am letting Wicket set the markup ids.  Only one user is setup in a 
>> manner that creates the problem, so in general there is not a 
>> duplication problem.  As I understand it the markup id number is 
>> coming from the Session's nextSequenceValue method, so I don't see 
>> how it could be duplicated.  The components are getting built by 
>> multiple instances of the same class and added into the same array.  
>> Here is an example reduced down to the basic parts:
>>
>> Several classes build the MyDisplayRow objects and add them to the 
>> same ArrayList...
>> for (DataRow data : myData)
>> {
>>   MyDisplayRow row = new MyDisplayRow();
>>   row.setLabelComponent(new Label("headerLabel", 
>> data.getTextColumnData());
>>   getMyRowArrayList().add(row);
>> }
>>
>> ...
>> ListView<MyDispayRow> repeater = new 
>> ListView<MyDisplayRow>("repeater", myRowArrrayListModel)
>> {
>>  protected void populateItem(ListItem<MyDisplayRow> item)
>>  {
>>     // Here is where I see the duplicate markup ids
>>     log.debug(item.getModelObject().getLabelComponent().getMarkupId());
>>     item.add(item.getModelObject().getLabelComponent());
>>  }
>> }
>>
>
>
> ---------------------------------------------------------------------
> 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: Duplicate Markup Ids

Posted by Sven Meier <sv...@meiers.net>.
Do you have markup ids pre-defined in your html markup?

Sven

On 11/14/2011 09:39 PM, Jered Myers wrote:
> I am getting components with duplicate markup ids in my label 
> components.  What can cause this to happen?
>
> I am letting Wicket set the markup ids.  Only one user is setup in a 
> manner that creates the problem, so in general there is not a 
> duplication problem.  As I understand it the markup id number is 
> coming from the Session's nextSequenceValue method, so I don't see how 
> it could be duplicated.  The components are getting built by multiple 
> instances of the same class and added into the same array.  Here is an 
> example reduced down to the basic parts:
>
> Several classes build the MyDisplayRow objects and add them to the 
> same ArrayList...
> for (DataRow data : myData)
> {
>   MyDisplayRow row = new MyDisplayRow();
>   row.setLabelComponent(new Label("headerLabel", 
> data.getTextColumnData());
>   getMyRowArrayList().add(row);
> }
>
> ...
> ListView<MyDispayRow> repeater = new 
> ListView<MyDisplayRow>("repeater", myRowArrrayListModel)
> {
>  protected void populateItem(ListItem<MyDisplayRow> item)
>  {
>     // Here is where I see the duplicate markup ids
>     log.debug(item.getModelObject().getLabelComponent().getMarkupId());
>     item.add(item.getModelObject().getLabelComponent());
>  }
> }
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org