Announcement

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

    TabSet setupCloseClickEvent changed

    Hi,

    using build SNAPSHOT_v8.3d_2012-08-22/Pro Deployment (built 2012-08-22)

    I'm getting a JS exception (TypeError): this.getTabObject is not a function when closing a Tab.
    I could trace it back to function TabSet.setupCloseClickEvent.
    This one recently got changed. The attached screenshot shows a compare from build 08/08 with the 22/08 build.

    I haven't tested yet with the code from 08/08 to verify if I don't get the JS error, but can you let me know first if the code in 22/08 is the good version or should it be reverted to the previous code?


    TIA


    BTW some other setupXXXEvent() code in that class are changed as well.

    #2
    Oops, I keep forgetting to first attach, then click submit reply.
    It might not be readable anyway with the max width of 800px limitation when uploading files, but I guess it proves my 'code got changed' point.
    Attached Files

    Comment


      #3
      Hi,

      any update on this JS error message?

      thanks

      Comment


        #4
        This is under investigation - we'll let you know when we have any information

        Regards
        Isomorphic Software

        Comment


          #5
          We have made a change which should resolve this issue. Please try the next nightly build (Aug 31 or greater)

          Regards
          Isomorphic Software

          Comment


            #6
            Thanks the JS error is gone, but it still breaks existing code:
            I lose the class notion of my specific Tab class in the event.

            Existing code was ((MyTab)event.getTab()).checkSomething() which now throws 'cannot cast Tab to MyTab'.

            Repro:
            Code:
            private class MyTab extends Tab {
            	
            	public MyTab() {
            		setCanClose(true);
            	}
            	
            	public boolean checkSomething() {
            		// check some business rule
            		return getTabSet().getNumTabs() > 2;
            	}
            	
            }
            
            public Canvas getViewPanel() {
            	final TabSet tabset = new TabSet();
            	tabset.setDestroyPanes(false);
            	tabset.setHeight100();
            	tabset.setWidth100();
            	
            
            	tabset.addCloseClickHandler(new CloseClickHandler() {
            		
            		public void onCloseClick(TabCloseClickEvent event) {
            			Tab t = event.getTab();
            			SC.logDebug("tab is a " + t.getClass().getName());
            			
            			if (t instanceof MyTab) {
            				// if the business rule is NOK, don't close my tab
            				if (!((MyTab)t).checkSomething()) event.cancel();
            			} else {
            				SC.say("Whoops tab is a " + t.getClass().getName());
            			}
            		}
            	});
            	
            	
            	Button addTab = new Button("Add a tab");
            	addTab.addClickHandler(new ClickHandler() {
            		
            		public void onClick(ClickEvent event) {
            			MyTab tab = new MyTab();
            			tab.setTitle("Tab #" + tabset.getNumTabs());
            			tabset.addTab(tab);
            		}
            	});
            	
            
            	VLayout layout = new VLayout();
            	layout.setWidth100();
            	layout.setMembers(tabset, addTab);
            	return layout;
            }
            SNAPSHOT_v8.3d_2012-08-31/Pro Deployment (built 2012-08-31)

            Comment


              #7
              We see it and have made a change to address the problem.
              Sorry for the confusion
              Please try tomorrow's build

              Regards
              Isomorphic Software

              Comment


                #8
                Thanks, working OK in SNAPSHOT_v8.3d_2012-09-05/Pro Deployment (built 2012-09-05)

                Comment

                Working...
                X