B4J Question why view Id is not Field Name?

rbirago

Active Member
Licensed User
Longtime User
All the Views have an Id property, but this property is not the field name. Why?
I have seen that designer cannot set field Id...and B4XView has not the Id property. Why?
thanks
 

Cableguy

Expert
Licensed User
Longtime User
In native java views don't have names, they are meaningless. That is why you can reuse the same view, removing from one parent and adding to another, it becomes a completely different view.
In B4A the names exist mainly for 2 reasons,: BASIC standard, as historically it used names to identify controls, and to facilitate logical thinking.
Internally, when compiling, the IDE can't care less of the views names and uses its IDs
B4XViews are NOT views on their own but rather a reference to different platforms views.
A B4Xpanel for example, in B4J references a Pane, while in b4A is in fact a panel.
 
Upvote 0

rbirago

Active Member
Licensed User
Longtime User
I understand, but shure there is an internal link between a view that I have created by designer and the definition automatically generated by the designer itself...and for example when I perform a GetAllViewsRecursive of a pane I have no way to recognize the view selected, nor its native type nor its id/name. Why? it could be useful and really I don't see side effects...
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I understand, but shure there is an internal link between a view that I have created by designer and the definition automatically generated by the designer itself...and for example when I perform a GetAllViewsRecursive of a pane I have no way to recognize the view selected, nor its native type nor its id/name. Why? it could be useful and really I don't see side effects...
You can use the tag property an use it with sender and getallviewsrecursive
 
Upvote 0

rbirago

Active Member
Licensed User
Longtime User
yes I know (and so I did in the past). I was only curious to understand why was discarded the option to use id.
 
Upvote 0
Top