B4J Question [BANano] How to easily and quickly detect #id conflits?

Mashiane

Expert
Licensed User
Longtime User
Ola

So when creating UX with the abstract designer, each time you drop a custom view, its named VDiv1, VDiv2 etc etc. You create another layout and drop the same custom view, VDiv1, VDiv2 etc.

You then load these with loadlayout, probem is, you have the same named ids as you didn't "rename" them. Assuming that you didnt want your elements to have ids, you can tweak the custom view to enable this feature so that the elements dont have ids, ONLY when that is needed in that case.

How can I get all views inside the #body tag and detect whether some have same #ids. I guess I could use a Map variable to do that, how I do get the views and retrieve each id?

Thanks
 

Toky Olivier

Active Member
Licensed User
Longtime User
Hello, can't you use RegExp with the generated HTML? I think you can use Regex patern like this in JS and you loop for all matched ids: /id="(\w+)"/
 
Last edited:
Upvote 0
Top