Announcement

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

    Tab reordering

    I tried to develop the code like

    1) Tab reordering. If drag the tab and drop the tab in wherever in the tabbar it should be reorder with new position.

    I tried but it is not coming. Can u help me out.

    Thanks

    Avinash.

    #2
    Same question... any out-of-the-box way to let the user reorder tabs via drag and drop, similar to the way Google Chrome lets you move its browser tabs?

    Comment


      #3
      Before attempting any dnd, I figured I would test simple tab moving.
      So I just added 2 Tabs to a TabSet, and I have a button to simply move the tab at index 1 to index 0.

      My best guess was this:
      Code:
      final TabSet tabSet = tab.getTabSet ();
      final Tab[] tabArray = tabSet.getTabs ();
      final Tab tab0 = tabArray [0];
      tabArray [0] = tabArray [1];
      tabArray [1] = tab0;          
      tabSet.setTabs (tabArray);
      But I got this error:
      Code:
      08:47:50.422 [ERROR] 01:40:26.964:MUP0:WARN:Log:ClassFactory.addGlobalID: ID:'smartGwtTabId_1271839218421' for object '[ImgTab ID:smartGwtTabId_1271839218421]' collides with ID of existing object '[ImgTab ID:smartGwtTabId_1271839218421]'. The pre-existing widget will be destroyed.com.smartgwt.client.core.JsObject$SGWT_WARN: 01:40:26.964:MUP0:WARN:Log:ClassFactory.addGlobalID: ID:'smartGwtTabId_1271839218421' for object '[ImgTab ID:smartGwtTabId_1271839218421]' collides with ID of existing object '[ImgTab ID:smartGwtTabId_1271839218421]'. The pre-existing widget will be destroyed.
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
       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:157)
       at com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:1713)
       at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:165)
       at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
       at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
       at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:284)
       at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
       at com.smartgwt.client.widgets.tab.TabSet.addTabPostCreate(TabSet.java)
       at com.smartgwt.client.widgets.tab.TabSet.addTab(TabSet.java:1286)
       at com.smartgwt.client.widgets.tab.TabSet.setTabs(TabSet.java:983)
       at org.portal.web.client.explorer.page.TabContextMenu.moveTab(TabContextMenu.java:112)
       at org.portal.web.client.explorer.page.TabContextMenu.access$0(TabContextMenu.java:76)
       at org.portal.web.client.explorer.page.TabContextMenu$2.onClick(TabContextMenu.java:69)
       at com.smartgwt.client.widgets.menu.events.MenuItemClickEvent.dispatch(MenuItemClickEvent.java:95)
       at com.smartgwt.client.widgets.menu.events.MenuItemClickEvent.dispatch(MenuItemClickEvent.java:1)
       at com.google.gwt.event.shared.HandlerManager$HandlerRegistry.fireEvent(HandlerManager.java:65)
       at com.google.gwt.event.shared.HandlerManager$HandlerRegistry.access$1(HandlerManager.java:53)
       at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:178)
       at com.smartgwt.client.core.DataClass.fireEvent(DataClass.java:189)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
       at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
       at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
       at com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:1713)
       at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:165)
       at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
       at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
       at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
       at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
       at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
       at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188)
       at sun.reflect.GeneratedMethodAccessor104.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
       at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
       at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
       at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1668)
       at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401)
       at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
       at java.lang.Thread.run(Thread.java:619)
      So my question now is: how do I move a tab from one index to another?
      I'll try any other idea...

      Comment


        #4
        Originally posted by shortpasta
        Same question... any out-of-the-box way to let the user reorder tabs via drag and drop, similar to the way Google Chrome lets you move its browser tabs?
        This is presently not supported out of the box.

        Comment


          #5
          Hello everybody,
          If you are interested in this feature, please reply if you would consider splitting the cost to get this done via Feature Sponsorship:
          http://www.smartclient.com/services/index.jsp#features
          Thanks!

          Comment


            #6
            Is this feature added in SmartGWT now ? or any plans to add it in future ?

            Comment


              #7
              This is still waiting for sponsors.

              Note, to move a tab programmatically, call removeTab then addTab. Note also the tabSet.destroyPanes property.

              Comment


                #8
                Hi,

                Is there a way to move a Tab in a TabSet (reorder a Tab)?
                And move a Tab from one TabSet to another?

                I know that there is a Drag n Drop in TabSet but that's not implemented in Tab.

                I'm trying to create an interface like in Eclipse where user can rearrange tabs on diferent TabSets (Left, Center and Right).

                Many thanks

                Comment


                  #9
                  SGWT 4.0d / SmartClient 9.0d builds, available from smartclient.com/builds, now support Tab reordering via TabSet.canReorderTabs and the TabSet.reorderTab() API.

                  Comment


                    #10
                    Originally posted by Isomorphic View Post
                    SGWT 4.0d / SmartClient 9.0d builds, available from smartclient.com/builds, now support Tab reordering via TabSet.canReorderTabs and the TabSet.reorderTab() API.
                    Thank you very much!

                    Comment

                    Working...
                    X