Announcement

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

    ColorPicker problems supporting transparency

    Hello,

    I am using smartGWT3.0 pro / GWT 2.3.0
    In the past when I used smartGWT 2.4 pro, things worked as expected, but now, when I use setSupportsTransparency(), I get an error (only when using development mode), in production the color picker is not displayed at all.

    Attached is the error I get.

    And here is the simple code that I have.

    Code:
    ColorPicker retColorPicker = new ColorPicker();
    retColorPicker.setSupportsTransparency(true);
    retColorPicker.setDefaultPickMode("complex");
    retColorPicker.setDefaultColor(null != bgColor ? bgColor : "#FFFFFF");
    ...
    If I comment the supports transparency property, then a similar error occurs for default pick mode, and finally if this is commented out, it works well but without the two properties I want!

    Help please!
    Thanks! You are building a great product, congratz.
    Attached Files

    #2
    And by the way: I get this log in GWT development mode, when the error occurs:

    00:22:44.648 [INFO] Uncaught (javascript) exception com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, see full set in UmbrellaException#getCauses

    Comment


      #3
      In fact, I have many other places where this kind of error appears. Can you give me a hint please? What I am doing wrong.

      Again, for instance I have a class field called adminTabSet and in a success callback of an async call to server I do this:

      Code:
      this.adminTabSet = getAdminTabSet();
      Where getAdminTabSet() is defined like this:

      Code:
      private TabSet getAdminTabSet() {
              TabSet retTabSet = new TabSet();
              retTabSet.setTabBarPosition(Side.TOP);
              retTabSet.setTabBarAlign(Side.RIGHT);
              retTabSet.setTabBarThickness(ADMIN_TAB_BAR_THICKNESS);
              retTabSet.setShowTabPicker(isAdminTabScrollerRequired());
              retTabSet.setShowTabScroller(isAdminTabScrollerRequired());
              retTabSet.setWidth100();
              retTabSet.setHeight100();
      
      ...
      The error I get:

      "Error:Cannot change configuration property 'tabBarPosition' to top after the component has been created."

      Why? The component was not created yet! It is created when getAdminTabSet() is called.

      Help please.

      Comment


        #4
        I found this thread http://forums.smartclient.com/showthread.php?t=3786
        But I am 100% sure I'm not calling .draw() before having all the components created.

        Comment


          #5
          It is clear that something wrong is happening with dev mode when debugging. I have now a standalone test case. Here it is a basic implementation of EntryPoint

          Code:
          public class TestIllegalStateException implements EntryPoint {
              @Override
              public void onModuleLoad() {
                  VLayout testLayout = new VLayout();
          
                  Label label = new Label();
          //        label.setID("wtfLabel");
                  label.setContents("Really?");
                  testLayout.addMember(label);
          
                  TabSet tabSet = new TabSet();
          //        tabSet.setID("uniqueTabSet");
                  tabSet.setTabBarPosition(Side.TOP);
                  testLayout.addMember(tabSet);
          
                  testLayout.draw();
          }
          When I am using GWT debug dev mode, the similar exceptions described are raised. But when I use run dev mode (without debugging, inspecting variables, etc) works perfectly also with the setID() lines uncommented.

          Comment


            #6
            Something is wrong with your project or IDE. Double-check the installation instructions, run a GWT compile, clear browser caches, and restart Eclipse. Maybe reboot too for good measure.

            Comment


              #7
              Yeah, it looks like there was something wrong there, but I remember that I encountered this kind of behavior back in the past.

              However, I still have problems with my "complex" color picker.

              Here is my standalone test case, implementing an EntryPoint:

              Code:
                      final ColorPicker colorPicker = new ColorPicker();
                      /* Using the below static method to catch unhandled exceptions from GWT */
                      GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
                          @Override
                          public void onUncaughtException(Throwable e) {
                              GWT.log("GWT uncaught exception: " + e.getMessage());
                          }
                      });
                      colorPicker.setSupportsTransparency(true);
                      colorPicker.setDefaultPickMode("complex");  /* CRASHING POINT! */
                      colorPicker.setDefaultColor("#FFFFFF");
                      colorPicker.addColorSelectedHandler(new ColorSelectedHandler() {
                          @Override
                          public void onColorSelected(ColorSelectedEvent colorSelectedEvent) {
                              SC.say("Selected color is: " + colorSelectedEvent.getColor() + " and opacity: " + colorSelectedEvent.getOpacity());
                          }
                      });
              
                      IButton btn = new IButton("Show colorPicker");
                      btn.addClickHandler(new ClickHandler() {
                          @Override
                          public void onClick(ClickEvent clickEvent) {
                              colorPicker.show();
                          }
                      });
                      btn.draw();
              When I use ColorPicker.setDefaultPickMode("complex"), I get the following log in dev mode console.
              [INFO] GWT uncaught exception: One or more exceptions caught, see full set in UmbrellaException#getCauses

              Surprisingly, when I use "simple" or comment that line, everything is working as expected.

              Maybe this can be helpful to solve the bug: See attachment, to see how the color picker looks the second time I clicked the button. Looks "broken" :), wrongly sized, but functional, without the possibility to submit color/opacity.

              Regards.
              Attached Files

              Comment


                #8
                This last issue (the GWT uncaught exception one) was a framework bug which we have now fixed. The fix will be present in nightly builds of 2.5, 3.0 and 3.1d as of tomorrow.

                Regards
                Isomorphic Software Support

                Comment

                Working...
                X