Announcement

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

    How to set style name of global warn dialog?

    I would like to pop up my own message when deleting a row from a listgrid, so I use setWarnOnRemoval and setWarnOnRemovalMessage. But the dialog box doesn't have the right CSS. I looked in the browser and it's using the style "dialogBackground". I know I could set this in my css file to my look&feel, but I was wondering if there is a way to set the style name of this dialog box to a style which is already in my css.

    I've looked for this dialog box (which seems to be named globalWarn), but I can't find it anywhere.

    Thanks for your help

    1. smartgwt 3.1
    2. IE 9

    #2
    Originally posted by kimmie View Post
    I would like to pop up my own message when deleting a row from a listgrid, so I use setWarnOnRemoval and setWarnOnRemovalMessage. But the dialog box doesn't have the right CSS. I looked in the browser and it's using the style "dialogBackground". I know I could set this in my css file to my look&feel, but I was wondering if there is a way to set the style name of this dialog box to a style which is already in my css.

    I've looked for this dialog box (which seems to be named globalWarn), but I can't find it anywhere.

    Thanks for your help

    1. smartgwt 3.1
    2. IE 9
    Did you try using the SmartGWT skinning system and overriding the defaults?

    Comment


      #3
      bwilkins, that's exactly what I meant when I said:
      Originally posted by kimmie View Post
      I looked in the browser and it's using the style "dialogBackground". I know I could set this in my css file to my look&feel, ...
      But, I already have a dialog style set up and I'd really like to re-use it in this case. So I wanted to see if I could override the style name in the pop-up to one of my pre-existing styles. Otherwise, yes, I will define "dialogBackground" according to my look&feel.

      Another way would be if I could set my own widget for the pop-up, but I don't see any way of doing that. The ListGrid.jsp is coded to directly launch isc.ask.

      Comment


        #4
        I've been digging a bit more and I see the com.smartclient.debug.public.sc.client.widgets.Dialog.js and I have an idea of how I could update the title, but there must be some easier way of manipulating it than directly accessing the jsp, no? Is there a java wrapper to the ask() function?

        Comment


          #5
          We're not sure why you mention .jsp. Skinning is accomplish via the highly declarative (essentially JSON) calls that you see in load_skin.js.

          If you're allergic to JavaScript, there is also Dialog.setDefaultProperties.

          Comment


            #6
            Originally posted by kimmie View Post
            I've been digging a bit more and I see the com.smartclient.debug.public.sc.client.widgets.Dialog.js and I have an idea of how I could update the title, but there must be some easier way of manipulating it than directly accessing the jsp, no? Is there a java wrapper to the ask() function?
            You have to look at load_skins.js and possible skin_styles.css. Either one may need modification, I have never modified it for a Dialog so I don't know where you should look, but it's in one of those two files.

            Comment


              #7
              Ok, let's start over. Apparently I'm not being clear enough about what I want.

              I've set the warning message for the delete operation on a listgrid. The dialog comes up and:
              1) the title says "Question", but I'd like to set this myself, and
              2) the style isn't correct.

              So, I'd like to know if there is a way to set the title of the dialog and the style. Or set the dialog to my own dialog class (I think this would be the best solution).

              I don't see any public access to this dialog from the ListGrid interface besides setting the message itself by setWarnOnRemovalMessage. I've found the SC.Ask method, but it looks like ListGrid the class doesn't use this, it's just the ListGrid.js file which is calling isc.ask directly, so I don't think I can control it.

              Another way I could think of to get around this problem is to add my own handler for the removal. I didn't really want to do that, but if it's the only way I can control the dialog, then this is what I'll do.

              I would really like to control the behavior of this dialog, but I just don't know how to go about it. Please, can you suggest what to do?
              Last edited by kimmie; 11 Mar 2013, 01:08.

              Comment


                #8
                Well, I just created my own record removal handler which then launches my own dialog for confirmation of delete. It works well, but I wish I had to code of the default behavior so that I was sure to get all of the different error cases.

                BTW, I had to do this because we recently switched from smartgwt 2.4 to 3.1 and the behavior of the listgrid on record removal has changed.

                Comment

                Working...
                X