Announcement

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

    Tab bar controls not properly aligned

    Hi,

    I am creating a TabBar that has controls for which some should be shown or hidden dynamically.
    It seems to me that controls and tabs are aligned the same way (and the "separator" position is calculated using the position of all tab bar controls (visible or hidden)) which leads to the situation shown in the attached montage (first row shows the hidden state, second the visible state).
    How to make the tab bar controls properly (to the right) aligned in the hidden state?

    Thanks,
    fatzopilot
    Attached Files

    #2
    We can't tell what mix of controls you've put in here, but generally speaking, use either layout.align:"right" or a leading LayoutSpacer with width:"*" to create right alignment.

    Comment


      #3
      Hi,

      sorry, none of your suggestions seems to work, or I did not get it right ;)
      The componentXML below is the one with the wrong alignment. Now, if a spacer is inserted as suggested (uncomment line 45), the layout is corrupted. In dev mode, a "too much recursion" exception is raised (see below).

      I did not understand where to apply "layout.align:right", I tried a few places but to no avail.

      Portal.ui.xml
      Code:
      <isomorphicXML xmlns:fmt="WEB-INF/">
      
      	<LayoutSpacer ID="LayoutSpacer0" width="*"></LayoutSpacer>
      
      	<IButton ID="NewPortletButton">
      		<title>NewPortletButton</title>
      		<icon>[SKIN]/DynamicForm/text_control.gif</icon>
      		<visibility>hidden</visibility>
      	</IButton>
      	
      	<IButton ID="LogoutButton">
      		<title>Logout</title>
      		<icon>[SKIN]/FileBrowser/upOneLevel.png</icon>
      	</IButton>
      
      	<PortalLayout ID="PortalLayout0" autoDraw="false">
      		<portalColumns>
      			<PortalColumn>
      				<autoDraw>false</autoDraw>
      				<ID>PortalColumn0</ID>
      			</PortalColumn>
      		</portalColumns>
      		<showColumnMenus>false</showColumnMenus>
      		<columnBorder>0px</columnBorder>
      		<border>0px</border>
      		<canResizeColumns>false</canResizeColumns>
      		<canResizePortlets>true</canResizePortlets>
      		<canShrinkColumnWidths>true</canShrinkColumnWidths>
      		<preventColumnUnderflow>true</preventColumnUnderflow>
      		<numColumns>1</numColumns>
      	</PortalLayout>
      	
      	<TabSet ID="PortalTabSet" autoDraw="true" tabBarAlign="left" canCloseTabs="false">
      		<tabs>
      			<Tab title="Tab0" canClose="true">
      				<pane>
      					<Canvas ref="PortalLayout0" />
      				</pane>
      				<ID>Tab0</ID>
      				<name>Tab0</name>
      			</Tab>
      		</tabs>
      		<tabBarControls>
      		    <!-- <value>LayoutSpacer0</value> -->
      			<value>NewPortletButton</value>
      			<value>LogoutButton</value>
      		</tabBarControls>
      
      		<canCloseTabs>true</canCloseTabs>
      		<destroyPanes>false</destroyPanes>
      	</TabSet>
      	<DataView ID="PortalDataView" width="100%" height="100%"
      		overflow="hidden" autoDraw="true">
      		<members>
      			<Canvas ref="PortalTabSet" />
      		</members>
      		<modulesDir>modules/</modulesDir>
      	</DataView>
      </isomorphicXML>
      Code:
      import com.google.gwt.core.client.EntryPoint;
      import com.google.gwt.core.client.GWT;
      import com.google.gwt.core.client.GWT.UncaughtExceptionHandler;
      import com.google.gwt.core.client.Scheduler;
      import com.google.gwt.core.client.Scheduler.ScheduledCommand;
      import com.smartgwt.client.rpc.LoadScreenCallback;
      import com.smartgwt.client.rpc.RPCManager;
      import com.smartgwt.client.util.SC;
      import com.smartgwt.client.util.ValueCallback;
      import com.smartgwt.client.widgets.Canvas;
      import com.smartgwt.client.widgets.Dialog;
      import com.smartgwt.client.widgets.IButton;
      import com.smartgwt.client.widgets.events.DoubleClickEvent;
      import com.smartgwt.client.widgets.events.DoubleClickHandler;
      import com.smartgwt.client.widgets.layout.PortalLayout;
      import com.smartgwt.client.widgets.layout.Portlet;
      import com.smartgwt.client.widgets.tab.Tab;
      import com.smartgwt.client.widgets.tab.TabSet;
      
      /**
       * Generated SmartGWT Scaffolding.
       */
      public class LayoutTest implements EntryPoint {
      
      	@Override
      	public void onModuleLoad() {
      		
      		GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
      			
      			@Override
      			public void onUncaughtException(Throwable e) {
      				GWT.log("Uncaught exception",e);
      			}
      		});
      		
      		String[] globalIds = new String[]{"NewPortletButton", "PortalLayout0", "PortalTabSet"};
      		
      		RPCManager.loadScreen("Portal", new LoadScreenCallback() {
      			
      			@Override
      			public void execute() {
      				
      				final TabSet tabSet = (TabSet) Canvas.getById("PortalTabSet");
      				Scheduler.get().scheduleDeferred(new ScheduledCommand() {
      					@Override
      					public void execute() {
      						Tab[] tabs = tabSet.getTabs();
      						for (Tab tab : tabs) {
      							System.out.println(tab);
      						}
      					}
      				});
      				
      				final PortalLayout portalLayout = (PortalLayout) Canvas.getById("PortalLayout0");
      				final IButton newTabButton = (IButton) Canvas.getById("NewPortletButton");
      				newTabButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
      					@Override
      					public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
      						final Portlet aPortlet = new Portlet();
      						//hack to enable user title renaming
      						aPortlet.addDoubleClickHandler(new DoubleClickHandler() {		
      							@Override
      							public void onDoubleClick(DoubleClickEvent event) {
      								if(aPortlet.getOffsetY() < 20){ //this is the title bar
      									Dialog dialog = new Dialog();
      									dialog.setWidth(200);
      									SC.askforValue("Rename", "Enter the new name", aPortlet.getTitle(), new ValueCallback() {
      										@Override
      										public void execute(String value) {
      											if(value != null && !value.equals("")){
      												aPortlet.setTitle(value);
      											}
      										}
      									}, dialog);
      								}
      							}
      						});
      						portalLayout.addPortlet(aPortlet);
      					}
      				});
      			}
      		}, globalIds);
      	}
      }
      Code:
      22:29:01.915 [ERROR] [com.mightyfleet.map.Navigator] 22:29:01.910:XRP1:WARN:Log:Error when executing loaded screen: InternalError: too much recursion
      Stack from error.stack:
          unnamed(isc_Layout_gatherSize) @ com.aCompany.GWTModule/sc/modules/ISC_Foundation.js:250
          unnamed(isc_Layout__getMemberSize) @ com.aCompany.GWTModule/sc/modules/ISC_Foundation.js:320
          unnamed(isc_Layout_layoutChildre) @ com.aCompany.GWTModule/sc/modules/ISC_Foundation.js:311
          unnamed(isc_Canvas__completeResizeB) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1897
          unnamed(isc_Canvas_moveB) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1857
          unnamed(isc_Canvas_moveT) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1880
          unnamed(isc_Canvas_setRec) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1663
          unnamed(isc_TabSet_placeControlLayou) @ com.aCompany.GWTModule/sc/modules/ISC_Containers.js:264
          unnamed(isc_TabSet__controlLayoutChildResize) @ com.aCompany.GWTModule/sc/modules/ISC_Containers.js:265
          unnamed(isc_TabSet_showControls/_8<.childResize) @ com.aCompany.GWTModule/sc/modules/ISC_Containers.js:255
          unnamed(isc.A.$5) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1900
          unnamed(isc_Canvas__completeResizeB) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1899
          unnamed(isc_Canvas_resizeB) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1895
          unnamed(isc_Canvas_resizeT) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1907
          unnamed(isc_Layout_resizeMember) @ com.aCompany.GWTModule/sc/modules/ISC_Foundation.js:274
          unnamed(isc_Layout_layoutChildre) @ com.aCompany.GWTModule/sc/modules/ISC_Foundation.js:316
          unnamed(isc_Canvas__completeResizeB) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1897
          unnamed(isc_Canvas_moveB) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1857
          unnamed(isc_Canvas_moveT) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1880
          unnamed(isc_Canvas_setRec) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1663
          unnamed(isc_TabSet_placeControlLayou) @ com.aCompany.GWTModule/sc/modules/ISC_Containers.js:264
          unnamed(isc_TabSet__controlLayoutChildResize) @ com.aCompany.GWTModule/sc/modules/ISC_Containers.js:265
          unnamed(isc_TabSet_showControls/_8<.childResize) @ com.aCompany.GWTModule/sc/modules/ISC_Containers.js:255
          unnamed(isc.A.$5) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1900
          unnamed(isc_Canvas__completeResizeB) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1899
          unnamed(isc_Canvas_resizeB) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1895
          unnamed(isc_Canvas_resizeT) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1907
          unnamed(isc_Layout_resizeMember) @ com.aCompany.GWTModule/sc/modules/ISC_Foundation.js:274
          unnamed(isc_Layout_layoutChildre) @ com.aCompany.GWTModule/sc/modules/ISC_Foundation.js:316
          unnamed(isc_Canvas__completeResizeB) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1897
         ...
          unnamed(isc_Canvas__completeResizeB) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1897
          unnamed(isc_Canvas_moveB) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1857
          unnamed(isc_Canvas_moveT) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1880
          unnamed(isc_Canvas_setRec) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1663
          unnamed(isc_TabSet_placeControlLayou) @ com.aCompany.GWTModule/sc/modules/ISC_Containers.js:264
          unnamed(isc_TabSet_showControl) @ com.aCompany.GWTModule/sc/modules/ISC_Containers.js:261
          unnamed(isc_TabSet_fixLayou) @ com.aCompany.GWTModule/sc/modules/ISC_Containers.js:246
          unnamed(isc_TabSet_dra) @ com.aCompany.GWTModule/sc/modules/ISC_Containers.js:225
          unnamed(isc_Canvas_ini) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:1463
          unnamed(isc_Class_completeCreatio) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:285
          unnamed(isc_c_Class_creat) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:191
          unnamed() @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:280
          unnamed(isc_c_Class_evaluat) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:213
          unnamed(isc_c_Class_globalEvalWithCaptur) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:268
          unnamed(isc_c_Class_globalEvalAndRestor) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:272
          unnamed(isc_c_RPCManager_loadScreen/_6.callbac) @ com.aCompany.GWTModule/sc/modules/ISC_DataBinding.js:1242
          unnamed(isc_c_Class_fireCallbac) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:256
          unnamed(isc_Class_fireCallbac) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:311
          unnamed(isc_c_RPCManager_fireReplyCallbac) @ com.aCompany.GWTModule/sc/modules/ISC_DataBinding.js:1221
          unnamed($wnd.isc.RPCManager.fireReplyCallbac) @ :234
          unnamed(isc_c_RPCManager_fireReplyCallback) @ com.aCompany.GWTModule/sc/modules/ISC_DataBinding.js:1224
          unnamed(isc_c_RPCManager_performOperationRepl) @ com.aCompany.GWTModule/sc/modules/ISC_DataBinding.js:1221
          unnamed(isc_c_RPCManager__performTransactionRepl) @ com.aCompany.GWTModule/sc/modules/ISC_DataBinding.js:1215
          unnamed(isc_c_RPCManager_performTransactionRepl) @ com.aCompany.GWTModule/sc/modules/ISC_DataBinding.js:1181
          unnamed(anonymou) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:63
          unnamed(isc_c_Class_fireCallbac) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:256
          unnamed(isc_c_Comm_performXmlTransactionRepl) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:930
          unnamed(anonymou) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:63
          unnamed(isc_c_Class_fireCallbac) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:256
          unnamed(isc_c_Comm__fireXMLCallbac) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:912
          unnamed(isc_c_Comm_sendXmlHttpRequest/_1) @ com.aCompany.GWTModule/sc/modules/ISC_Core.js:917
          unnamed() @ 
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
          at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
          at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
          at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
          at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
          at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
          at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
          at java.lang.Thread.run(Thread.java:722)
      FF 20.0.1 & Version 26.0.1410.64 m
      SmartClient Version: v8.3p_2013-05-10/PowerEdition Deployment (built 2013-05-10)
      Last edited by fatzopilot; 13 May 2013, 13:03.

      Comment


        #4
        What you would do is insert an HLayout with width:* as your *single* tabBarControls widget, then put the other widgets inside this layout. That would allow you to set layout.align, and would also make your LayoutSpacer make sense.

        Comment


          #5
          We also fixed the infinite recursion issue you were seeing with the LayoutSpacer (for tomorrow's builds).

          Comment


            #6
            Hi,

            thanks, and sorry, I still do not get it.
            Here are my attempts:
            Code:
            ...
            <tabBarControls>
            	<HLayout width="*" align="right">
            		<value>NewPortletButton</value>
            		<value>LogoutButton</value>
            	</HLayout>
            </tabBarControls>
            ...
            Leads to the following message, which is repeated 6 times in the debug console:
            Code:
            13:41:41.441:XRP1:WARN:TabSet:PortalTabSet:Unable to resolve specified tabBarControl:"
            			<value>NewPortletButton</value>
            			<value>LogoutButton</value>
            		  " to a valid control. Not displaying.
            ----------------
            Code:
            ...
            <tabBarControls>
            	<HLayout width="*" align="right">
            		<IButton ID="NewPortletButton">
            			<title>NewPortletButton</title>
            			<icon>[SKIN]/DynamicForm/text_control.gif</icon>
            		</IButton>
            		
            		<IButton ID="LogoutButton">
            			<title>Logout</title>
            			<icon>[SKIN]/FileBrowser/upOneLevel.png</icon>
            		</IButton>
            	</HLayout>
            </tabBarControls>
            ...
            ->
            Code:
            13:45:03.921:XRP2:WARN:TabSet:PortalTabSet:Unable to resolve specified tabBarControl:"
            	<IButton ID="NewPortletButton">
            		<title>NewPortletButton</title>
            		<icon>[SKIN]/DynamicForm/text_control.gif</icon>
            	</IButton>
            	
            	<IButton ID="LogoutButton">
            		<title>Logout</title>
            		<icon>[SKIN]/FileBrowser/upOneLevel.png</icon>
            	</IButton>
              " to a valid control. Not displaying.
            ----------------
            Code:
            ...
            <HLayout ID="TabBarControlsLayout" align="right" width="*">
            	<value>NewPortletButton</value>
            	<value>Logout</value>
            </HLayout>
            ...
            <tabBarControls>
            	<value>TabBarControlsLayout</value>
            </tabBarControls>
            ...
            ->
            no errors but the two buttons don't show up.
            ----------------
            Code:
            ...
            	<HLayout ID="TabBarControlsLayout" align="right" width="*">
            	    <IButton ID="NewPortletButton">
            			<title>NewPortletButton</title>
            			<icon>[SKIN]/DynamicForm/text_control.gif</icon>
            		</IButton>
            		<IButton ID="LogoutButton">
            			<title>Logout</title>
            			<icon>[SKIN]/FileBrowser/upOneLevel.png</icon>
            		</IButton>
            	</HLayout>
            	...
            	<tabBarControls>
            			<value>TabBarControlsLayout</value>
            	</tabBarControls>
            	...
            ->
            no errors but the two buttons don't show up.

            The same happens for
            Code:
            ...
            <tabBarControls>
            	TabBarControlsLayout
            </tabBarControls>
            ...
            ----------------
            Code:
            ...
            <tabBarControls>
            	<Canvas ref="TabBarControlsLayout" />
            </tabBarControls>
            ...
            gives
            Code:
            14:16:41.282:XRP2:WARN:TabSet:PortalTabSet:Unable to resolve specified tabBarControl:"" to a valid control. Not displaying.
            I did not try other permutations as I think it leads to nowhere.
            Would be nice if you gave a working example by modifying the componentXML provided in the third post.
            I don't have background in SmartClient or even JS, I am merely trying to map the Java syntax to componentXML and would prefer not to do brute force "coding".

            Thanks,
            fatzopilot

            Comment


              #7
              Hi,

              please ignore this, I just figured it out.
              I was missing the
              Code:
              <members>
              tags inside the layout. Now it works.

              Thanks,
              fatzopilot

              Comment


                #8
                Hi,

                Sorry for getting back on this, but now I am lacking the standard controls "tabScroller" and "tabPicker".
                I tried

                Code:
                ...
                <HLayout ID="TabBarControlsLayout" align="right" width="*">
                	<members>
                		<LayoutSpacer width="*"/>
                		
                		XXX
                
                		<IButton ID="NewTabButton">
                			<title><fmt:message key='tabBar_NewTab' /></title>
                			<icon>[SKIN]/DynamicForm/text_control.gif</icon>
                			<visibility>hidden</visibility>
                		</IButton>
                		
                		<LayoutSpacer width="2"/>
                
                		<IButton ID="PortletButton">
                			<title>Portlets</title>
                			<icon>[SKIN]/DynamicForm/text_control.gif</icon>
                			<visibility>hidden</visibility>
                		</IButton>
                	</members>
                </HLayout>
                ...
                <TabSet ID="PortalTabSet" autoDraw="true" tabBarAlign="left" canCloseTabs="false">
                	<tabBarControls>
                		<value>TabBarControlsLayout</value>
                	</tabBarControls>
                
                	<canCloseTabs>true</canCloseTabs>
                	<destroyPanes>false</destroyPanes>
                	<overflow>hidden</overflow>
                </TabSet>
                ...
                where
                Code:
                XXX = <value>TAB_SCROLLER</value>
                XXX = <Canvas><value>TAB_SCROLLER</value></Canvas>
                XXX = <Canvas ref="TAB_SCROLLER"/>
                XXX = <value>tabScroller</value>
                XXX = <Canvas><value>tabScroller</value></Canvas>
                XXX = <Canvas ref="tabScroller"/>
                and some other variants but to no avail.

                Thanks,
                fatzopilot

                Comment


                  #9
                  Sorry for the delay in responding.

                  What you want is to use the special constant value for the built-in controls, like one of your attempts:

                  Code:
                  <value xsi:type="string">tabScroller</value>
                  The problem is that this special constant will not be understood by the HLayout where you tried to put it. It needs to be directly under <tabBarControls>.

                  Since the problem that made you create a separate HLayout has been fixed, you can now inline all the controls you have in the HLayout under tabBarControls.
                  Last edited by Isomorphic; 23 May 2013, 11:47.

                  Comment


                    #10
                    Edited previous post - it's necessary to specify xsi:type="string" to correctly have <value>tabScroller</value> interpreted as a constant, as opposed to the global ID of some other widget you're creating.

                    Also, there's a small correction to the Component Schema needed to make this work - present in tomorrow's 3.1 and 4.0 builds.

                    We'll also be updating the tabBarControls docs with a sample of the right Component XML.

                    Comment


                      #11
                      Hi Isomorphic,

                      thanks for your efforts, the tab bar controls are shown now.
                      There is, however, still a problem with layouting them. Please take a look at the screenshots and code below.
                      <LayoutSpacer ID="makeControlsAlignRight" width="*"/> has been inserted as the first tabBarControl element as you suggested
                      to have the tabBarControls aligned right, if it is omitted, there is a gap on the right when the HiddenNewTabButton is in hidden state (withoutLayoutSpacer.png).
                      However, if it it is included, there is a gap in front of the tabBarControls (mysteriousGapWithTabControlsWithLayoutSpacer.png)
                      How to remedy this?

                      Code:
                      <isomorphicXML xmlns:fmt="WEB-INF/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
                      	<TabSet ID="PortalTabSet" tabBarAlign="left" width="100%">
                      		<tabBarControls>
                      			<LayoutSpacer ID="makeControlsAlignRight" width="*"/>
                      		    <value xsi:type="string">tabScroller</value>
                      		    <value xsi:type="string">tabPicker</value>
                      		    <IButton ID="HiddenNewTabButton">
                      				<title>HiddenNewTabButton</title>
                      				<icon>[SKIN]/DynamicForm/text_control.gif</icon>
                      				<visibility>hidden</visibility>
                      			</IButton>
                      			<LayoutSpacer ID="addSomeSpace" width="2"/>
                      			<IButton ID="UnhideButton">
                      				<title>UnhideButton</title>
                      				<icon>[SKIN]/DynamicForm/text_control.gif</icon>
                      			</IButton>
                      		</tabBarControls>
                      		<canCloseTabs>true</canCloseTabs>
                      		<destroyPanes>false</destroyPanes>
                      	</TabSet>
                      	<DataView ID="PortalDataView" width="100%" height="100%" overflow="hidden" >
                      		<members>
                      			<Canvas ref="PortalTabSet" />
                      		</members>
                      		<modulesDir>modules/</modulesDir>
                      	</DataView>
                      </isomorphicXML>
                      Code:
                      @Override
                      public void onModuleLoad() {
                      		
                      	RPCManager.loadScreen("Portal3", new LoadScreenCallback() {
                      		
                      		@Override
                      		public void execute() {
                      			
                      			final IButton newTabButton = (IButton) Canvas.getById("HiddenNewTabButton");
                      			final TabSet portalTabSet = (TabSet) Canvas.getById("PortalTabSet");
                      			newTabButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
                      				@Override
                      				public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
                      					Tab newTab = new Tab();
                      					portalTabSet.addTab(newTab);
                      				}
                      			});
                      			
                      			final IButton unhideButton = (IButton) Canvas.getById("UnhideButton");
                      			unhideButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
                      				@Override
                      				public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
                      					newTabButton.show();
                      				}
                      			});
                      		}
                      	},  new String[]{RPCManager.ALL_GLOBALS});
                      }
                      SmartClient Version: v8.3p_2013-05-24/PowerEdition Deployment (built 2013-05-24)

                      Thanks,
                      fatzopilot
                      Attached Files

                      Comment


                        #12
                        We're a little confused - the purpose of the LayoutSpacer would be to create the gap, and it would be expected to create that gap given where you placed it. So what's the mystery?

                        Maybe you actually want the gap *after* the scroller and picker? If so, please the LayoutSpacer there.

                        Comment


                          #13
                          Well,

                          the real issue here is the gap that appears if a hidden button is present in the tabBar controls. It appears to the right of all tabBarControl elements per default (probably because these controls have a right alignment). It is not influenced by the tabSet's tabBarAlign property, though.
                          In order to avoid the gap on the right side, you suggested to insert a LayoutSpacer : http://forums.smartclient.com/showpo...20&postcount=2
                          That did help. But now it turned out that the LayoutSpacer just shifts that gap (depending on where you put it). Putting it *after* the scroller and picker just puts it there.
                          What I really want is to get rid of that gap when the button in hidden.

                          Thanks,
                          fatzopilot

                          Comment


                            #14
                            The issue with there being an additional gap due to your initially hidden button is now corrected for tomorrow's builds (3.1 & 4.0).

                            Note that now that we've gotten clarity on exactly what gap was undesirable, you may not need the LayoutSpacer.

                            Comment


                              #15
                              Hi,

                              the hidden button now always appears at the right side (covering tabs if there are any), no matter if a

                              Code:
                              <LayoutSpacer ID="makeControlsAlignRight" width="*"/>
                              is present or not (still see code above).
                              This does not happen if the HiddenNewTabButton is visible right from the start.

                              SmartClient Version: v8.3p_2013-06-09/PowerEdition Deployment (built 2013-06-09)

                              Thanks,
                              fatzopilot

                              Comment

                              Working...
                              X