Announcement

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

    SelectItem: initial size is final size for layout purposes

    I'm constructing a toolbar at the top of my application with a SelectItem and a Menu button next to each other. The SelectItem should automatically resize to the length of the currently selected item. The menu button should be positioned to the immediate right of the select item.

    However, the positioning of the menu button seems to be based on the initial size of the SelectItem, and does not get adjusted when the SelectItem changes length.

    Result: for items with a length greater than the initial length, the menu button now overlaps the SelectItem. For length lesser, it no longer aligns.

    How does one get the proper layout? The test case below replicates the issue in a standard Eclipse/GWT test project. Just load the code, and select 'Germany' from the dropdown.

    Re: I have CSS somewhere. What CSS occurs in the standard Eclipse/GWT test project that might cause this?

    Info:
    1. SmartClient Version: v8.2p_2012-05-31/LGPL Development Only (built 2012-05-31)

    2. IE 9 (compiled application and debug), Firefox 12 (compiled)

    Code:
     
    public class Test implements EntryPoint
    {
    public void onModuleLoad()
    {
    	LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();
    	valueMap.put("US", "<b>United States</b>");
    	valueMap.put("GM", "GermanyGermanyGermanyGermanyGermanyGermany GermanyGermanyGermanyGermanyGermanyGermanyGermanyGermany");
    
    	final SelectItem selector = new SelectItem("P");
       selector.setEmptyDisplayValue("-------------------Choose-------------");
    	selector.setValueMap(valueMap);
    	selector.setWidth("*");
    
    	DynamicForm selectorForm = new DynamicForm();
    	selectorForm.setFields(selector);
    
    	Menu menu = new Menu();
    	final IMenuButton menuButton = new IMenuButton("extremely_long_title_text_that_will_overlap", menu);
    	menuButton.setAutoWidth();
    	menuButton.setOverflow(Overflow.VISIBLE);
    
    	HLayout menuLayout = new HLayout();
    	menuLayout.addMember(menuButton);
    	menuLayout.setAutoWidth();
    	menuLayout.setOverflow(Overflow.VISIBLE);
    
    	ToolStrip toolStrip = new ToolStrip();
    	toolStrip.setWidth100();
    	toolStrip.setHeight(28);
    	toolStrip.addMember(selectorForm);
    	toolStrip.addMember(menuLayout);
    
    	toolStrip.draw();
    }
    }
    Attached Files
    Last edited by jsres; 31 May 2012, 22:06.

    #2
    As no one has replied to this, I assume I'm making some foolish mistake.
    But, as my test case rather clearly illustrates the issue, would someone be so kind as to point out my foolish mistake? Links to appropriate documentation or posts are welcome.

    Thanks,
    jsres

    Comment

    Working...
    X