You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Sam Hough <sa...@redspr.com> on 2007/09/12 10:16:33 UTC

RepeatingView id

Our HTML monkey got me to make the ids of a RepeatingView valid (ie not just
a number) but I 
think we got caught by this (from org.apache.wicket.markup.Markup):

		// TODO Post 1.2: A component path e.g. "panel:label" does not match 1:1
		// with the markup in case of ListView, where the path contains a number
		// for each list item. E.g. list:0:label. What we currently do is simply
		// remove the number from the path and hope that no user uses an integer
		// for a component id. This is a hack only. A much better solution would
		// delegate to the various components recursivly to search within there
		// realm only for the components markup. ListItems could then simply
		// do nothing and delegate to their parents.

Maybe a logger warning or assert if the developer tries to use an id that is
not \d+ and fix the comment in RepeatingView that says newChildId starts
with "id"?

Cheers

Sam
-- 
View this message in context: http://www.nabble.com/RepeatingView-id-tf4427681.html#a12630767
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: RepeatingView id

Posted by Sam Hough <sa...@redspr.com>.
Hope it makes sense: https://issues.apache.org/jira/browse/WICKET-962

Presumably my functional tests are meant to catch me being stupid and using
the same markupId twice.

btw I'm slowly catching onto the wicket way. Starting to appreciate IModel.



igor.vaynberg wrote:
> 
> please add a jira issue.
> 
> -igor
> 
> 
> On 9/12/07, Sam Hough <sa...@redspr.com> wrote:
>>
>>
>> OK. Any nice way to warn developers if they put components with
>> non-numeric
>> wicket ids in a RepeatingView?
>>
>> This bites us as I'm doing:
>>                 super(id, t);
>>                 setMarkupId(id);
>>                 setOutputMarkupId(true);
>> for all our components so Ajax updates will work and the HTML monkey
>> doesn't
>> scream that he can't set the id of an element.
>>
>> Maybe I can add a kludge to not setMarkupId(id) if id matches \d+
>>
>>
>>
>>
>>
>>
>> igor.vaynberg wrote:
>> >
>> > this is a requirement for WICKET ids only, afaik we already make MARKUP
>> > ids
>> > start with a letter if it is numeric only....
>> >
>> > -igor
>> >
>> >
>> > On 9/12/07, Sam Hough <sa...@redspr.com> wrote:
>> >>
>> >>
>> >> Our HTML monkey got me to make the ids of a RepeatingView valid (ie
>> not
>> >> just
>> >> a number) but I
>> >> think we got caught by this (from org.apache.wicket.markup.Markup):
>> >>
>> >>                 // TODO Post 1.2: A component path e.g. "panel:label"
>> >> does
>> >> not match 1:1
>> >>                 // with the markup in case of ListView, where the path
>> >> contains a number
>> >>                 // for each list item. E.g. list:0:label. What we
>> >> currently do is simply
>> >>                 // remove the number from the path and hope that no
>> user
>> >> uses an integer
>> >>                 // for a component id. This is a hack only. A much
>> better
>> >> solution would
>> >>                 // delegate to the various components recursivly to
>> >> search
>> >> within there
>> >>                 // realm only for the components markup. ListItems
>> could
>> >> then simply
>> >>                 // do nothing and delegate to their parents.
>> >>
>> >> Maybe a logger warning or assert if the developer tries to use an id
>> that
>> >> is
>> >> not \d+ and fix the comment in RepeatingView that says newChildId
>> starts
>> >> with "id"?
>> >>
>> >> Cheers
>> >>
>> >> Sam
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/RepeatingView-id-tf4427681.html#a12630767
>> >> 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
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/RepeatingView-id-tf4427681.html#a12638365
>> 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
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/RepeatingView-id-tf4427681.html#a12640217
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: RepeatingView id

Posted by Igor Vaynberg <ig...@gmail.com>.
please add a jira issue.

-igor


