You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Alex Objelean <al...@isdc.ro> on 2007/09/21 13:44:50 UTC

[RFE] getMarkupId()

This is about how wicket generates dynamically markupID.

I have, for instance, the following markup component: 

<input wicket:id="quantity.noOfUnits" />

The generated markupId for this component looks like the following:
quantity.noOfUnits1232 .

I suggest to escape any css valid specifiers from the generated markupId, by
replacing them with something else (for instance '_' character). 

The problem appear when I am trying to identify the component by it's id
using some js library (like jQuery) and as a consequence the result of this
query: $("#quantity.noOfUnits1232") is invalid.

Thank you!

Alex.
-- 
View this message in context: http://www.nabble.com/-RFE--getMarkupId%28%29-tf4493344.html#a12815038
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: [RFE] getMarkupId()

Posted by Alex Objelean <al...@isdc.ro>.
That's correct. But do you understand what is the overhead of parsing each
markup Id and to escape the '.' on the clientside? I agree that the '.'
character is a valid HTML ID, but it would be also valid if the period would
be replaced with another character (for instance underscore).


Ryan Holmes wrote:
> 
> I think you misunderstood me. As a CSS selector,  
> '#quantity.noOfUnits1232' means "the element with ID 'quantity' and  
> class 'noOfUnits1232'", while the selector '#quantity\.noOfUnits1232'  
> refers to an element with a period in its HTML ID. If JQuery cannot  
> handle a reference to an HTML ID with a period in it, then that's a  
> JQuery bug since it is a valid ID.
> 
> On Sep 25, 2007, at 12:40 AM, Alex Objelean wrote:
> 
>>
>> It's not a jquery bug at all. The '.' character is interpreted as a  
>> css
>> class. So, the $("#quantity.noOfUnits1232") translates in element  
>> with ID
>> "quantity" and css class "noOfUnits1232".
>> Also, I do not see any problem which can be caused by magical  
>> handling of
>> markup id. (at least one core developer was agree with this point  
>> of view).
>>
>> Alex.
>>
>>
>> Ryan Holmes wrote:
>>>
>>> Did you try escaping the '.'? Something like $("#quantity
>>> \.noOfUnits1232").
>>>
>>> I refer to Wicket id's with periods in several CSS rules with no
>>> problem. The period is a valid character in HTML id's and I strongly
>>> disagree with the magical id mangling behavior you suggest. If JQuery
>>> can't handle valid HTML id's, that's a JQuery bug and not a Wicket  
>>> bug.
>>>
>>>
>>> -Ryan
>>>
>>> On Sep 21, 2007, at 4:44 AM, Alex Objelean wrote:
>>>
>>>>
>>>> This is about how wicket generates dynamically markupID.
>>>>
>>>> I have, for instance, the following markup component:
>>>>
>>>> <input wicket:id="quantity.noOfUnits" />
>>>>
>>>> The generated markupId for this component looks like the following:
>>>> quantity.noOfUnits1232 .
>>>>
>>>> I suggest to escape any css valid specifiers from the generated
>>>> markupId, by
>>>> replacing them with something else (for instance '_' character).
>>>>
>>>> The problem appear when I am trying to identify the component by
>>>> it's id
>>>> using some js library (like jQuery) and as a consequence the result
>>>> of this
>>>> query: $("#quantity.noOfUnits1232") is invalid.
>>>>
>>>> Thank you!
>>>>
>>>> Alex.
>>>> -- 
>>>> View this message in context: http://www.nabble.com/-RFE--
>>>> getMarkupId%28%29-tf4493344.html#a12815038
>>>> 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
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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/-RFE-- 
>> getMarkupId%28%29-tf4493344.html#a12874553
>> 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
>>
> 
> 
> ---------------------------------------------------------------------
> 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/-RFE--getMarkupId%28%29-tf4493344.html#a12907044
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: [RFE] getMarkupId()

Posted by Ryan Holmes <ry...@hyperstep.com>.
I think you misunderstood me. As a CSS selector,  
'#quantity.noOfUnits1232' means "the element with ID 'quantity' and  
class 'noOfUnits1232'", while the selector '#quantity\.noOfUnits1232'  
refers to an element with a period in its HTML ID. If JQuery cannot  
handle a reference to an HTML ID with a period in it, then that's a  
JQuery bug since it is a valid ID.

On Sep 25, 2007, at 12:40 AM, Alex Objelean wrote:

>
> It's not a jquery bug at all. The '.' character is interpreted as a  
> css
> class. So, the $("#quantity.noOfUnits1232") translates in element  
> with ID
> "quantity" and css class "noOfUnits1232".
> Also, I do not see any problem which can be caused by magical  
> handling of
> markup id. (at least one core developer was agree with this point  
> of view).
>
> Alex.
>
>
> Ryan Holmes wrote:
>>
>> Did you try escaping the '.'? Something like $("#quantity
>> \.noOfUnits1232").
>>
>> I refer to Wicket id's with periods in several CSS rules with no
>> problem. The period is a valid character in HTML id's and I strongly
>> disagree with the magical id mangling behavior you suggest. If JQuery
>> can't handle valid HTML id's, that's a JQuery bug and not a Wicket  
>> bug.
>>
>>
>> -Ryan
>>
>> On Sep 21, 2007, at 4:44 AM, Alex Objelean wrote:
>>
>>>
>>> This is about how wicket generates dynamically markupID.
>>>
>>> I have, for instance, the following markup component:
>>>
>>> <input wicket:id="quantity.noOfUnits" />
>>>
>>> The generated markupId for this component looks like the following:
>>> quantity.noOfUnits1232 .
>>>
>>> I suggest to escape any css valid specifiers from the generated
>>> markupId, by
>>> replacing them with something else (for instance '_' character).
>>>
>>> The problem appear when I am trying to identify the component by
>>> it's id
>>> using some js library (like jQuery) and as a consequence the result
>>> of this
>>> query: $("#quantity.noOfUnits1232") is invalid.
>>>
>>> Thank you!
>>>
>>> Alex.
>>> -- 
>>> View this message in context: http://www.nabble.com/-RFE--
>>> getMarkupId%28%29-tf4493344.html#a12815038
>>> 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
>>>
>>
>>
>> ---------------------------------------------------------------------
>> 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/-RFE-- 
> getMarkupId%28%29-tf4493344.html#a12874553
> 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
>


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


Re: [RFE] getMarkupId()

Posted by Alex Objelean <al...@isdc.ro>.
It's not a jquery bug at all. The '.' character is interpreted as a css
class. So, the $("#quantity.noOfUnits1232") translates in element with ID
"quantity" and css class "noOfUnits1232". 
Also, I do not see any problem which can be caused by magical handling of
markup id. (at least one core developer was agree with this point of view).

Alex.


Ryan Holmes wrote:
> 
> Did you try escaping the '.'? Something like $("#quantity 
> \.noOfUnits1232").
> 
> I refer to Wicket id's with periods in several CSS rules with no  
> problem. The period is a valid character in HTML id's and I strongly  
> disagree with the magical id mangling behavior you suggest. If JQuery  
> can't handle valid HTML id's, that's a JQuery bug and not a Wicket bug.
> 
> 
> -Ryan
> 
> On Sep 21, 2007, at 4:44 AM, Alex Objelean wrote:
> 
>>
>> This is about how wicket generates dynamically markupID.
>>
>> I have, for instance, the following markup component:
>>
>> <input wicket:id="quantity.noOfUnits" />
>>
>> The generated markupId for this component looks like the following:
>> quantity.noOfUnits1232 .
>>
>> I suggest to escape any css valid specifiers from the generated  
>> markupId, by
>> replacing them with something else (for instance '_' character).
>>
>> The problem appear when I am trying to identify the component by  
>> it's id
>> using some js library (like jQuery) and as a consequence the result  
>> of this
>> query: $("#quantity.noOfUnits1232") is invalid.
>>
>> Thank you!
>>
>> Alex.
>> -- 
>> View this message in context: http://www.nabble.com/-RFE-- 
>> getMarkupId%28%29-tf4493344.html#a12815038
>> 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
>>
> 
> 
> ---------------------------------------------------------------------
> 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/-RFE--getMarkupId%28%29-tf4493344.html#a12874553
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: [RFE] getMarkupId()

Posted by Alex Objelean <al...@isdc.ro>.
That is wrong! In wicket-1.3.x branch the underscore is not used as a
hierarchy separator. It was used before the 1.3.x branch. Take a look on
generated id's..


Ryan Holmes wrote:
> 
> ..and the underscore is used as a hierarchy separator. 
> 

-- 
View this message in context: http://www.nabble.com/-RFE--getMarkupId%28%29-tf4493344.html#a12906729
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: [RFE] getMarkupId()

Posted by Alex Objelean <al...@isdc.ro>.
Why would you need to predict the id? That is the point - you should not rely
on generated id, all you know that it is unique. If you want to be sure what
is the id, just override the Component#getMarkupId()...


Ryan Holmes wrote:
> 
> I think a simple and predictable markup id generation scheme is
> preferable.
> 

-- 
View this message in context: http://www.nabble.com/-RFE--getMarkupId%28%29-tf4493344.html#a12906940
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: [RFE] getMarkupId()

Posted by Ryan Holmes <ry...@hyperstep.com>.
It's potentially confusing because, right now, a markup id is based  
on the untranslated component id and the underscore is used as a  
hierarchy separator. To use the underscore for this secondary purpose  
makes it more difficult to predict the markup id. Whether or not  
someone *should* be trying to predict markup id's is a different  
issue but, in general, I think a simple and predictable markup id  
generation scheme is preferable.

At Igor's request, I'll ask for a vote on this on the dev list.

-Ryan

On Sep 25, 2007, at 12:47 AM, Alex Objelean wrote:

>
>
> Why would a developer be confused by something that is generated
> automatically? Do you really care if the generated markup id is  
> "quantity1"
> or "quantity_1" or "quantity-1"? Whats the difference?
>
>
> Ryan Holmes wrote:
>>
>>
>> The automatic transformation of certain characters by a framework is
>> exactly the kind of magic behavior that confuses users and  
>> therefore I
>> think the recommended "fix" is a bad idea.
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/-RFE-- 
> getMarkupId%28%29-tf4493344.html#a12874680
> 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
>


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


Re: [RFE] getMarkupId()

Posted by Alex Objelean <al...@isdc.ro>.

Why would a developer be confused by something that is generated
automatically? Do you really care if the generated markup id is "quantity1"
or "quantity_1" or "quantity-1"? Whats the difference?


Ryan Holmes wrote:
> 
> 
> The automatic transformation of certain characters by a framework is
> exactly the kind of magic behavior that confuses users and therefore I
> think the recommended "fix" is a bad idea.
> 
> 

-- 
View this message in context: http://www.nabble.com/-RFE--getMarkupId%28%29-tf4493344.html#a12874680
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: [RFE] getMarkupId()

Posted by Ryan Holmes <ry...@hyperstep.com>.
Did you try escaping the '.'? Something like $("#quantity 
\.noOfUnits1232").

I refer to Wicket id's with periods in several CSS rules with no  
problem. The period is a valid character in HTML id's and I strongly  
disagree with the magical id mangling behavior you suggest. If JQuery  
can't handle valid HTML id's, that's a JQuery bug and not a Wicket bug.


-Ryan

On Sep 21, 2007, at 4:44 AM, Alex Objelean wrote:

>
> This is about how wicket generates dynamically markupID.
>
> I have, for instance, the following markup component:
>
> <input wicket:id="quantity.noOfUnits" />
>
> The generated markupId for this component looks like the following:
> quantity.noOfUnits1232 .
>
> I suggest to escape any css valid specifiers from the generated  
> markupId, by
> replacing them with something else (for instance '_' character).
>
> The problem appear when I am trying to identify the component by  
> it's id
> using some js library (like jQuery) and as a consequence the result  
> of this
> query: $("#quantity.noOfUnits1232") is invalid.
>
> Thank you!
>
> Alex.
> -- 
> View this message in context: http://www.nabble.com/-RFE-- 
> getMarkupId%28%29-tf4493344.html#a12815038
> 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
>


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


Re: [RFE] getMarkupId()

Posted by Matej Knopp <ma...@gmail.com>.
On 9/24/07, Maris Orbidans <sm...@ime.lv> wrote:
>
> is it a joke ?  In that case web design templates would need a unique
> class attribute for each element that is going to be used via Ajax.
> And in some cases it's not possible at all. For example, odd rows in a
> table might have a different color than even rows. Typically one kind of
> rows have the same class attribute.
> If wicket will use class attribute as an identifier then there will be
> no way to work with table rows.
Huh? Using class attribute as identifier for Ajax replacement? How did
you came to this conclusion?

-Matej
>
> And it's just an example. In every web design there are many html tags
> with the same class attribute.
>
> Maris
>
> > We are going to stop using ids and move over to class as it make re-use
> > easier and avoids a number of wicket problems with ids... The HTML monkey is
> > not happy though. He reminds me of the Family Guy screaming monkey today.
> >
> >
> >
> > Alex Objelean wrote:
> >
> >> This is about how wicket generates dynamically markupID.
> >>
> >> I have, for instance, the following markup component:
> >>
> >> <input wicket:id="quantity.noOfUnits" />
> >>
> >> The generated markupId for this component looks like the following:
> >> quantity.noOfUnits1232 .
> >>
> >> I suggest to escape any css valid specifiers from the generated markupId,
> >> by replacing them with something else (for instance '_' character).
> >>
> >> The problem appear when I am trying to identify the component by it's id
> >> using some js library (like jQuery) and as a consequence the result of
> >> this query: $("#quantity.noOfUnits1232") is invalid.
> >>
> >> Thank you!
> >>
> >> Alex.
> >>
> >>
> >
> >
>
> ---------------------------------------------------------------------
> 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: [RFE] getMarkupId()

Posted by Matthijs Wensveen <m....@func.nl>.
Eelco Hillenius wrote:
>> is it a joke ?  In that case web design templates would need a unique
>> class attribute for each element that is going to be used via Ajax.
>> And in some cases it's not possible at all. For example, odd rows in a
>> table might have a different color than even rows. Typically one kind of
>> rows have the same class attribute.
>> If wicket will use class attribute as an identifier then there will be
>> no way to work with table rows.
>>     
>
> He said that as a user. The Wicket framework won't switch to using
> classes instead of ids of course :-)
>
> Eelco

Phew, I also read that the wrong way. It'd been interesting to see 
though how you'd manage to keep Ajax working and all. Outputting the 
java class as html class might be nice though. It would be useful to 
style wicket components in css. But it's easy to do this yourself already.

Matthijs


-- 
Matthijs Wensveen
Func. Internet Integration
W http://www.func.nl
T +31 20 4230000
F +31 20 4223500 


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


Re: [RFE] getMarkupId()

Posted by Eelco Hillenius <ee...@gmail.com>.
> is it a joke ?  In that case web design templates would need a unique
> class attribute for each element that is going to be used via Ajax.
> And in some cases it's not possible at all. For example, odd rows in a
> table might have a different color than even rows. Typically one kind of
> rows have the same class attribute.
> If wicket will use class attribute as an identifier then there will be
> no way to work with table rows.

He said that as a user. The Wicket framework won't switch to using
classes instead of ids of course :-)

Eelco

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


Re: [RFE] getMarkupId()

Posted by Maris Orbidans <sm...@ime.lv>.
is it a joke ?  In that case web design templates would need a unique 
class attribute for each element that is going to be used via Ajax. 
And in some cases it's not possible at all. For example, odd rows in a 
table might have a different color than even rows. Typically one kind of 
rows have the same class attribute.
If wicket will use class attribute as an identifier then there will be 
no way to work with table rows.

And it's just an example. In every web design there are many html tags 
with the same class attribute. 

Maris

> We are going to stop using ids and move over to class as it make re-use
> easier and avoids a number of wicket problems with ids... The HTML monkey is
> not happy though. He reminds me of the Family Guy screaming monkey today.
>
>
>
> Alex Objelean wrote:
>   
>> This is about how wicket generates dynamically markupID.
>>
>> I have, for instance, the following markup component: 
>>
>> <input wicket:id="quantity.noOfUnits" />
>>
>> The generated markupId for this component looks like the following:
>> quantity.noOfUnits1232 .
>>
>> I suggest to escape any css valid specifiers from the generated markupId,
>> by replacing them with something else (for instance '_' character). 
>>
>> The problem appear when I am trying to identify the component by it's id
>> using some js library (like jQuery) and as a consequence the result of
>> this query: $("#quantity.noOfUnits1232") is invalid.
>>
>> Thank you!
>>
>> Alex.
>>
>>     
>
>   

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


Re: [RFE] getMarkupId()

Posted by Igor Vaynberg <ig...@gmail.com>.
even with wicket2 getting the id from html...repeaters would break since the
id in the html is static, but for repeaters it needs to be unique...unless
you want all your items/rows to have the same id.

-igor


On 9/21/07, Sam Hough <sa...@redspr.com> wrote:
>
>
> I was doing
>
> SomeComponent(String id...) {
>   super(id);
>   setMarkupId(id);
>   setOutputMarkupId(true);
>   setOutputMarkupPlaceholderTag(true);
> }
>
> So we could know before runtime what the id would be. Obviously this sucks
> because RepeatingView breaks it (so added regexp hack) and id passed to
> component needs to be global unique rather than just unique within the
> container.
>
> Guess we really wanted the Wicket 2 getting the id from the HTML.
>
>
>
>
> Matej Knopp-2 wrote:
> >
> > I dont' understand. You rely on the way how wicket generates IDs? Then
> > your code is bound to break. If you really need a wicket component's
> > id in javascript, you either override getMarkupId(), or pass the Id
> > using javascript (e.g. label component assigning another component's
> > id into javascript variable).
> >
> > -Matej
> >
> > On 9/21/07, Sam Hough <sa...@redspr.com> wrote:
> >>
> >> So you use it just because of the performance of the browser DOM? Not
> >> because
> >> it has to be unique?
> >>
> >> Are you using Ajax? ie forced to do setOutputMarkupId? We are and that
> is
> >> probably the biggest reason we are trying to avoid them.
> >>
> >>
> >>
> >>
> >>
> >> Alex Objelean wrote:
> >> >
> >> >
> >> > In my application I extensively use the component generated id to
> >> perform
> >> > some DOM updates on the client side, also for client-side validation.
> >> >
> >> > Also getting a DOM element by its ID is the fastest method comparing
> >> with
> >> > finding it using it's css class.
> >> >
> >> >
> >> >
> >> > Sam Hough wrote:
> >> >>
> >> >> When is the killer case for using id?
> >> >>
> >> >>
> >> >>
> >> >> Alex Objelean wrote:
> >> >>>
> >> >>> My personal opinion is that switching from id to class is not such
> a
> >> >>> good idea, simply because the ID attributes guaranties (of course
> you
> >> >>> can create two elements with same ID, but it is not the same as
> with
> >> >>> class attribute) the unicity of the element, also you can find the
> >> >>> element from js using document.getElementById...
> >> >>>
> >> >>> I hope that this radical change will not be made in the 1.3 release
> >> as
> >> >>> it has a great impact on any application developed using the latest
> >> >>> beta3 release. Also I think this issue should be discussed more
> >> between
> >> >>> the core developers.
> >> >>>
> >> >>> Alex.
> >> >>>
> >> >>>
> >> >>> Sam Hough wrote:
> >> >>>>
> >> >>>> We are going to stop using ids and move over to class as it make
> >> re-use
> >> >>>> easier and avoids a number of wicket problems with ids... The HTML
> >> >>>> monkey is not happy though. He reminds me of the Family Guy
> >> screaming
> >> >>>> monkey today.
> >> >>>>
> >> >>>>
> >> >>>>
> >> >>>> Alex Objelean wrote:
> >> >>>>>
> >> >>>>> This is about how wicket generates dynamically markupID.
> >> >>>>>
> >> >>>>> I have, for instance, the following markup component:
> >> >>>>>
> >> >>>>> <input wicket:id="quantity.noOfUnits" />
> >> >>>>>
> >> >>>>> The generated markupId for this component looks like the
> following:
> >> >>>>> quantity.noOfUnits1232 .
> >> >>>>>
> >> >>>>> I suggest to escape any css valid specifiers from the generated
> >> >>>>> markupId, by replacing them with something else (for instance '_'
> >> >>>>> character).
> >> >>>>>
> >> >>>>> The problem appear when I am trying to identify the component by
> >> it's
> >> >>>>> id using some js library (like jQuery) and as a consequence the
> >> result
> >> >>>>> of this query: $("#quantity.noOfUnits1232") is invalid.
> >> >>>>>
> >> >>>>> Thank you!
> >> >>>>>
> >> >>>>> Alex.
> >> >>>>>
> >> >>>>
> >> >>>>
> >> >>>
> >> >>>
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/-RFE--getMarkupId%28%29-tf4493344.html#a12821835
> >> 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
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > 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/-RFE--getMarkupId%28%29-tf4493344.html#a12822757
> 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: [RFE] getMarkupId()

Posted by Sam Hough <sa...@redspr.com>.
I was doing 

SomeComponent(String id...) {
  super(id);
  setMarkupId(id);
  setOutputMarkupId(true);
  setOutputMarkupPlaceholderTag(true);
}

So we could know before runtime what the id would be. Obviously this sucks
because RepeatingView breaks it (so added regexp hack) and id passed to
component needs to be global unique rather than just unique within the
container.

Guess we really wanted the Wicket 2 getting the id from the HTML.




Matej Knopp-2 wrote:
> 
> I dont' understand. You rely on the way how wicket generates IDs? Then
> your code is bound to break. If you really need a wicket component's
> id in javascript, you either override getMarkupId(), or pass the Id
> using javascript (e.g. label component assigning another component's
> id into javascript variable).
> 
> -Matej
> 
> On 9/21/07, Sam Hough <sa...@redspr.com> wrote:
>>
>> So you use it just because of the performance of the browser DOM? Not
>> because
>> it has to be unique?
>>
>> Are you using Ajax? ie forced to do setOutputMarkupId? We are and that is
>> probably the biggest reason we are trying to avoid them.
>>
>>
>>
>>
>>
>> Alex Objelean wrote:
>> >
>> >
>> > In my application I extensively use the component generated id to
>> perform
>> > some DOM updates on the client side, also for client-side validation.
>> >
>> > Also getting a DOM element by its ID is the fastest method comparing
>> with
>> > finding it using it's css class.
>> >
>> >
>> >
>> > Sam Hough wrote:
>> >>
>> >> When is the killer case for using id?
>> >>
>> >>
>> >>
>> >> Alex Objelean wrote:
>> >>>
>> >>> My personal opinion is that switching from id to class is not such a
>> >>> good idea, simply because the ID attributes guaranties (of course you
>> >>> can create two elements with same ID, but it is not the same as with
>> >>> class attribute) the unicity of the element, also you can find the
>> >>> element from js using document.getElementById...
>> >>>
>> >>> I hope that this radical change will not be made in the 1.3 release
>> as
>> >>> it has a great impact on any application developed using the latest
>> >>> beta3 release. Also I think this issue should be discussed more
>> between
>> >>> the core developers.
>> >>>
>> >>> Alex.
>> >>>
>> >>>
>> >>> Sam Hough wrote:
>> >>>>
>> >>>> We are going to stop using ids and move over to class as it make
>> re-use
>> >>>> easier and avoids a number of wicket problems with ids... The HTML
>> >>>> monkey is not happy though. He reminds me of the Family Guy
>> screaming
>> >>>> monkey today.
>> >>>>
>> >>>>
>> >>>>
>> >>>> Alex Objelean wrote:
>> >>>>>
>> >>>>> This is about how wicket generates dynamically markupID.
>> >>>>>
>> >>>>> I have, for instance, the following markup component:
>> >>>>>
>> >>>>> <input wicket:id="quantity.noOfUnits" />
>> >>>>>
>> >>>>> The generated markupId for this component looks like the following:
>> >>>>> quantity.noOfUnits1232 .
>> >>>>>
>> >>>>> I suggest to escape any css valid specifiers from the generated
>> >>>>> markupId, by replacing them with something else (for instance '_'
>> >>>>> character).
>> >>>>>
>> >>>>> The problem appear when I am trying to identify the component by
>> it's
>> >>>>> id using some js library (like jQuery) and as a consequence the
>> result
>> >>>>> of this query: $("#quantity.noOfUnits1232") is invalid.
>> >>>>>
>> >>>>> Thank you!
>> >>>>>
>> >>>>> Alex.
>> >>>>>
>> >>>>
>> >>>>
>> >>>
>> >>>
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-RFE--getMarkupId%28%29-tf4493344.html#a12821835
>> 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
>>
>>
> 
> ---------------------------------------------------------------------
> 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/-RFE--getMarkupId%28%29-tf4493344.html#a12822757
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: [RFE] getMarkupId()

Posted by Matej Knopp <ma...@gmail.com>.
Yeah, if you do that then you have to make sure that it won't break
when you e.g. put the component to page twice.

-Matej

On 9/21/07, Igor Vaynberg <ig...@gmail.com> wrote:
> you can, but then good luck making sure they are unique...
>
> -igor
>
>
> On 9/21/07, Ryan Sonnek <ry...@gmail.com> wrote:
> >
> > On 9/21/07, Matej Knopp <ma...@gmail.com> wrote:
> > >
> > > I dont' understand. You rely on the way how wicket generates IDs? Then
> > > your code is bound to break. If you really need a wicket component's
> > > id in javascript, you either override getMarkupId(), or pass the Id
> > > using javascript (e.g. label component assigning another component's
> > > id into javascript variable).
> >
> >
> > You've got to be kidding me.  You can just override getMarkupId() and
> > avoid
> > the mess of autogenerated wicket ids??  I never knew that!
> >
>

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


Re: [RFE] getMarkupId()

Posted by Igor Vaynberg <ig...@gmail.com>.
you can, but then good luck making sure they are unique...

-igor


On 9/21/07, Ryan Sonnek <ry...@gmail.com> wrote:
>
> On 9/21/07, Matej Knopp <ma...@gmail.com> wrote:
> >
> > I dont' understand. You rely on the way how wicket generates IDs? Then
> > your code is bound to break. If you really need a wicket component's
> > id in javascript, you either override getMarkupId(), or pass the Id
> > using javascript (e.g. label component assigning another component's
> > id into javascript variable).
>
>
> You've got to be kidding me.  You can just override getMarkupId() and
> avoid
> the mess of autogenerated wicket ids??  I never knew that!
>

Re: [RFE] getMarkupId()

Posted by Ryan Sonnek <ry...@gmail.com>.
On 9/21/07, Matej Knopp <ma...@gmail.com> wrote:
>
> I dont' understand. You rely on the way how wicket generates IDs? Then
> your code is bound to break. If you really need a wicket component's
> id in javascript, you either override getMarkupId(), or pass the Id
> using javascript (e.g. label component assigning another component's
> id into javascript variable).


You've got to be kidding me.  You can just override getMarkupId() and avoid
the mess of autogenerated wicket ids??  I never knew that!

Re: [RFE] getMarkupId()

Posted by Sam Hough <sa...@redspr.com>.
Oooh. Interesting. I'll see if the html monkey likes it. Thanks.



Alex Objelean wrote:
> 
> Yes, I do rely on wicket generated ID. But it will never break because the
> javascript code which use these ID is supplied with generated id. For
> instance:
> 
> 
> function doSomethingWithWicketComponent(config) {
>   var el = document.getElementById('#' + config.id);
>   //do something with el.
> }
> 
> where config is JSON containing wicket markup id.
> 
> and call the function this way:
> 
> doSomethingWithWicketComponent({'id':/*here will be inserted dynamically
> generated wicket markup ID*/});
> 
> This function is called when component is being rendered.
> 
> Generation of wicket markup ID helps very much in such situations, because
> I do not want to hardcode ID in the markup, and also wicket guaranties the
> unicity of the ID attribute.
> 
> 
> Matej Knopp-2 wrote:
>> 
>> I dont' understand. You rely on the way how wicket generates IDs? Then
>> your code is bound to break. If you really need a wicket component's
>> id in javascript, you either override getMarkupId(), or pass the Id
>> using javascript (e.g. label component assigning another component's
>> id into javascript variable).
>> 
>> -Matej
>> 
>> On 9/21/07, Sam Hough <sa...@redspr.com> wrote:
>>>
>>> So you use it just because of the performance of the browser DOM? Not
>>> because
>>> it has to be unique?
>>>
>>> Are you using Ajax? ie forced to do setOutputMarkupId? We are and that
>>> is
>>> probably the biggest reason we are trying to avoid them.
>>>
>>>
>>>
>>>
>>>
>>> Alex Objelean wrote:
>>> >
>>> >
>>> > In my application I extensively use the component generated id to
>>> perform
>>> > some DOM updates on the client side, also for client-side validation.
>>> >
>>> > Also getting a DOM element by its ID is the fastest method comparing
>>> with
>>> > finding it using it's css class.
>>> >
>>> >
>>> >
>>> > Sam Hough wrote:
>>> >>
>>> >> When is the killer case for using id?
>>> >>
>>> >>
>>> >>
>>> >> Alex Objelean wrote:
>>> >>>
>>> >>> My personal opinion is that switching from id to class is not such a
>>> >>> good idea, simply because the ID attributes guaranties (of course
>>> you
>>> >>> can create two elements with same ID, but it is not the same as with
>>> >>> class attribute) the unicity of the element, also you can find the
>>> >>> element from js using document.getElementById...
>>> >>>
>>> >>> I hope that this radical change will not be made in the 1.3 release
>>> as
>>> >>> it has a great impact on any application developed using the latest
>>> >>> beta3 release. Also I think this issue should be discussed more
>>> between
>>> >>> the core developers.
>>> >>>
>>> >>> Alex.
>>> >>>
>>> >>>
>>> >>> Sam Hough wrote:
>>> >>>>
>>> >>>> We are going to stop using ids and move over to class as it make
>>> re-use
>>> >>>> easier and avoids a number of wicket problems with ids... The HTML
>>> >>>> monkey is not happy though. He reminds me of the Family Guy
>>> screaming
>>> >>>> monkey today.
>>> >>>>
>>> >>>>
>>> >>>>
>>> >>>> Alex Objelean wrote:
>>> >>>>>
>>> >>>>> This is about how wicket generates dynamically markupID.
>>> >>>>>
>>> >>>>> I have, for instance, the following markup component:
>>> >>>>>
>>> >>>>> <input wicket:id="quantity.noOfUnits" />
>>> >>>>>
>>> >>>>> The generated markupId for this component looks like the
>>> following:
>>> >>>>> quantity.noOfUnits1232 .
>>> >>>>>
>>> >>>>> I suggest to escape any css valid specifiers from the generated
>>> >>>>> markupId, by replacing them with something else (for instance '_'
>>> >>>>> character).
>>> >>>>>
>>> >>>>> The problem appear when I am trying to identify the component by
>>> it's
>>> >>>>> id using some js library (like jQuery) and as a consequence the
>>> result
>>> >>>>> of this query: $("#quantity.noOfUnits1232") is invalid.
>>> >>>>>
>>> >>>>> Thank you!
>>> >>>>>
>>> >>>>> Alex.
>>> >>>>>
>>> >>>>
>>> >>>>
>>> >>>
>>> >>>
>>> >>
>>> >>
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/-RFE--getMarkupId%28%29-tf4493344.html#a12821835
>>> 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
>>>
>>>
>> 
>> ---------------------------------------------------------------------
>> 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/-RFE--getMarkupId%28%29-tf4493344.html#a12822191
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: [RFE] getMarkupId()

Posted by Alex Objelean <al...@isdc.ro>.
Yes,  do rely on wicket generated ID. But it will never break because the
javascript code which use these ID is supplied with generated id. For
instance:


function doSomethingWithWicketComponent(config) {
  var el = document.getElementById('#' + config.id);
  //do something with el.
}

where config is JSON containing wicket markup id.

and call the function this way:

doSomethingWithWicketComponent({'id':/*here will be inserted dynamically
generated wicket markup ID*/});

This function is called when component is being rendered.

Generation of wicket markup ID helps very much in such situations, because I
do not want to hardcode ID in the markup, and also wicket guaranties the
unicity of the ID attribute.


Matej Knopp-2 wrote:
> 
> I dont' understand. You rely on the way how wicket generates IDs? Then
> your code is bound to break. If you really need a wicket component's
> id in javascript, you either override getMarkupId(), or pass the Id
> using javascript (e.g. label component assigning another component's
> id into javascript variable).
> 
> -Matej
> 
> On 9/21/07, Sam Hough <sa...@redspr.com> wrote:
>>
>> So you use it just because of the performance of the browser DOM? Not
>> because
>> it has to be unique?
>>
>> Are you using Ajax? ie forced to do setOutputMarkupId? We are and that is
>> probably the biggest reason we are trying to avoid them.
>>
>>
>>
>>
>>
>> Alex Objelean wrote:
>> >
>> >
>> > In my application I extensively use the component generated id to
>> perform
>> > some DOM updates on the client side, also for client-side validation.
>> >
>> > Also getting a DOM element by its ID is the fastest method comparing
>> with
>> > finding it using it's css class.
>> >
>> >
>> >
>> > Sam Hough wrote:
>> >>
>> >> When is the killer case for using id?
>> >>
>> >>
>> >>
>> >> Alex Objelean wrote:
>> >>>
>> >>> My personal opinion is that switching from id to class is not such a
>> >>> good idea, simply because the ID attributes guaranties (of course you
>> >>> can create two elements with same ID, but it is not the same as with
>> >>> class attribute) the unicity of the element, also you can find the
>> >>> element from js using document.getElementById...
>> >>>
>> >>> I hope that this radical change will not be made in the 1.3 release
>> as
>> >>> it has a great impact on any application developed using the latest
>> >>> beta3 release. Also I think this issue should be discussed more
>> between
>> >>> the core developers.
>> >>>
>> >>> Alex.
>> >>>
>> >>>
>> >>> Sam Hough wrote:
>> >>>>
>> >>>> We are going to stop using ids and move over to class as it make
>> re-use
>> >>>> easier and avoids a number of wicket problems with ids... The HTML
>> >>>> monkey is not happy though. He reminds me of the Family Guy
>> screaming
>> >>>> monkey today.
>> >>>>
>> >>>>
>> >>>>
>> >>>> Alex Objelean wrote:
>> >>>>>
>> >>>>> This is about how wicket generates dynamically markupID.
>> >>>>>
>> >>>>> I have, for instance, the following markup component:
>> >>>>>
>> >>>>> <input wicket:id="quantity.noOfUnits" />
>> >>>>>
>> >>>>> The generated markupId for this component looks like the following:
>> >>>>> quantity.noOfUnits1232 .
>> >>>>>
>> >>>>> I suggest to escape any css valid specifiers from the generated
>> >>>>> markupId, by replacing them with something else (for instance '_'
>> >>>>> character).
>> >>>>>
>> >>>>> The problem appear when I am trying to identify the component by
>> it's
>> >>>>> id using some js library (like jQuery) and as a consequence the
>> result
>> >>>>> of this query: $("#quantity.noOfUnits1232") is invalid.
>> >>>>>
>> >>>>> Thank you!
>> >>>>>
>> >>>>> Alex.
>> >>>>>
>> >>>>
>> >>>>
>> >>>
>> >>>
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-RFE--getMarkupId%28%29-tf4493344.html#a12821835
>> 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
>>
>>
> 
> ---------------------------------------------------------------------
> 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/-RFE--getMarkupId%28%29-tf4493344.html#a12822188
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: [RFE] getMarkupId()

Posted by Igor Vaynberg <ig...@gmail.com>.
this is not correct at all. if you always use getmarkupid() and feed it to
your javascript/etc it should all always work, and this is - at least mine -
preferred way of doing this.

-igor


On 9/21/07, Matej Knopp <ma...@gmail.com> wrote:
>
> I dont' understand. You rely on the way how wicket generates IDs? Then
> your code is bound to break. If you really need a wicket component's
> id in javascript, you either override getMarkupId(), or pass the Id
> using javascript (e.g. label component assigning another component's
> id into javascript variable).
>
> -Matej
>
> On 9/21/07, Sam Hough <sa...@redspr.com> wrote:
> >
> > So you use it just because of the performance of the browser DOM? Not
> because
> > it has to be unique?
> >
> > Are you using Ajax? ie forced to do setOutputMarkupId? We are and that
> is
> > probably the biggest reason we are trying to avoid them.
> >
> >
> >
> >
> >
> > Alex Objelean wrote:
> > >
> > >
> > > In my application I extensively use the component generated id to
> perform
> > > some DOM updates on the client side, also for client-side validation.
> > >
> > > Also getting a DOM element by its ID is the fastest method comparing
> with
> > > finding it using it's css class.
> > >
> > >
> > >
> > > Sam Hough wrote:
> > >>
> > >> When is the killer case for using id?
> > >>
> > >>
> > >>
> > >> Alex Objelean wrote:
> > >>>
> > >>> My personal opinion is that switching from id to class is not such a
> > >>> good idea, simply because the ID attributes guaranties (of course
> you
> > >>> can create two elements with same ID, but it is not the same as with
> > >>> class attribute) the unicity of the element, also you can find the
> > >>> element from js using document.getElementById...
> > >>>
> > >>> I hope that this radical change will not be made in the 1.3 release
> as
> > >>> it has a great impact on any application developed using the latest
> > >>> beta3 release. Also I think this issue should be discussed more
> between
> > >>> the core developers.
> > >>>
> > >>> Alex.
> > >>>
> > >>>
> > >>> Sam Hough wrote:
> > >>>>
> > >>>> We are going to stop using ids and move over to class as it make
> re-use
> > >>>> easier and avoids a number of wicket problems with ids... The HTML
> > >>>> monkey is not happy though. He reminds me of the Family Guy
> screaming
> > >>>> monkey today.
> > >>>>
> > >>>>
> > >>>>
> > >>>> Alex Objelean wrote:
> > >>>>>
> > >>>>> This is about how wicket generates dynamically markupID.
> > >>>>>
> > >>>>> I have, for instance, the following markup component:
> > >>>>>
> > >>>>> <input wicket:id="quantity.noOfUnits" />
> > >>>>>
> > >>>>> The generated markupId for this component looks like the
> following:
> > >>>>> quantity.noOfUnits1232 .
> > >>>>>
> > >>>>> I suggest to escape any css valid specifiers from the generated
> > >>>>> markupId, by replacing them with something else (for instance '_'
> > >>>>> character).
> > >>>>>
> > >>>>> The problem appear when I am trying to identify the component by
> it's
> > >>>>> id using some js library (like jQuery) and as a consequence the
> result
> > >>>>> of this query: $("#quantity.noOfUnits1232") is invalid.
> > >>>>>
> > >>>>> Thank you!
> > >>>>>
> > >>>>> Alex.
> > >>>>>
> > >>>>
> > >>>>
> > >>>
> > >>>
> > >>
> > >>
> > >
> > >
> >
> > --
> > View this message in context:
> http://www.nabble.com/-RFE--getMarkupId%28%29-tf4493344.html#a12821835
> > 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
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: [RFE] getMarkupId()

Posted by Matej Knopp <ma...@gmail.com>.
I dont' understand. You rely on the way how wicket generates IDs? Then
your code is bound to break. If you really need a wicket component's
id in javascript, you either override getMarkupId(), or pass the Id
using javascript (e.g. label component assigning another component's
id into javascript variable).

-Matej

On 9/21/07, Sam Hough <sa...@redspr.com> wrote:
>
> So you use it just because of the performance of the browser DOM? Not because
> it has to be unique?
>
> Are you using Ajax? ie forced to do setOutputMarkupId? We are and that is
> probably the biggest reason we are trying to avoid them.
>
>
>
>
>
> Alex Objelean wrote:
> >
> >
> > In my application I extensively use the component generated id to perform
> > some DOM updates on the client side, also for client-side validation.
> >
> > Also getting a DOM element by its ID is the fastest method comparing with
> > finding it using it's css class.
> >
> >
> >
> > Sam Hough wrote:
> >>
> >> When is the killer case for using id?
> >>
> >>
> >>
> >> Alex Objelean wrote:
> >>>
> >>> My personal opinion is that switching from id to class is not such a
> >>> good idea, simply because the ID attributes guaranties (of course you
> >>> can create two elements with same ID, but it is not the same as with
> >>> class attribute) the unicity of the element, also you can find the
> >>> element from js using document.getElementById...
> >>>
> >>> I hope that this radical change will not be made in the 1.3 release as
> >>> it has a great impact on any application developed using the latest
> >>> beta3 release. Also I think this issue should be discussed more between
> >>> the core developers.
> >>>
> >>> Alex.
> >>>
> >>>
> >>> Sam Hough wrote:
> >>>>
> >>>> We are going to stop using ids and move over to class as it make re-use
> >>>> easier and avoids a number of wicket problems with ids... The HTML
> >>>> monkey is not happy though. He reminds me of the Family Guy screaming
> >>>> monkey today.
> >>>>
> >>>>
> >>>>
> >>>> Alex Objelean wrote:
> >>>>>
> >>>>> This is about how wicket generates dynamically markupID.
> >>>>>
> >>>>> I have, for instance, the following markup component:
> >>>>>
> >>>>> <input wicket:id="quantity.noOfUnits" />
> >>>>>
> >>>>> The generated markupId for this component looks like the following:
> >>>>> quantity.noOfUnits1232 .
> >>>>>
> >>>>> I suggest to escape any css valid specifiers from the generated
> >>>>> markupId, by replacing them with something else (for instance '_'
> >>>>> character).
> >>>>>
> >>>>> The problem appear when I am trying to identify the component by it's
> >>>>> id using some js library (like jQuery) and as a consequence the result
> >>>>> of this query: $("#quantity.noOfUnits1232") is invalid.
> >>>>>
> >>>>> Thank you!
> >>>>>
> >>>>> Alex.
> >>>>>
> >>>>
> >>>>
> >>>
> >>>
> >>
> >>
> >
> >
>
> --
> View this message in context: http://www.nabble.com/-RFE--getMarkupId%28%29-tf4493344.html#a12821835
> 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
>
>

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


Re: [RFE] getMarkupId()

Posted by Sam Hough <sa...@redspr.com>.
Just to be pedantic even in your odd/even example that could work with
classes since an element can have more than one class...

I think the performance problem for the browser trying to find an element by
class is the bigger problem. Although in many cases events are just attached
to elements that happen to have a particular class.

Quite often HTML monkeys (not ours of course) get carried away with ids and
use them to apply a particular behaviour rather than identifying a unique
element.

Wicket shifts a lot of the Ajax stuff away from the HTML monkey for things
like updating elements so it may be more natural to ask them to just attach
behaviours to elements we mark with a particular class. In that way we don't
have to worry about re-use, we may be able to mix and match styles and
client side effects etc.

I am definitely not suggesting that wicket doesn't update/use ids to mark
elements just that we are planning to rely less on them being known before
runtime. So CSS etc should be more class rather than id heavy.



Maris Orbidans-2 wrote:
> 
> 
> I use ajax as well, but I don't understand what's the problem with 
> setOutputMarkupId ?
> 
> In any case I am sure that forcing unique class attributes will create 
> much bigger problem.  Almost any non trivial web design uses identical 
> class values in many places.  Sometimes CSS class is used just to
> specify background color or something that is applied to many html tags. 
> Are you saying that it's going to be impossible ?   I am afraid that 
> many developers (including me) won't be able to use wicket anymore.
>  
> Maris
> 
>> So you use it just because of the performance of the browser DOM? Not
>> because
>> it has to be unique? 
>>
>> Are you using Ajax? ie forced to do setOutputMarkupId? We are and that is
>> probably the biggest reason we are trying to avoid them.
>>
>>
>>
>>
>>
>> Alex Objelean wrote:
>>   
>>> In my application I extensively use the component generated id to
>>> perform
>>> some DOM updates on the client side, also for client-side validation.
>>>
>>> Also getting a DOM element by its ID is the fastest method comparing
>>> with
>>> finding it using it's css class.
>>>
>>>
>>>
>>> Sam Hough wrote:
>>>     
>>>> When is the killer case for using id?
>>>>
>>>>
>>>>
>>>> Alex Objelean wrote:
>>>>       
>>>>> My personal opinion is that switching from id to class is not such a
>>>>> good idea, simply because the ID attributes guaranties (of course you
>>>>> can create two elements with same ID, but it is not the same as with
>>>>> class attribute) the unicity of the element, also you can find the
>>>>> element from js using document.getElementById... 
>>>>>
>>>>> I hope that this radical change will not be made in the 1.3 release as
>>>>> it has a great impact on any application developed using the latest
>>>>> beta3 release. Also I think this issue should be discussed more
>>>>> between
>>>>> the core developers.
>>>>>
>>>>> Alex.
>>>>>
>>>>>
>>>>> Sam Hough wrote:
>>>>>         
>>>>>> We are going to stop using ids and move over to class as it make
>>>>>> re-use
>>>>>> easier and avoids a number of wicket problems with ids... The HTML
>>>>>> monkey is not happy though. He reminds me of the Family Guy screaming
>>>>>> monkey today.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Alex Objelean wrote:
>>>>>>           
>>>>>>> This is about how wicket generates dynamically markupID.
>>>>>>>
>>>>>>> I have, for instance, the following markup component: 
>>>>>>>
>>>>>>> <input wicket:id="quantity.noOfUnits" />
>>>>>>>
>>>>>>> The generated markupId for this component looks like the following:
>>>>>>> quantity.noOfUnits1232 .
>>>>>>>
>>>>>>> I suggest to escape any css valid specifiers from the generated
>>>>>>> markupId, by replacing them with something else (for instance '_'
>>>>>>> character). 
>>>>>>>
>>>>>>> The problem appear when I am trying to identify the component by
>>>>>>> it's
>>>>>>> id using some js library (like jQuery) and as a consequence the
>>>>>>> result
>>>>>>> of this query: $("#quantity.noOfUnits1232") is invalid.
>>>>>>>
>>>>>>> Thank you!
>>>>>>>
>>>>>>> Alex.
>>>>>>>
>>>>>>>             
>>>>>>           
>>>>>         
>>>>       
>>>     
>>
>>   
> 
> ---------------------------------------------------------------------
> 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/-RFE--getMarkupId%28%29-tf4493344.html#a12855924
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: [RFE] getMarkupId()

Posted by Maris Orbidans <sm...@ime.lv>.
I use ajax as well, but I don't understand what's the problem with 
setOutputMarkupId ?

In any case I am sure that forcing unique class attributes will create 
much bigger problem.  Almost any non trivial web design uses identical 
class values in many places.  Sometimes CSS class is used just to
specify background color or something that is applied to many html tags. 
Are you saying that it's going to be impossible ?   I am afraid that 
many developers (including me) won't be able to use wicket anymore.
 
Maris

> So you use it just because of the performance of the browser DOM? Not because
> it has to be unique? 
>
> Are you using Ajax? ie forced to do setOutputMarkupId? We are and that is
> probably the biggest reason we are trying to avoid them.
>
>
>
>
>
> Alex Objelean wrote:
>   
>> In my application I extensively use the component generated id to perform
>> some DOM updates on the client side, also for client-side validation.
>>
>> Also getting a DOM element by its ID is the fastest method comparing with
>> finding it using it's css class.
>>
>>
>>
>> Sam Hough wrote:
>>     
>>> When is the killer case for using id?
>>>
>>>
>>>
>>> Alex Objelean wrote:
>>>       
>>>> My personal opinion is that switching from id to class is not such a
>>>> good idea, simply because the ID attributes guaranties (of course you
>>>> can create two elements with same ID, but it is not the same as with
>>>> class attribute) the unicity of the element, also you can find the
>>>> element from js using document.getElementById... 
>>>>
>>>> I hope that this radical change will not be made in the 1.3 release as
>>>> it has a great impact on any application developed using the latest
>>>> beta3 release. Also I think this issue should be discussed more between
>>>> the core developers.
>>>>
>>>> Alex.
>>>>
>>>>
>>>> Sam Hough wrote:
>>>>         
>>>>> We are going to stop using ids and move over to class as it make re-use
>>>>> easier and avoids a number of wicket problems with ids... The HTML
>>>>> monkey is not happy though. He reminds me of the Family Guy screaming
>>>>> monkey today.
>>>>>
>>>>>
>>>>>
>>>>> Alex Objelean wrote:
>>>>>           
>>>>>> This is about how wicket generates dynamically markupID.
>>>>>>
>>>>>> I have, for instance, the following markup component: 
>>>>>>
>>>>>> <input wicket:id="quantity.noOfUnits" />
>>>>>>
>>>>>> The generated markupId for this component looks like the following:
>>>>>> quantity.noOfUnits1232 .
>>>>>>
>>>>>> I suggest to escape any css valid specifiers from the generated
>>>>>> markupId, by replacing them with something else (for instance '_'
>>>>>> character). 
>>>>>>
>>>>>> The problem appear when I am trying to identify the component by it's
>>>>>> id using some js library (like jQuery) and as a consequence the result
>>>>>> of this query: $("#quantity.noOfUnits1232") is invalid.
>>>>>>
>>>>>> Thank you!
>>>>>>
>>>>>> Alex.
>>>>>>
>>>>>>             
>>>>>           
>>>>         
>>>       
>>     
>
>   

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


Re: [RFE] getMarkupId()

Posted by Alex Objelean <al...@isdc.ro>.
Currently wicket guaranties unicity of the ID by appending a incremented
number:
markupId = getId() + page.getAutoIndex();

You will never have two wicket components with the same markupID.


Sam Hough wrote:
> 
> What do you do about components in RepeatingView? (with numeric ids)
> 
> So do you just make sure all your wicket ids are universally unique? So
> none that are just "form", "label", "button" etc? I quite like using
> "button" if only one within the container...
> 
> What if you want to use the same component twice?
> 
> 
> 
> Alex Objelean wrote:
>> 
>> Performance on the client side is very important when you are working
>> with very large DOM (complex applications). The responsiveness of the
>> application is very important in this cases. 
>> 
>> Yes, I'm using ajax. I don't find it as a big drawback to set the
>> outputMarkupId to true when I need explicitly a component to have
>> generated Id. 
>> 
>> 
>> Sam Hough wrote:
>>> 
>>> So you use it just because of the performance of the browser DOM? Not
>>> because it has to be unique? 
>>> 
>>> Are you using Ajax? ie forced to do setOutputMarkupId? We are and that
>>> is probably the biggest reason we are trying to avoid them.
>>> 
>>> 
>>> 
>>> 
>>> 
>>> Alex Objelean wrote:
>>>> 
>>>> 
>>>> In my application I extensively use the component generated id to
>>>> perform some DOM updates on the client side, also for client-side
>>>> validation.
>>>> 
>>>> Also getting a DOM element by its ID is the fastest method comparing
>>>> with finding it using it's css class.
>>>> 
>>>> 
>>>> 
>>>> Sam Hough wrote:
>>>>> 
>>>>> When is the killer case for using id?
>>>>> 
>>>>> 
>>>>> 
>>>>> Alex Objelean wrote:
>>>>>> 
>>>>>> My personal opinion is that switching from id to class is not such a
>>>>>> good idea, simply because the ID attributes guaranties (of course you
>>>>>> can create two elements with same ID, but it is not the same as with
>>>>>> class attribute) the unicity of the element, also you can find the
>>>>>> element from js using document.getElementById... 
>>>>>> 
>>>>>> I hope that this radical change will not be made in the 1.3 release
>>>>>> as it has a great impact on any application developed using the
>>>>>> latest beta3 release. Also I think this issue should be discussed
>>>>>> more between the core developers.
>>>>>> 
>>>>>> Alex.
>>>>>> 
>>>>>> 
>>>>>> Sam Hough wrote:
>>>>>>> 
>>>>>>> We are going to stop using ids and move over to class as it make
>>>>>>> re-use easier and avoids a number of wicket problems with ids... The
>>>>>>> HTML monkey is not happy though. He reminds me of the Family Guy
>>>>>>> screaming monkey today.
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> Alex Objelean wrote:
>>>>>>>> 
>>>>>>>> This is about how wicket generates dynamically markupID.
>>>>>>>> 
>>>>>>>> I have, for instance, the following markup component: 
>>>>>>>> 
>>>>>>>> <input wicket:id="quantity.noOfUnits" />
>>>>>>>> 
>>>>>>>> The generated markupId for this component looks like the following:
>>>>>>>> quantity.noOfUnits1232 .
>>>>>>>> 
>>>>>>>> I suggest to escape any css valid specifiers from the generated
>>>>>>>> markupId, by replacing them with something else (for instance '_'
>>>>>>>> character). 
>>>>>>>> 
>>>>>>>> The problem appear when I am trying to identify the component by
>>>>>>>> it's id using some js library (like jQuery) and as a consequence
>>>>>>>> the result of this query: $("#quantity.noOfUnits1232") is invalid.
>>>>>>>> 
>>>>>>>> Thank you!
>>>>>>>> 
>>>>>>>> Alex.
>>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-RFE--getMarkupId%28%29-tf4493344.html#a12822124
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: [RFE] getMarkupId()

Posted by Sam Hough <sa...@redspr.com>.
What do you do about components in RepeatingView? (with numeric ids)

So do you just make sure all your wicket ids are universally unique? So none
that are just "form", "label", "button" etc? I quite like using "button" if
only one within the container...

What if you want to use the same component twice?



Alex Objelean wrote:
> 
> Performance on the client side is very important when you are working with
> very large DOM (complex applications). The responsiveness of the
> application is very important in this cases. 
> 
> Yes, I'm using ajax. I don't find it as a big drawback to set the
> outputMarkupId to true when I need explicitly a component to have
> generated Id. 
> 
> 
> Sam Hough wrote:
>> 
>> So you use it just because of the performance of the browser DOM? Not
>> because it has to be unique? 
>> 
>> Are you using Ajax? ie forced to do setOutputMarkupId? We are and that is
>> probably the biggest reason we are trying to avoid them.
>> 
>> 
>> 
>> 
>> 
>> Alex Objelean wrote:
>>> 
>>> 
>>> In my application I extensively use the component generated id to
>>> perform some DOM updates on the client side, also for client-side
>>> validation.
>>> 
>>> Also getting a DOM element by its ID is the fastest method comparing
>>> with finding it using it's css class.
>>> 
>>> 
>>> 
>>> Sam Hough wrote:
>>>> 
>>>> When is the killer case for using id?
>>>> 
>>>> 
>>>> 
>>>> Alex Objelean wrote:
>>>>> 
>>>>> My personal opinion is that switching from id to class is not such a
>>>>> good idea, simply because the ID attributes guaranties (of course you
>>>>> can create two elements with same ID, but it is not the same as with
>>>>> class attribute) the unicity of the element, also you can find the
>>>>> element from js using document.getElementById... 
>>>>> 
>>>>> I hope that this radical change will not be made in the 1.3 release as
>>>>> it has a great impact on any application developed using the latest
>>>>> beta3 release. Also I think this issue should be discussed more
>>>>> between the core developers.
>>>>> 
>>>>> Alex.
>>>>> 
>>>>> 
>>>>> Sam Hough wrote:
>>>>>> 
>>>>>> We are going to stop using ids and move over to class as it make
>>>>>> re-use easier and avoids a number of wicket problems with ids... The
>>>>>> HTML monkey is not happy though. He reminds me of the Family Guy
>>>>>> screaming monkey today.
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> Alex Objelean wrote:
>>>>>>> 
>>>>>>> This is about how wicket generates dynamically markupID.
>>>>>>> 
>>>>>>> I have, for instance, the following markup component: 
>>>>>>> 
>>>>>>> <input wicket:id="quantity.noOfUnits" />
>>>>>>> 
>>>>>>> The generated markupId for this component looks like the following:
>>>>>>> quantity.noOfUnits1232 .
>>>>>>> 
>>>>>>> I suggest to escape any css valid specifiers from the generated
>>>>>>> markupId, by replacing them with something else (for instance '_'
>>>>>>> character). 
>>>>>>> 
>>>>>>> The problem appear when I am trying to identify the component by
>>>>>>> it's id using some js library (like jQuery) and as a consequence the
>>>>>>> result of this query: $("#quantity.noOfUnits1232") is invalid.
>>>>>>> 
>>>>>>> Thank you!
>>>>>>> 
>>>>>>> Alex.
>>>>>>> 
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-RFE--getMarkupId%28%29-tf4493344.html#a12822009
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: [RFE] getMarkupId()

Posted by Alex Objelean <al...@isdc.ro>.
Performance on the client side is very important when you are working with
very large DOM (complex applications). The responsiveness of the application
is very important in this cases. 

Yes, I'm using ajax. I don't find it as a big drawback to set the
outputMarkupId to true when I need explicitly a component to have generated
Id. 


Sam Hough wrote:
> 
> So you use it just because of the performance of the browser DOM? Not
> because it has to be unique? 
> 
> Are you using Ajax? ie forced to do setOutputMarkupId? We are and that is
> probably the biggest reason we are trying to avoid them.
> 
> 
> 
> 
> 
> Alex Objelean wrote:
>> 
>> 
>> In my application I extensively use the component generated id to perform
>> some DOM updates on the client side, also for client-side validation.
>> 
>> Also getting a DOM element by its ID is the fastest method comparing with
>> finding it using it's css class.
>> 
>> 
>> 
>> Sam Hough wrote:
>>> 
>>> When is the killer case for using id?
>>> 
>>> 
>>> 
>>> Alex Objelean wrote:
>>>> 
>>>> My personal opinion is that switching from id to class is not such a
>>>> good idea, simply because the ID attributes guaranties (of course you
>>>> can create two elements with same ID, but it is not the same as with
>>>> class attribute) the unicity of the element, also you can find the
>>>> element from js using document.getElementById... 
>>>> 
>>>> I hope that this radical change will not be made in the 1.3 release as
>>>> it has a great impact on any application developed using the latest
>>>> beta3 release. Also I think this issue should be discussed more between
>>>> the core developers.
>>>> 
>>>> Alex.
>>>> 
>>>> 
>>>> Sam Hough wrote:
>>>>> 
>>>>> We are going to stop using ids and move over to class as it make
>>>>> re-use easier and avoids a number of wicket problems with ids... The
>>>>> HTML monkey is not happy though. He reminds me of the Family Guy
>>>>> screaming monkey today.
>>>>> 
>>>>> 
>>>>> 
>>>>> Alex Objelean wrote:
>>>>>> 
>>>>>> This is about how wicket generates dynamically markupID.
>>>>>> 
>>>>>> I have, for instance, the following markup component: 
>>>>>> 
>>>>>> <input wicket:id="quantity.noOfUnits" />
>>>>>> 
>>>>>> The generated markupId for this component looks like the following:
>>>>>> quantity.noOfUnits1232 .
>>>>>> 
>>>>>> I suggest to escape any css valid specifiers from the generated
>>>>>> markupId, by replacing them with something else (for instance '_'
>>>>>> character). 
>>>>>> 
>>>>>> The problem appear when I am trying to identify the component by it's
>>>>>> id using some js library (like jQuery) and as a consequence the
>>>>>> result of this query: $("#quantity.noOfUnits1232") is invalid.
>>>>>> 
>>>>>> Thank you!
>>>>>> 
>>>>>> Alex.
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-RFE--getMarkupId%28%29-tf4493344.html#a12821875
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: [RFE] getMarkupId()

Posted by Sam Hough <sa...@redspr.com>.
So you use it just because of the performance of the browser DOM? Not because
it has to be unique? 

Are you using Ajax? ie forced to do setOutputMarkupId? We are and that is
probably the biggest reason we are trying to avoid them.





Alex Objelean wrote:
> 
> 
> In my application I extensively use the component generated id to perform
> some DOM updates on the client side, also for client-side validation.
> 
> Also getting a DOM element by its ID is the fastest method comparing with
> finding it using it's css class.
> 
> 
> 
> Sam Hough wrote:
>> 
>> When is the killer case for using id?
>> 
>> 
>> 
>> Alex Objelean wrote:
>>> 
>>> My personal opinion is that switching from id to class is not such a
>>> good idea, simply because the ID attributes guaranties (of course you
>>> can create two elements with same ID, but it is not the same as with
>>> class attribute) the unicity of the element, also you can find the
>>> element from js using document.getElementById... 
>>> 
>>> I hope that this radical change will not be made in the 1.3 release as
>>> it has a great impact on any application developed using the latest
>>> beta3 release. Also I think this issue should be discussed more between
>>> the core developers.
>>> 
>>> Alex.
>>> 
>>> 
>>> Sam Hough wrote:
>>>> 
>>>> We are going to stop using ids and move over to class as it make re-use
>>>> easier and avoids a number of wicket problems with ids... The HTML
>>>> monkey is not happy though. He reminds me of the Family Guy screaming
>>>> monkey today.
>>>> 
>>>> 
>>>> 
>>>> Alex Objelean wrote:
>>>>> 
>>>>> This is about how wicket generates dynamically markupID.
>>>>> 
>>>>> I have, for instance, the following markup component: 
>>>>> 
>>>>> <input wicket:id="quantity.noOfUnits" />
>>>>> 
>>>>> The generated markupId for this component looks like the following:
>>>>> quantity.noOfUnits1232 .
>>>>> 
>>>>> I suggest to escape any css valid specifiers from the generated
>>>>> markupId, by replacing them with something else (for instance '_'
>>>>> character). 
>>>>> 
>>>>> The problem appear when I am trying to identify the component by it's
>>>>> id using some js library (like jQuery) and as a consequence the result
>>>>> of this query: $("#quantity.noOfUnits1232") is invalid.
>>>>> 
>>>>> Thank you!
>>>>> 
>>>>> Alex.
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-RFE--getMarkupId%28%29-tf4493344.html#a12821835
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: [RFE] getMarkupId()

Posted by Alex Objelean <al...@isdc.ro>.

In my application I extensively use the component generated id to perform
some DOM updates on the client side, also for client-side validation.

Also getting a DOM element by its ID is the fastest method comparing with
finding it using it's css class.



Sam Hough wrote:
> 
> When is the killer case for using id?
> 
> 
> 
> Alex Objelean wrote:
>> 
>> My personal opinion is that switching from id to class is not such a good
>> idea, simply because the ID attributes guaranties (of course you can
>> create two elements with same ID, but it is not the same as with class
>> attribute) the unicity of the element, also you can find the element from
>> js using document.getElementById... 
>> 
>> I hope that this radical change will not be made in the 1.3 release as it
>> has a great impact on any application developed using the latest beta3
>> release. Also I think this issue should be discussed more between the
>> core developers.
>> 
>> Alex.
>> 
>> 
>> Sam Hough wrote:
>>> 
>>> We are going to stop using ids and move over to class as it make re-use
>>> easier and avoids a number of wicket problems with ids... The HTML
>>> monkey is not happy though. He reminds me of the Family Guy screaming
>>> monkey today.
>>> 
>>> 
>>> 
>>> Alex Objelean wrote:
>>>> 
>>>> This is about how wicket generates dynamically markupID.
>>>> 
>>>> I have, for instance, the following markup component: 
>>>> 
>>>> <input wicket:id="quantity.noOfUnits" />
>>>> 
>>>> The generated markupId for this component looks like the following:
>>>> quantity.noOfUnits1232 .
>>>> 
>>>> I suggest to escape any css valid specifiers from the generated
>>>> markupId, by replacing them with something else (for instance '_'
>>>> character). 
>>>> 
>>>> The problem appear when I am trying to identify the component by it's
>>>> id using some js library (like jQuery) and as a consequence the result
>>>> of this query: $("#quantity.noOfUnits1232") is invalid.
>>>> 
>>>> Thank you!
>>>> 
>>>> Alex.
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-RFE--getMarkupId%28%29-tf4493344.html#a12821763
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: [RFE] getMarkupId()

Posted by Sam Hough <sa...@redspr.com>.
When is the killer case for using id?



Alex Objelean wrote:
> 
> My personal opinion is that switching from id to class is not such a good
> idea, simply because the ID attributes guaranties (of course you can
> create two elements with same ID, but it is not the same as with class
> attribute) the unicity of the element, also you can find the element from
> js using document.getElementById... 
> 
> I hope that this radical change will not be made in the 1.3 release as it
> has a great impact on any application developed using the latest beta3
> release. Also I think this issue should be discussed more between the core
> developers.
> 
> Alex.
> 
> 
> Sam Hough wrote:
>> 
>> We are going to stop using ids and move over to class as it make re-use
>> easier and avoids a number of wicket problems with ids... The HTML monkey
>> is not happy though. He reminds me of the Family Guy screaming monkey
>> today.
>> 
>> 
>> 
>> Alex Objelean wrote:
>>> 
>>> This is about how wicket generates dynamically markupID.
>>> 
>>> I have, for instance, the following markup component: 
>>> 
>>> <input wicket:id="quantity.noOfUnits" />
>>> 
>>> The generated markupId for this component looks like the following:
>>> quantity.noOfUnits1232 .
>>> 
>>> I suggest to escape any css valid specifiers from the generated
>>> markupId, by replacing them with something else (for instance '_'
>>> character). 
>>> 
>>> The problem appear when I am trying to identify the component by it's id
>>> using some js library (like jQuery) and as a consequence the result of
>>> this query: $("#quantity.noOfUnits1232") is invalid.
>>> 
>>> Thank you!
>>> 
>>> Alex.
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-RFE--getMarkupId%28%29-tf4493344.html#a12821479
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: [RFE] getMarkupId()

Posted by Alex Objelean <al...@isdc.ro>.
My personal opinion is that switching from id to class is not such a good
idea, simply because the ID attributes guaranties (of course you can create
two elements with same ID, but it is not the same as with class attribute)
the unicity of the element, also you can find the element from js using
document.getElementById... 

I hope that this radical change will not be made in the 1.3 release as it
has a great impact on any application developed using the latest beta3
release. Also I think this issue should be discussed more between the core
developers.

Alex.


Sam Hough wrote:
> 
> We are going to stop using ids and move over to class as it make re-use
> easier and avoids a number of wicket problems with ids... The HTML monkey
> is not happy though. He reminds me of the Family Guy screaming monkey
> today.
> 
> 
> 
> Alex Objelean wrote:
>> 
>> This is about how wicket generates dynamically markupID.
>> 
>> I have, for instance, the following markup component: 
>> 
>> <input wicket:id="quantity.noOfUnits" />
>> 
>> The generated markupId for this component looks like the following:
>> quantity.noOfUnits1232 .
>> 
>> I suggest to escape any css valid specifiers from the generated markupId,
>> by replacing them with something else (for instance '_' character). 
>> 
>> The problem appear when I am trying to identify the component by it's id
>> using some js library (like jQuery) and as a consequence the result of
>> this query: $("#quantity.noOfUnits1232") is invalid.
>> 
>> Thank you!
>> 
>> Alex.
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-RFE--getMarkupId%28%29-tf4493344.html#a12821375
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: [RFE] getMarkupId()

Posted by Sam Hough <sa...@redspr.com>.
We are going to stop using ids and move over to class as it make re-use
easier and avoids a number of wicket problems with ids... The HTML monkey is
not happy though. He reminds me of the Family Guy screaming monkey today.



Alex Objelean wrote:
> 
> This is about how wicket generates dynamically markupID.
> 
> I have, for instance, the following markup component: 
> 
> <input wicket:id="quantity.noOfUnits" />
> 
> The generated markupId for this component looks like the following:
> quantity.noOfUnits1232 .
> 
> I suggest to escape any css valid specifiers from the generated markupId,
> by replacing them with something else (for instance '_' character). 
> 
> The problem appear when I am trying to identify the component by it's id
> using some js library (like jQuery) and as a consequence the result of
> this query: $("#quantity.noOfUnits1232") is invalid.
> 
> Thank you!
> 
> Alex.
> 

-- 
View this message in context: http://www.nabble.com/-RFE--getMarkupId%28%29-tf4493344.html#a12821245
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: [RFE] getMarkupId()

Posted by Alex Objelean <al...@isdc.ro>.
JIRA issue created:  https://issues.apache.org/jira/browse/WICKET-995
WICKET-995 


Matej Knopp-2 wrote:
> 
> Can you please submit a bug report.
> 
> -Matej
> 
> On 9/21/07, Alex Objelean <al...@isdc.ro> wrote:
>>
>> This is about how wicket generates dynamically markupID.
>>
>> I have, for instance, the following markup component:
>>
>> <input wicket:id="quantity.noOfUnits" />
>>
>> The generated markupId for this component looks like the following:
>> quantity.noOfUnits1232 .
>>
>> I suggest to escape any css valid specifiers from the generated markupId,
>> by
>> replacing them with something else (for instance '_' character).
>>
>> The problem appear when I am trying to identify the component by it's id
>> using some js library (like jQuery) and as a consequence the result of
>> this
>> query: $("#quantity.noOfUnits1232") is invalid.
>>
>> Thank you!
>>
>> Alex.
>> --
>> View this message in context:
>> http://www.nabble.com/-RFE--getMarkupId%28%29-tf4493344.html#a12815038
>> 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
>>
>>
> 
> ---------------------------------------------------------------------
> 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/-RFE--getMarkupId%28%29-tf4493344.html#a12820409
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: [RFE] getMarkupId()

Posted by Matej Knopp <ma...@gmail.com>.
Can you please submit a bug report.

-Matej

On 9/21/07, Alex Objelean <al...@isdc.ro> wrote:
>
> This is about how wicket generates dynamically markupID.
>
> I have, for instance, the following markup component:
>
> <input wicket:id="quantity.noOfUnits" />
>
> The generated markupId for this component looks like the following:
> quantity.noOfUnits1232 .
>
> I suggest to escape any css valid specifiers from the generated markupId, by
> replacing them with something else (for instance '_' character).
>
> The problem appear when I am trying to identify the component by it's id
> using some js library (like jQuery) and as a consequence the result of this
> query: $("#quantity.noOfUnits1232") is invalid.
>
> Thank you!
>
> Alex.
> --
> View this message in context: http://www.nabble.com/-RFE--getMarkupId%28%29-tf4493344.html#a12815038
> 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
>
>

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