Announcement

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

    Problem with labels

    Hi,

    I use the following code from showcase:

    Code:
    	public void onModuleLoad() {  
    		          
    		        Canvas canvas = new Canvas();  
    		          
    		        DragLabel dragTranslucent = new DragLabel("Translucent", 50);  
    		        dragTranslucent.setDragAppearance(DragAppearance.TARGET);  
    		        dragTranslucent.setDragOpacity(60);  
    		        canvas.addChild(dragTranslucent);  
    		          
    		        DragLabel dragShadow = new DragLabel("Shadow", 200);  
    		        dragShadow.setDragAppearance(DragAppearance.TARGET);  
    		        dragShadow.setShowDragShadow(true);  
    		        //TODO: dragShadow.setDragShadowDepth(8);  
    		        canvas.addChild(dragShadow);  
    		          
    		        DragLabel dragOutline = new DragLabel("Outline", 350);  
    		        dragOutline.setLeft(350);        
    		        dragOutline.setDragAppearance(DragAppearance.OUTLINE);  
    		        canvas.addChild(dragOutline);  
    		  
    		        canvas.draw();  
    		    }  
    		  
    		    public static class DragLabel extends Label {  
    		        public DragLabel(String contents, int left) {  
    		            setTop(50);  
    		            setLeft(left);  
    		            setContents(contents);  
    		            setAlign(Alignment.CENTER);  
    		            setPadding(4);  
    		            setShowEdges(true);  
    		            setBackgroundColor("#EEEEEE");  
    		            setKeepInParentRect(true);  
    		            setCanDragReposition(true);      
    		        }  
    	}
    And this is the result:



    However, this is the result from showcase:



    Something's wrong and my question is: what?

    SmartGWT: v2.1, Firefox, Chrome, Eclipse

    Thanks in adavance.

    #2
    The problem is still unsolved. Recently, I've noticed that it concerns firefox and chrome, in case of IE I get the expected result.

    Comment


      #3
      I missed this thread when searching earlier, but I'm having the same problem: http://forums.smartclient.com/showthread.php?t=12369

      I can replicate it on both Firefox and Chrome.

      Comment


        #4
        After playing around some with DOM Inspector, I noticed that there's an extra DIV being created (one DIV with all the absolute position info, etc., and another random one). It's the second DIV, which has no instructions to expand, that's causing the problem. Moving the second DIV's contents to the first DIV and deleting the second DIV produced the correct behavior.

        This appears to be a SmartClient bug.

        Comment


          #5
          I've successfully hacked around the problem. Try commenting out your DOCTYPE to put your browser in quirks mode.

          Comment


            #6
            Covered a few times, fixed in nightlies.

            Comment


              #7
              Glad to hear it. Does that mean that it'll next be incorporated into SmartGWT 2.3, or will there be an intermediate upgrade of just SmartClient that includes the fix?

              Comment

              Working...
              X