Announcement

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

    TopMost Window

    Hi,

    I want a window that has the highest zIndex but not modal.
    I mean, the window should not be modal and always stay on top
    just like the tool window in Excel.

    How can I do that ? Any help would be appreciated.

    Regards,

    veritas

    #2
    Window.bringToFront(), or if you want to guarantee that no matter what it is always topmost even if you call bringToFront() on others you could do a trick through JSNI, but bringtofront should work from your description.

    Comment


      #3
      svjard,

      Thanks for your help.

      Actually what I want is to make a window to be always topmost.
      I'm sorry Window.bringToFront() does not work for me.

      What is JSNI ? Where can I get documentations and sample codes
      on JSNI ?

      Best regards,

      veritas

      Comment


        #4
        Code:
        class MyWindow extends Window {
          public MyWindow() {
            setTopMost();
          }
        
          private native void setTopMost()/*-{
            var self = this.@com.smartgwt.client.widgets.BaseWidget::getOrCreateJsObj()();
            self.setZIndex($isc.Canvas._BIG_Z_INDEX*2);
          }-*/;
        }
        or something similiar, basically _BIG_Z_INDEX is the topmost index and used in bringToFront() calls so as long as you set it high enough it would always be the topmost window. So you can have 200 bringToFront() calls and MyWindow will still be the topmost.

        Comment


          #5
          svjard,

          Thanks a lot for your help.

          Regards,

          veritas

          Comment


            #6
            I'd also need access to _BIG_Z_INDEX, but how to access it during runtime? Might be that I'm overlooking something but in the runtime javascript package it has a different name like for all variables beginning with '_', so how can that be solved?

            For an always-on-top-window it is possible to overwrite get/setZIndex via javascript and set it to a very high value like 1000000 so that it always stays on top, but then even standard modal dialogs created via the SC-class will be behind that window and the user cannot operate on them.

            Any ideas?

            Comment

            Working...
            X