Hi Isomorphic,
We are using SmartGWT Pro 2.5 branch (12/08/2011 nightly build).
I have an issue with the Tabset ScrolledHandler on Firefox 8.0, it works fine on IE.
Please see the code:
To recreate the issue:
- Click the 'Add Tab' button 7 times to add 7 tabs
- Select the last half visible tab 'yellow isc_Tab_6'
- Click the right Scroll arrow to go to the next tab
It seems that the blue tabset2 is moving to the wrong left position.
In fact the tabset1 with the green border is moved to the left.
If I'll print the location of all elements, they look correct.
Can you please tell me how I can avoid this issue?
It is only happening if the title of the selected tab is half visible.
Thank you.
We are using SmartGWT Pro 2.5 branch (12/08/2011 nightly build).
I have an issue with the Tabset ScrolledHandler on Firefox 8.0, it works fine on IE.
Please see the code:
Code:
package com.oc.smartgwt.test.client; import com.smartgwt.client.types.Alignment; import com.smartgwt.client.types.Overflow; import com.smartgwt.client.types.Side; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.IButton; import com.smartgwt.client.widgets.tab.Tab; import com.smartgwt.client.widgets.tab.TabSet; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.events.DrawEvent; import com.smartgwt.client.widgets.events.DrawHandler; import com.smartgwt.client.widgets.events.ResizedEvent; import com.smartgwt.client.widgets.events.ResizedHandler; import com.smartgwt.client.widgets.events.ScrolledEvent; import com.smartgwt.client.widgets.events.ScrolledHandler; import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.Layout; import com.smartgwt.client.widgets.layout.VLayout; import com.google.gwt.core.client.EntryPoint; public class TabShellTest implements EntryPoint { private Layout parentLayout; private Layout spacerLayout; private TabSet tabset1; private TabSet tabset2; static final int TAB_WIDTH = 20; static final int TAB_HEIGHT = 20; static final int TAB_PANE_WIDTH = 230; public void onModuleLoad() { VLayout mainLayout = new VLayout(); mainLayout.setMembersMargin(15); mainLayout.setWidth(600); mainLayout.setHeight(200); mainLayout.setBorder("1px solid black"); parentLayout = new HLayout(); parentLayout.setID("shellLayout"); parentLayout.setOverflow(Overflow.HIDDEN); parentLayout.setWidth100(); parentLayout.setHeight100(); parentLayout.setShowResizeBar(false); spacerLayout = new VLayout(); spacerLayout.setID("spacerLayout"); spacerLayout.setOverflow(Overflow.HIDDEN); spacerLayout.setWidth(TAB_WIDTH); spacerLayout.setHeight100(); spacerLayout.setShowResizeBar(false); tabset2 = new TabSet(); tabset2.setID("tabset2"); tabset2.setOverflow(Overflow.HIDDEN); tabset2.setTabBarPosition(Side.LEFT); tabset2.setTabBarAlign(Side.TOP); tabset2.setDefaultWidth(TAB_WIDTH + TAB_PANE_WIDTH); tabset2.setWidth(TAB_WIDTH + TAB_PANE_WIDTH); tabset2.setHeight100(); tabset2.setShowTabPicker(false); tabset2.setShowTabScroller(false); tabset2.setTabBarThickness(TAB_WIDTH); tabset2.setAlign(Alignment.CENTER); tabset2.setTop(0); tabset2.setBorder("1px solid blue"); tabset2.setParentElement(parentLayout); final Tab tab2 = new Tab(); tab2.setID("tabset2Tab"); tab2.setIcon(null); tab2.setAttribute("height", TAB_HEIGHT); Canvas pane = new Canvas(); pane.setWidth100(); pane.setHeight100(); pane.setBackgroundColor("blue"); tab2.setPane(pane); tabset2.addTab(tab2); tabset2.selectTab(0); tabset1 = new TabSet(); tabset1.setID("tabset"); tabset1.setTabBarPosition(Side.TOP); tabset1.setOverflow(Overflow.HIDDEN); tabset1.setTabBarAlign(Side.LEFT); tabset1.setShowTabScroller(true); tabset1.setShowTabPicker(true); tabset1.setWidth100(); tabset1.setHeight100(); tabset1.setBorder("3px solid green"); tabset1.addScrolledHandler(new ScrolledHandler() { public void onScrolled(ScrolledEvent event) { System.out.println(new java.util.Date() + "tabset1.onScrolled..."); } }); parentLayout.addResizedHandler(new ResizedHandler() { public void onResized(ResizedEvent event) { System.out.println(new java.util.Date() + "parentLayout.onResized..."); parentLayout.redraw(); } }); parentLayout.addDrawHandler(new DrawHandler() { public void onDraw(DrawEvent event) { System.out.println(new java.util.Date() + "parentLayout.onDraw..."); if (tabset2 != null && tabset2.getParentElement() != null) tabset2.setLeft(tabset2.getParentElement().getWidth() - TAB_WIDTH); } }); parentLayout.addMember(tabset1); parentLayout.addMember(spacerLayout); HLayout buttons = new HLayout(); buttons.setMembersMargin(15); IButton addButton = new IButton("Add Tab"); addButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { Tab tab = new Tab(); Canvas pane = new Canvas(); pane.setWidth100(); pane.setHeight100(); if (tabset1.getTabs().length % 2 == 0) { pane.setBackgroundColor("green"); tab.setTitle("green " + tab.getID()); } else { pane.setBackgroundColor("yellow"); tab.setTitle("yellow " + tab.getID()); } tab.setPane(pane); tabset1.addTab(tab); } }); buttons.addMember(addButton); mainLayout.addMember(parentLayout); mainLayout.addMember(buttons); mainLayout.draw(); } }
- Click the 'Add Tab' button 7 times to add 7 tabs
- Select the last half visible tab 'yellow isc_Tab_6'
- Click the right Scroll arrow to go to the next tab
It seems that the blue tabset2 is moving to the wrong left position.
In fact the tabset1 with the green border is moved to the left.
If I'll print the location of all elements, they look correct.
Can you please tell me how I can avoid this issue?
It is only happening if the title of the selected tab is half visible.
Thank you.
Comment