Android Question Items (label type) with the same ID on different panels

agb2008

Member
Licensed User
Longtime User
I've got a case when application consist of multiple panels due to fact that small screens have to be supported and each panel should contain labels for the same object in a first column (left part of the screen). I understand that creating objects with the same id most likely would fail... but B4A allows me to create such objects... but unfortunately they do not work as expected (but should they work anyway ?)
I got case when items display correctly on multiple panels. But when I try to hide such items - that procedure (using lblNumber1.Visible=False) worked correctly only for one panel. When I switched to another panel with the same item - it still in visible state... Could you please advice it such configuration is valid of if it is not - what's the best alternative other then creating multiple copies of the same items i.e. lblNumber1=lblNumber1a=lblNumber1b e.t.c.
 

opus

Active Member
Licensed User
Longtime User
You should create different labels on each panel which should show information of the same object. I don't see a reason for such duplicates. If you want to hide a specific information you need to know which labels do show that and the .visible of them all to False. Or did I misunderstand your problem?
 
Upvote 0

agb2008

Member
Licensed User
Longtime User
opus,

As I've said - application got multiple panels where labels duplicated on multiple panels. Of cause creating different labels for the same would work - but then
controlling of these different labels with the same information (in terms of switching them on/off with .Visible parameter) became much more complicated.
And I am not sure if option exist to group objects - so that property such as .Visible could be assigned for a group and not single object.
 
Upvote 0

opus

Active Member
Licensed User
Longtime User
If you put all views that point the a specific object into a list you make all the needed changes in a quick:
B4X:
 for each lb as label in ObjectLabels
...
Next
 
Upvote 0
Top