getElementID

Hi,

Would it be possible to get a function that gives you a unique ID per element that remains the same over different releases of a certain solution?

In my mind this function would only work for elements that have a name.

Paul

what whould be the use? is the name not good?

If you want to build your own sort of security, a unique ID is better to work with, for two reasons:
1- on a form, you can have two elements witht he same name
2- between versions the name for the same element might be different

Hope it makes sense…

Paul

pbakker:
If you want to build your own sort of security, a unique ID is better to work with, for two reasons:
1- on a form, you can have two elements witht he same name
2- between versions the name for the same element might be different
Hope it makes sense…

The name remains the same between versions! you have full control on the name, they are the same only if that is what you want. You can also use names with some “logic” on them, let’s say “fldDiscount_P” “fldAge_P_D” and then loop looking with names with “_P” or “_D” and then apply your security features on them.

Yes, I know that you can put in the effort to make sure they are the same, but…

If you have an ID that is always unique automatically and not changeable, it could never go wrong.

If I have to store rules linked to a specific element, I rather do this based on an ID of which I know for sure that it always stays the same, instead of a name that might (accedentially) change.

Paul

pbakker:
1- on a form, you can have two elements witht he same name

Yes but then its undifined which one you are targeting, keep them unique…

pbakker:
2- between versions the name for the same element might be different

well yes, but how likely is that?

Yep, not likely and yep, better keep them unique, but, as the discusion indicates, it’s a manual thing, and if you’re not carefull, mistakes might be made.

Hence the request for the Unique ElementID. :D

Since Servoy stores all form related data in a database, thus also elements, I thought there would be an ID that identifies elements. To me it seems very handy to get that ID. I just think: why not build something that can never go wrong, instead of something that might go wong if you’re not carefull?

Just my 5 cents…

Paul

yes, Servoy has ids in the database but those a repository local, so export and import into other and they are different.
I whould argue stay with the element name.

ok, yes, if ID’s differ between repositories, it defies the whole point.

Tnx for the discussion :D

Paul