I just talked to him again, and it seems that you are both right. :)
He said that it is true for simple controls, but he uses repeaters

id=rpt (automatic creation of checkboxes, for example)

results in:

rpt_cb1
rpt_cb2 
...

If repeater is inside repeater then it is something like:

rptOuter_rptInner_cb1
...

He uses repeaters because (in this case) we are making web shop and at one
page there are lots of options, and user selects some of them.

Zeljko

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Williams, Kevin
Sent: Thursday, July 21, 2005 3:40 PM
To: [email protected]
Subject: RE: [Wtr-general] id

I'm sorry to say your developer is not correct. If an ID is not
explicitly specified, the framework will create one, and it would be
subject to change if the control tree changed on postback. However, if
an ID *is* explicitly specified, the framework will use that ID.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Zeljko Filipin
Sent: Thursday, July 21, 2005 7:34 AM
To: [email protected]
Subject: [Wtr-general] id

>From watir.rb:

#  The ways that are available to identify an html object depend upon
the object type, but include
#   :id           used for an object that has an ID attribute -- this is
the
best way!

I talked to developer and he told me that our web applications are
developed in asp.net and that he can not assign id property to html
object, and that asp.net does it.
Id is assigned to element by it's position at page, something like

<input id="catalog_1" type="checkbox" />

and id is changed when another element (checkbox in this case) is added
to page.

Example: add another checkbox to page, so it is above (before) this one.
New checkbox gets id="catalog_1", and old one is changed to
id="catalog_2".

It is just like using :index, and "i always consider using :index to be
an ugly hack when nothing else will work." (Bret Pettichord)

Has anybody else this problem (and solution)?

Zeljko

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to