Bug? CustomView with Layout file...

Discussion in 'B4J Bugs & Wishlist' started by Cableguy, Dec 5, 2017.

  1. Cableguy

    Cableguy Expert Licensed User

    Hi Erel,

    I am creating a Custom view using a layout file added to the base pane.
    it consists of a few color pickers, range sliders and a label.
    my issue is, when i try to expose some property from of of the used nodes to the callback, I get "Object should first be initialized"...

    If i do intialize (which i shouldn't) the IDE warns me that the view was added with the designer and thus should not be initialized in code...
  2. Erel

    Erel Administrator Staff Member Licensed User

    This is most probably a bug in your code. Try to reproduce it in a small project and upload it.
  3. Cableguy

    Cableguy Expert Licensed User

    Indeed, it was...

    I was a bit eluded by the CustomView creation sequence...
    The Initialize sub is ment to initialize the CustomView itself. If the components are added in code, then they should be initialized in this same sub as some other properties can be defined, BUT, if the view uses a layout file, those components will only be "available" in the DesignerCreateView sub!
    (this is my first time using a layout in a custom view, so I'm learning!)
    stevel05 likes this.