B4J Question why view Id is not Field Name?

Discussion in 'B4J Questions' started by rbirago, May 12, 2019.

  1. rbirago

    rbirago 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
     
  2. Cableguy

    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.
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    Only views added with the designer have a "name".

    The Id field was used with the deprecated scene builder designer. It is a B4J only field and it is rarely used so it is not included in B4XView.
     
  4. rbirago

    rbirago 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...
     
  5. Cableguy

    Cableguy Expert Licensed User

    You can use the tag property an use it with sender and getallviewsrecursive
     
  6. rbirago

    rbirago 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.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice