Announcement

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

    Using GWTDesigner in UIBinder mode

    I'm trying to display smartGWT widgets in UIBinder mode.
    I'm using https://code.google.com/p/uibinding-smartgwt/ to do this and I had to modify the existing code to get the GWTDesigner to compile things correctly.

    Now I'm getting this error:

    java.lang.AssertionError: This UIObject's element is not set; you may be missing a call to either Composite.initWidget() or UIObject.setElement()

    Stack trace:

    java.lang.AssertionError: This UIObject's element is not set; you may be missing a call to either Composite.initWidget() or UIObject.setElement()
    at com.google.gwt.user.client.ui.UIObject.getElement(UIObject.java:558)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)

    None of the SmartGWT controls that were wrapped by the uibinding-smartgwt code use the .initWidget() or .setElement(), So it is an omission by the authors and this could never work, or am I doing something wrong?

    Also since SmartGWT controls are different from GWT controls (they do not inherit from them), is the process in UIBinder ALWAYS depending on underlying GWT Control?

    I have seen examples of composite GWT Controls, but not complete 3rd party controls.

    Regards

    Tek

    #2
    The uibinding-smartgwt project is not something created by Isomorphic - we investigated UIBinder support but found it too inflexible to support the XML syntax required by SmartGWT.

    Instead we offer Component XML (see docs). This has the (gigantic) advantage that it can be changed and reloaded at runtime, allowing various scenarios such as database-driven XML screen layouts and user-modifiable UI.

    Comment


      #3
      Is Component XML visual or only XML? Also I saw VisualBuilder, but this is not part of the free product, is that correct?

      Thanks

      Comment


        #4
        Is Component XML visual or only XML?
        Could you rephrase this question?

        Visual Builder is part of Pro and above. Full details of Editions & Pricing are here.

        Comment


          #5
          1) Component XML -> is only a way to write the GUI layout code in XML via text. Right?

          So, how do I preview my layout XML code that I write?


          2) I'm trying to launch the Developer Console by typing:
          javascript:isc.showConsole() into the URL of the browser, but I get nothing back.
          When I type in: http://127.0.0.1:8888/myappName/sc/system/helpers/Log.html I do get something but it looks really bad, :-( ? How do I start the console?

          Thank you.





          Thanks

          Comment


            #6
            1. Seems an odd question - if you've got a page that is loading your Component XML, you just reload it.

            What you may be thinking is that this is slow, because with UI Binder there is a GWT compile involved. With Component XML there is no GWT compile involved, so the reload is basically instant (another major advantage).

            2. The FAQ has instructions for loading the Developer Console if you're having trouble.

            Comment


              #7
              >> 1. Seems an odd question - if you've got a page that is loading your Component XML, you just reload it.

              >>What you may be thinking is that this is slow, because with UI Binder there is a GWT compile involved. With Component XML there is no GWT compile involved, so the reload is basically instant (another major advantage).

              Here is my workflow:
              1) Create a layout sampleLayout.xml file in Eclipse.
              2) Edit sampleLayout.xml by typing in my layout xml tags.
              3) How do I Preview what I just typed in? Is it possible? Or do I just run it and see it via running form?
              4) Is the VisualBuilder the only graphical tool used to visually assemble the forms?

              BTW: I was able to get the Developer Console to work by adding this code the module on load:
              if (!GWT.isScript()) {
              KeyIdentifier debugKey = new KeyIdentifier();
              debugKey.setCtrlKey(true);
              debugKey.setKeyName("D");
              Page.registerKey(debugKey, new KeyCallback() {
              public void execute(String keyName) {
              SC.showConsole();
              }
              });
              }
              But not via: javascript:isc.showConsole()

              Thanks

              Comment


                #8
                Yes, just run it, which again is instant.

                As the FAQ notes, some browsers no longer allow "javascript:" URLs to be typed directly into the URL bar.

                Comment


                  #9
                  Yes, Visual Builder is the tool for visually assembling component XML. However, be sure to look at the FAQ on this - Visual Builder is not an IDE replacement and not intended to allow you to set every possible property.

                  Comment


                    #10
                    Hi tekwojenski,

                    I think this is related to browser security:

                    alert('Hello world!'); as well as javascript:isc.showConsole(); work for me in Chrome 35 but not FF 26.

                    Best regards,
                    Blama

                    Comment


                      #11
                      Crosspost.

                      Comment


                        #12
                        Thanks everybody.

                        With respect to javascript:isc.showConsole() I'd modify the FAQ to reflect this. I do like the Ctrl-D better anyway :-)

                        Do you have sample/example of ComponentXML layouts somewhere? I'm interested in a Tree example. I did not see any complete examples in the Showcase app. This is always chicken or the egg problem.

                        Thanks

                        Comment


                          #13
                          The FAQ already points this out. It says:

                          (NOTE: typing this into the URL bar will also work in most browsers, but not in Firefox 6+).
                          There's a whole folder of Component XML samples. There doesn't happen to be one that shows a TreeGrid, but the format for Component XML across all components is uniform.

                          Comment


                            #14
                            Strange... I also used IE8 and the console did not come up?!

                            Thank you for the examples. They all look nice.
                            Can ComponentXML be used in the free version? In the docs it talks about: com.isomorphic.servlet.ScreenLoaderServlet, that they need to be loaded from the server. Can you load them without the servlet via direct JSON HTTP call?

                            Also I could not find any of these layouts:
                            replacePlaceholder
                            screenReuse
                            customComponents

                            Can you point me to where I can find them.


                            Lastly, do you have XML definition DTD for ComponentXML?

                            Thanks

                            Comment


                              #15
                              Originally posted by tekwojenski View Post
                              Can ComponentXML be used in the free version?
                              No. Again, see the Editions & Pricing link previously provided.

                              http://www.smartclient.com/product/

                              Also I could not find any of these layouts:
                              replacePlaceholder
                              screenReuse
                              customComponents
                              Simply click "View Source".

                              Lastly, do you have XML definition DTD for ComponentXML?
                              No. Component XML cannot be described by a DTD, and even XML Schema would prevent many of its more powerful features from being used.

                              Instead, errors and warnings appear in the server console as the XML is processed.

                              Comment

                              Working...
                              X