On 9/12/07, Sam Hough <sa...@redspr.com> wrote:
>
>
> OK. Any nice way to warn developers if they put components with
> non-numeric
> wicket ids in a RepeatingView?
>
> This bites us as I'm doing:
>                 super(id, t);
>                 setMarkupId(id);
>                 setOutputMarkupId(true);
> for all our components so Ajax updates will work and the HTML monkey
> doesn't
> scream that he can't set the id of an element.
>
> Maybe I can add a kludge to not setMarkupId(id) if id matches \d+
>
>
>
>
>
>
> igor.vaynberg wrote:
> >
> > this is a requirement for WICKET ids only, afaik we already make MARKUP
> > ids
> > start with a letter if it is numeric only....
> >
> > -igor
> >
> >
> > On 9/12/07, Sam Hough <sa...@redspr.com> wrote:
> >>
> >>
> >> Our HTML monkey got me to make the ids of a RepeatingView valid (ie not
> >> just
> >> a number) but I
> >> think we got caught by this (from org.apache.wicket.markup.Markup):
> >>
> >>                 // TODO Post 1.2: A component path e.g. "panel:label"
> >> does
> >> not match 1:1
> >>                 // with the markup in case of ListView, where the path
> >> contains a number
> >>                 // for each list item. E.g. list:0:label. What we
> >> currently do is simply
> >>                 // remove the number from the path and hope that no
> user
> >> uses an integer
> >>                 // for a component id. This is a hack only. A much
> better
> >> solution would
> >>                 // delegate to the various components recursivly to
> >> search
> >> within there
> >>                 // realm only for the components markup. ListItems
> could
> >> then simply
> >>                 // do nothing and delegate to their parents.
> >>
> >> Maybe a logger warning or assert if the developer tries to use an id
> that
> >> is
> >> not \d+ and fix the comment in RepeatingView that says newChildId
> starts
> >> with "id"?
> >>
> >> Cheers
> >>
> >> Sam
> >> --
> >> View this message in context:
> >> http://www.nabble.com/RepeatingView-id-tf4427681.html#a12630767
> >> 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
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/RepeatingView-id-tf4427681.html#a12638365
> 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: RepeatingView id

Posted by Sam Hough <sa...@redspr.com>.
OK. Any nice way to warn developers if they put components with non-numeric
wicket ids in a RepeatingView?

This bites us as I'm doing:
		super(id, t);
		setMarkupId(id);
		setOutputMarkupId(true);
for all our components so Ajax updates will work and the HTML monkey doesn't
scream that he can't set the id of an element.

Maybe I can add a kludge to not setMarkupId(id) if id matches \d+






igor.vaynberg wrote:
> 
> this is a requirement for WICKET ids only, afaik we already make MARKUP
> ids
> start with a letter if it is numeric only....
> 
> -igor
> 
> 
> On 9/12/07, Sam Hough <sa...@redspr.com> wrote:
>>
>>
>> Our HTML monkey got me to make the ids of a RepeatingView valid (ie not
>> just
>> a number) but I
>> think we got caught by this (from org.apache.wicket.markup.Markup):
>>
>>                 // TODO Post 1.2: A component path e.g. "panel:label"
>> does
>> not match 1:1
>>                 // with the markup in case of ListView, where the path
>> contains a number
>>                 // for each list item. E.g. list:0:label. What we
>> currently do is simply
>>                 // remove the number from the path and hope that no user
>> uses an integer
>>                 // for a component id. This is a hack only. A much better
>> solution would
>>                 // delegate to the various components recursivly to
>> search
>> within there
>>                 // realm only for the components markup. ListItems could
>> then simply
>>                 // do nothing and delegate to their parents.
>>
>> Maybe a logger warning or assert if the developer tries to use an id that
>> is
>> not \d+ and fix the comment in RepeatingView that says newChildId starts
>> with "id"?
>>
>> Cheers
>>
>> Sam
>> --
>> View this message in context:
>> http://www.nabble.com/RepeatingView-id-tf4427681.html#a12630767
>> 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
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/RepeatingView-id-tf4427681.html#a12638365
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: RepeatingView id

Posted by Igor Vaynberg <ig...@gmail.com>.
this is a requirement for WICKET ids only, afaik we already make MARKUP ids
start with a letter if it is numeric only....

-igor


On 9/12/07, Sam Hough <sa...@redspr.com> wrote:
>
>
> Our HTML monkey got me to make the ids of a RepeatingView valid (ie not
> just
> a number) but I
> think we got caught by this (from org.apache.wicket.markup.Markup):
>
>                 // TODO Post 1.2: A component path e.g. "panel:label" does
> not match 1:1
>                 // with the markup in case of ListView, where the path
> contains a number
>                 // for each list item. E.g. list:0:label. What we
> currently do is simply
>                 // remove the number from the path and hope that no user
> uses an integer
>                 // for a component id. This is a hack only. A much better
> solution would
>                 // delegate to the various components recursivly to search
> within there
>                 // realm only for the components markup. ListItems could
> then simply
>                 // do nothing and delegate to their parents.
>
> Maybe a logger warning or assert if the developer tries to use an id that
> is
> not \d+ and fix the comment in RepeatingView that says newChildId starts
> with "id"?
>
> Cheers
>
> Sam
> --
> View this message in context:
> http://www.nabble.com/RepeatingView-id-tf4427681.html#a12630767
> 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
>
>