B4J Question why view Id is not Field Name?

rbirago

Active Member
Licensed 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
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.
 

rbirago

Active Member
Licensed 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...
 

Cableguy

Expert
Licensed 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
 

rbirago

Active Member
Licensed 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.
 
Top