Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Callback suggestions

    Hello,

    On startup I need to call some datasources but after my UI is loaded to avoid nulls. I have tried overloading onLoad() as suggested in the docs on a Layout (method is in superclass Widget a few levels up) but it doesn't seem to get the call.

    Any help appreciated,
    Eric

    #2
    Try addDrawHandler

    Comment


      #3
      That worked great thanks. Once the content is loaded I make a call to the backend to see if session.getRemoteUser is set(in the case of a SSO authentication as in Production) or null so I can do a local login. The app has application-based security.

      Eric

      Comment


        #4
        Originally posted by smartgwt.dev
        Try addDrawHandler
        addDrawHandler works but... why onLoad event isn't getting called?

        Comment


          #5
          Any response to Ciro's question?

          I am in a situation where I need to call datasource.fetchdata whenever the widget is shown.

          Although there is a VisibilityChangedHandler, I noticed this DOES NOT get called the first time the widget is actually shown (a bit annoying).

          So I was happy to see an onLoad method and tried to override it but found it was never called.

          So after looking at onLoad, onInit, onInit_Layout, etc. I found that the only handler that did get called the first time a widget was shown was the DrawHandler and put my fetchdata call in that method.

          Is this the right way to handle this situation? I was hoping I could put my code into onLoad or just in VisibilityChangedHandler but that doesn't seem to work.

          Comment


            #6
            DrawHandler is the right one to use, and the others don't work because they are just inherited from GWT base classes and do not apply to SmartGWT widgets - use SmartGWT APIs as a first choice, always.

            Comment

            Working...
            X