Announcement

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

    Canvas.getById() before draw()

    Browser: Firefox 3.6
    SmartGWT 3.0: Isomorphic-SmartClient-Version: SC_SNAPSHOT-2011-11-09EVAL


    I'm trying to use Canvas.getById() to obtain a Window object and it is returning null. For reference, the ID I'm locating by is "Popup_6." I find that if I bring up the Window using draw() first, then perform the getById(), it will return the correct object.

    Doing
    Code:
    javascript:alert(isc.Canvas.getById())
    will also return null.

    Is there a way to retrieve a pointer to the object before it is drawn?

    Thank you

    #2
    I'm currently doing a draw(); hide(); immediately after I am done creating the Window as a workaround, but it's not really a valid workaround. It's causing some troubles with onDraw() and onVisibilityChanged() handlers.

    Is the behavior described the expected behavior for Canvas.getById()? Can someone suggest an alternative way to get Canvas.getById() to work?
    Last edited by kvcxn; 19 Dec 2011, 17:22.

    Comment


      #3
      Have you tried canvas.getOrCreateJsObj() instead of canvas.draw() ?
      MichalG

      Comment


        #4
        That seems to be working better, thank you :)

        Comment

        Working...
        X