sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Web Dialog and Data

    Scheduled Pinned Locked Moved Developers' Forum
    10 Posts 2 Posters 961 Views 2 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.
    • B Offline
      bizello
      last edited by

      Hi friends,
      I would like to create a html webdialog to send data (text, radio state, checkbox state, etc) as variables to ruby script. After that, I´ll work these variables and return results on other html as text only.
      Is it possible without javascript?
      Thanks.
      Sérgio Bizello

      Sérgio A.Bizello

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

        No. Ruby communicates back and forth with Webdialogs using JS. No way around that.
        Any particular reason you don't want to use JS?

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

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

          Or saying that... webdialog.get_element_value retrieves the value of input elements without any JS.

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

          1 Reply Last reply Reply Quote 0
          • B Offline
            bizello
            last edited by

            @thomthom said:

            No. Ruby communicates back and forth with Webdialogs using JS. No way around that.
            Any particular reason you don't want to use JS?

            Hi,
            Well, I just wanted to use the least possible languages. If no possible, ok.
            Do you know a site where I can see and learn a simple code in JS to capture information from webdialog and show information on a webdialog?

            Thanks TT

            Sérgio A.Bizello

            1 Reply Last reply Reply Quote 0
            • B Offline
              bizello
              last edited by

              @thomthom said:

              Or saying that... webdialog.get_element_value retrieves the value of input elements without any JS.

              Ok... I'll see how it works, but if you have some example, send me if you can. I'll be grateful for this help too.
              Thanks again TT.
              SérgioBizello

              Sérgio A.Bizello

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

                Error 404 (Not Found)!!1

                favicon

                (code.google.com)

                The example has been mangled though. should say:

                
                # In Ruby code;
                dialog.get_element_value("myTextInput")
                
                # In webdialog's HTML;
                # <input id="myTextInput" value="hello" type="text">
                
                

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

                1 Reply Last reply Reply Quote 0
                • B Offline
                  bizello
                  last edited by

                  @thomthom said:

                  Error 404 (Not Found)!!1

                  favicon

                  (code.google.com)

                  The example has been mangled though. should say:

                  
                  > # In Ruby code;
                  > dialog.get_element_value("myTextInput")
                  > 
                  > # In webdialog's HTML;
                  > # <input id="myTextInput" value="hello" type="text">
                  > 
                  

                  How is the data transmission? After clicking the OK or closing the dialog box? I'm sorry the basic question but, I'm a begginer and I doubt it. If the webdialog has checkbox, radio, etc. This works with these types? Or have any exception?
                  Thanks

                  Sérgio A.Bizello

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

                    .get_element_value is a method that immediately returns the value of the input element.

                    myVariable = dialog.get_element_value("myTextInput") puts myVariable
                    That snippet will take the value of myTextInput and assign it to the variable myVariable and then prints it to the Ruby Console.

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

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

                      @bizello said:

                      How is the data transmission? After clicking the OK or closing the dialog box? I'm sorry the basic question but, I'm a begginer and I doubt it. If the webdialog has checkbox, radio, etc. This works with these types? Or have any exception?

                      Should work for checkboxes and radio boxes. they are also INPUT type HTML elements. Not sure about SELECT and TEXTAREA fields etc. Haven't tried them.

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

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

                        Moved the thread to the Developer's forum. We have reorganized so that the Plugin section is only a list of plugins you can download and use. 🤓

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

                        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