sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Invalid Web Dialog

    Scheduled Pinned Locked Moved Developers' Forum
    10 Posts 5 Posters 1.9k Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C Offline
      cjthompson
      last edited by

      I have been using a web dialog as an interface and lately I've been getting the error "#<Exception: Invalid Dialog>" if I submit more than once. Does anyone know why this is?

      I am using mostly get_element_value instead of parameters.

      1 Reply Last reply Reply Quote 0
      • M Offline
        MartinRinehart
        last edited by

        @cjthompson said:

        lately I've been getting the error "#<Exception: Invalid Dialog>"

        Never saw that. Can you post some code?

        Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

        1 Reply Last reply Reply Quote 0
        • C Offline
          cjthompson
          last edited by

          I've been trying to get a code snippet to replicate the problem, but I haven't been able to. I just wanted to know if anyone else has had this problem.

          1 Reply Last reply Reply Quote 0
          • M Offline
            MSP_Greg
            last edited by

            CJ,

            @cjthompson said:

            if I submit more than once.

            Can you please clarify what exactly you mean by submit? Not sure if you mean HTML form submit or not...

            If you do, I have only used a button onclick event and a trap for escape.

            Greg

            1 Reply Last reply Reply Quote 0
            • C Offline
              cjthompson
              last edited by

              sorry, I meant executing window.location = skp:callback_method_name.

              I think this might be an issue with ASP. I haven't been able to replicate it with html.

              1 Reply Last reply Reply Quote 0
              • C Offline
                cjthompson
                last edited by

                Okay. This is just plain stupid.

                I stepped through my code to find the problem, and it turns out that somehow creating a new bounding box invalidates my web dialog.

                here is a code snippet to test with (I used the console):

                
                testWebDialog = UI;;WebDialog.new("Test;",true,"webDAtts",700,500)
                testWebDialog.set_html("<head></head><body>This is a test</body>")
                testWebDialog.show
                puts testWebDialog.visible? #(should return true)
                Geom;;BoundingBox.new
                puts testWebDialog.visible? #(should return false)
                
                
                1 Reply Last reply Reply Quote 0
                • C Offline
                  cjthompson
                  last edited by

                  I noticed that this was fixed in 7.1

                  1 Reply Last reply Reply Quote 0
                  • thomthomT Offline
                    thomthom
                    last edited by

                    @cjthompson said:

                    I noticed that this was fixed in 7.1

                    Good to hear.

                    Thomas Thomassen — SketchUp Monkey & Coding addict
                    List of my plugins and link to the CookieWare fund

                    1 Reply Last reply Reply Quote 0
                    • J Offline
                      Jim
                      last edited by

                      If you create a dialog assigning a @class variable to reference it, and the dialog is closed, then the variable holds a reference to the now invalid dialog.

                      Typical code

                      
                      def create_dialog
                        if !@dlg
                          @dlg = UI;;WebDialog.new( ... )
                        end
                        @dlg.show { }
                      end
                      
                      

                      Now if the dialog is closed, the @dlg variable still holds a reference to the now invalid dialog. In addition to checking whether the @dlg variable exists, you need to check if the dialog is visible?

                      
                      def create_dialog
                        unless @dlg and @dlg.visible?
                          @dlg = UI;;WebDialog.new( ... )
                        end
                        @dlg.show { }
                      end
                      
                      

                      Hi

                      1 Reply Last reply Reply Quote 0
                      • J Offline
                        Jim
                        last edited by

                        Or just recreate the dialog every time...

                        
                        def create_dialog
                          @dlg = UI;;WebDialog.new( ... )
                          @dlg.show { }
                        end
                        
                        

                        Hi

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        Buy SketchPlus
                        Buy SUbD
                        Buy WrapR
                        Buy eBook
                        Buy Modelur
                        Buy Vertex Tools
                        Buy SketchCuisine
                        Buy FormFonts

                        Advertisement