Announcement

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

    Sometimes pane is not rendered. :draw() called on widget with current drawn state: ha

    Hello,

    I got a sporadic issue that at random (it seems) points in time does not draw the Pane in a tab upon selecting the tab.

    Using:
    SmartClient Version: SC_SNAPSHOT-2011-11-10/PowerEdition Deployment (built 2011-11-10)

    Happens in all browsers at random points in time.


    My app consists of a TabSet, and upon tab selection the view set on the tab (via setPane) is instantiated and, upon tab deselection, the view is destroyed.

    This happens by a handler as follows (all tabs in the tabset have this handler registered):
    Code:
    protected class SytTabSelectedHandler
    			implements
    				TabSelectedHandler,
    				TabDeselectedHandler {
    		private int initCounter = 0;
    		private static final int PUZZELRICHTABLEVIEW = 1;
    		private static final int MERCHANTRICHTABLEVIEW = 2;
    	//..other views
    		private Map<Integer, Integer> overviewsMap = new HashMap<Integer, Integer>();
    
    		public SytTabSelectedHandler() {
    			overviewsMap.put(0, PUZZELRICHTABLEVIEW);
    			overviewsMap.put(1, MERCHANTRICHTABLEVIEW);
    		       //.. other views
    		}
    
    		public void onTabSelected(TabSelectedEvent event) {
    		     int selectedView = overviewsMap.get(event.getTabNum());
    
    		     renderCorrectView(selectedView, event.getTab());
    		}
    
    		protected void renderCorrectView(int selectedView, Tab tab) {
    			Canvas curView = null;
    			switch (selectedView) {
    
    				case PUZZELRICHTABLEVIEW : //instantiate PuzzelRichTableView, and set as pane in the tab.	 			
    					curView = new PuzzelRichTableView(userDetails);
    
    					break;
                                    // ... snipped the other views. But if PUZZELRICHTABLEVIEW tab is selected, instantiate this view.
    				default :
    					Log.error("This shouldn't be happening, the TabNum is not corresponding to a view!");
    					break;
    			}
    			tab.setPane(curView);
    	      }
    
    		public void onTabDeselected(TabDeselectedEvent event) {
    			//destroy the view to clear up memory
    			Canvas c = event.getTabPane();
    			c.destroy();
    			event.getTab().setPane(null);
    		}
    	}
    Again, mostly it works, I can switch between tabs and the correct view is rendered in the tab pane.

    Yet sometimes it does not work, not drawing the view, and it gives me the following warnings in the developer console (deployed mode, tomcat 6):
    Code:
    11:07:09.054:SCR4:WARN:Log:ResultSet.findNextIndex called with no cached local data. Calling code can use ResultSet.lengthIsKnown() to determine whether the ResultSet has loaded any data.
    11:07:09.054:SCR4:WARN:ResultSet:isc_ResultSet_10 (created by: isc_PuzzelRichTableView_1_1):getRange() called with no specified range - ignoring.
    11:10:56.522:TMR5:WARN:drawing:isc_PuzzelRichTableView_1:draw() called on widget with current drawn state: handleDrawn, ignoring.
    In the Watch tab of dev console, it says 'Drawn' to be 'No', on the PuzzelRichTableView_1

    Am I doing something fundamentally wrong as far as programming goes, or is this something else? I would like to know in which direction to look to figure out what causes this.

    I have not had the opportunity to spot this bug on IE, (to get a better stacktrace?). Here is the one from Dev console in FF 7
    Code:
    12:00:38.477:TMR1:WARN:drawing:isc_PuzzelRichTableView_1:draw() called on widget with current drawn state: handleDrawn, ignoring.
        Class.getStackTrace(_1=>undef,  _2=>undef,  _3=>undef,  _4=>undef)
        Canvas.readyToDraw()
        Canvas.draw(_1=>undef)
        Layout.layoutChildren(_1=>"resized",  _2=>-15,  _3=>-15)
        Canvas.$t1()
        Canvas.moveBy(_1=>0,  _2=>0,  _3=>undef,  _4=>true)
        Canvas.moveTo(_1=>0,  _2=>23,  _3=>undef,  _4=>true)
        Canvas.setRect(_1=>0,  _2=>23,  _3=>1265,  _4=>531,  _5=>undef)
        TabSet.fixLayout()
        TabSet.$54m()
        [o]TabBar.childResized([Canvas ID:isc_TabSet_0_tabBar_baseLine], -15, 0, undef)
        Canvas.$5y(deltaX=>-15,  deltaY=>0,  reason=>undef)
        ** recursed on Canvas.$t1
    Last edited by Sytematic; 11 Nov 2011, 03:05.

    #2
    Without runnable code, we can't tell what you might be doing wrong. The only thing that jumps out from what you've posted is that you should be calling setPane(null) *before* you destroy the pane widget, otherwise you are destroying a widget unexpectedly while it is still under the TabSet's management.

    Comment


      #3
      Okay, thanks, that's a hint that I will try first thing in the morning.

      Hopefully I can get a standalone test case or whatever, problem is that the symptoms come up at random times... Will try switching the destroy statement first.

      Comment


        #4
        Alright, unfortunately the symptoms still occur. It's hard to bring this down to a standalone test case, because it happens so randomly. Any suggestions on where to look in the meanwhile?

        Comment


          #5
          Really hard to suggest anything from so little information. You might try enabling the "draws" and "clears" logs to see if there's a difference in the order of drawing when the problem happens. Also, if you crank the "clears" log to DEBUG, it will log stack traces that may reveal what code is taking action.

          Comment


            #6
            I'm running into this issue too (SmartGWT 2.5p on FF7). Did this ever get resolved or is there any additional information to help debug it? Thanks.

            Comment


              #7
              No, the user never provided enough information to allow us to reproduce an issue, or to offer any further troubleshooting advice.

              It's not clear whether your issue is the same, but please look at all the suggestions provided to the other user above.

              Also, you should plan an update from 2.5 as soon as possible. It's about to be 3 releases behind, and bugfixes have long since stopped being backported to that version.

              Comment


                #8
                If I remember correctly from my memory, it was a programming error. (ie. my fault).

                I'm however sorry to say that i don't know what was changed. Back then we had used SVN, now Git, so I unfortunately cannot look it back up.

                I do know however, that it was fixed afterwards. So i would use the suggestion of isomorphic, and definitely upgrade your SmartGWT.

                Comment

                Working...
                X