Announcement

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

    getMembers on not drawn ToolStrip with separators gives error

    Hi,

    I create a toolstrip which is not drawn yet. Calling getMembers on it works with the buttons, but as soon as I add a separator to it, the call fails with "String is not a JavaScriptObject" class cast exception.

    Repro:
    Code:
    private VLayout test4() {
    	VLayout result = new VLayout();
    	
    	final ToolStrip toolStrip = new ToolStrip();
    	ToolStripButton button1 = new ToolStripButton();
    	ToolStripButton button2 = new ToolStripButton();
    	
    	button1.setTooltip("Entry1");
    	button1.setIcon("[SKINIMG]/actions/accept.png");
    	
    	button2.setTooltip("Entry2");
    	button2.setIcon("[SKINIMG]/actions/add.png");
    	
    	toolStrip.addButton(button1);
    	//If you add a seperator, the toolStrip.getMembers gives an error.
    //		toolStrip.addSeparator();
    	toolStrip.addButton(button2);
    	
    	Button b = new Button("Click me");
    	b.addClickHandler(new ClickHandler() {
    		
    		public void onClick(ClickEvent event) {
    			SC.say("ToolStrip has " + toolStrip.getMembers().length+" members.");
    		}
    	});
    	
    	//It works on a toolstrip which is drawn.
    //		result.addMember(toolStrip);
    	
    	
    	result.addMember(b);
    	
    	return result;
    }

    GWT 2.1 IE8 DEVMode
    SmartClient Version: SC_SNAPSHOT-2010-10-27

    #2
    Thanks for the clear test case.
    We're looking at how best to resolve this - we'll let you know when we have a resolution checked into our mainline code base.

    Comment


      #3
      We've added a fix for this - please take a look at our next nightly build and let us know if you continue to have this problem

      Thanks
      Isomorphic Software

      Comment


        #4
        Thanks, tested with 2011-11-12 build and it no longer gives an error and it works.

        Comment

        Working...
        X