Announcement

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

    Databound listgrid hanging on autofetch

    Dear Isomorphic Support:

    I have a strange situation happening with a databound listgrid. The listgrid hangs on autofetch unless I perform a

    startEditingNew();
    cancelEditing();

    sequence after the listgrid is drawn.

    The grid also frees itself when I call the startEditingNew() method that is tied to my add record button after the autofetch.
    The exact behaviour I am seeing is the grid is drawn with the records, however, the grid is not editable. There wasn't any logs
    in the development mode console or any obivious hints in the debug console. I put in some println's in the code and it did show
    that the framework is hanging on something. I added a fetch handler to the listgrid which dumped a println "onFetchData grid flag set", and
    also added println's in my canEdit override (added a break point in there also for good measure). Here is my override for canEditCell:

    Code:
    	@Override  
    	protected boolean canEditCell(int rowNum, int colNum) {
     		System.out.println("called canEdit=(" + rowNum + "," + colNum );
    		boolean enable = handleCellEnablement(rowNum,colNum); 							
    		System.out.println("called canEdit=(" + rowNum + "," + colNum + ")=" + enable);
    		return enable; 
    	}

    The interesting thing is in the version where I don't call startEditingNew() on initialization, the "onFetchData grid flag set" flag is being
    displayed, so the fetch is being performed (obvious since I am seeing the records in the grid). However, canEditCell is not being called.
    So I'm speculating something is hanging in the framework before this. Logs and details below.


    Product: SmartGWT 3.0p nightly build Nov 15, 2012
    Browser: IE 9

    Sample code:


    Working:

    Code:
    === 2012-11-19 11:43:40,542 [l0-4] INFO  RequestContext - URL: '/bulkuserprovisioning/sc/DataSourceLoader', User-Agent: 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)': MSIE with Accept-Encoding header, ready for compressed JS
    === 2012-11-19 11:43:40,544 [l0-4] INFO  DSResponse - DSResponse: List with 2 items
    === 2012-11-19 11:43:40,567 [l0-4] INFO  Compression - /bulkuserprovisioning/sc/DataSourceLoader: 5618 -> 950 bytes
    === 2012-11-19 11:43:41,004 [l0-4] INFO  Download - Returning 304: Not modified on conditional get of: D:\sandbox\eclipse\workspace\bulkuserprovisioning\war\bulkuserprovisioning\sc\skins\Enterprise\load_skin.js
    === 2012-11-19 11:43:41,044 [l0-2] INFO  Compression - /bulkuserprovisioning/sc/modules/ISC_Core.js: 719084 -> 186481 bytes
    === 2012-11-19 11:43:41,783 [l0-2] INFO  Download - Returning 304: Not modified on conditional get of: D:\sandbox\eclipse\workspace\bulkuserprovisioning\war\bulkuserprovisioning\sc\skins\Enterprise\skin_styles.css
    onFetchData grid flag set
    called canEdit=(1000,0
    called canEdit=(1000,0)=false
    called canEdit=(1000,0
    called canEdit=(1000,0)=false
    called canEdit=(1000,1
    called canEdit=(1000,1)=true
    called canEdit=(1000,2
    called canEdit=(1000,2)=true
    called canEdit=(1000,3
    called canEdit=(1000,3)=true
    called canEdit=(1000,3
    called canEdit=(1000,3)=true
    === 2012-11-19 11:43:54,634 [l0-4] INFO  RequestContext - URL: '/bulkuserprovisioning/sc/IDACall', User-Agent: 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)': MSIE with Accept-Encoding header, ready for compressed JS
    === 2012-11-19 11:43:54,635 [l0-5] INFO  RequestContext - URL: '/bulkuserprovisioning/sc/IDACall', User-Agent: 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)': MSIE with Accept-Encoding header, ready for compressed JS
    === 2012-11-19 11:43:54,636 [l0-2] INFO  RequestContext - URL: '/bulkuserprovisioning/sc/IDACall', User-Agent: 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)': MSIE with Accept-Encoding header, ready for compressed JS
    === 2012-11-19 11:43:54,639 [l0-5] DEBUG XML - Parsed XML from (in memory stream): 4ms
    === 2012-11-19 11:43:54,639 [l0-4] DEBUG XML - Parsed XML from (in memory stream): 4ms
    === 2012-11-19 11:43:54,639 [l0-2] DEBUG XML - Parsed XML from (in memory stream): 3ms
    === 2012-11-19 11:43:54,641 [l0-5] DEBUG RPCManager - Processing 1 requests.
    === 2012-11-19 11:43:54,641 [l0-2] DEBUG RPCManager - Processing 1 requests.
    === 2012-11-19 11:43:54,641 [l0-4] DEBUG RPCManager - Processing 1 requests.
    === 2012-11-19 11:43:54,641 [l0-5] INFO  DSResponse - DSResponse: List with 2 items
    === 2012-11-19 11:43:54,641 [l0-2] DEBUG RPCManager - Request #1 (DSRequest) payload: {
        criteria:{
        },
        operationConfig:{
            dataSource:"roleDMI",
            operationType:"fetch"
        },
        appID:"builtinApplication",
        operation:"roleDMI_fetch",
        oldValues:{
        }
    }
    === 2012-11-19 11:43:54,641 [l0-2] INFO  IDACall - Performing 1 operation(s)
    === 2012-11-19 11:43:54,641 [l0-5] DEBUG RPCManager - Request #1 (DSRequest) payload: {
        criteria:{
        },
        operationConfig:{
            dataSource:"bupGridDMI",
            operationType:"fetch",
            textMatchStyle:"substring"
        },
        componentId:"isc_BUPMainWidget_4_0",
        appID:"builtinApplication",
        operation:"bupGridDMI_fetch",
        oldValues:null
    }
    === 2012-11-19 11:43:54,641 [l0-5] INFO  IDACall - Performing 1 operation(s)
    === 2012-11-19 11:43:54,642 [l0-2] DEBUG AppBase - [builtinApplication.roleDMI_fetch] No userTypes defined, allowing anyone access to all operations for this application
    === 2012-11-19 11:43:54,642 [l0-5] DEBUG AppBase - [builtinApplication.bupGridDMI_fetch] No userTypes defined, allowing anyone access to all operations for this application
    === 2012-11-19 11:43:54,642 [l0-2] DEBUG AppBase - [builtinApplication.roleDMI_fetch] No public zero-argument method named '_roleDMI_fetch' found, performing generic datasource operation
    === 2012-11-19 11:43:54,642 [l0-4] DEBUG RPCManager - Request #1 (DSRequest) payload: {
        criteria:{
        },
        operationConfig:{
            dataSource:"roleDMI",
            operationType:"fetch",
            textMatchStyle:"startsWith"
        },
        startRow:0,
        endRow:75,
        componentId:"isc_PickListMenu_0",
        appID:"builtinApplication",
        operation:"roleDMI_fetch",
        oldValues:{
        }
    }
    === 2012-11-19 11:43:54,642 [l0-2] INFO  DSResponse - [builtinApplication.roleDMI_fetch] DSResponse: List with 2 items
    === 2012-11-19 11:43:54,642 [l0-4] INFO  IDACall - Performing 1 operation(s)
    === 2012-11-19 11:43:54,642 [l0-5] DEBUG AppBase - [builtinApplication.bupGridDMI_fetch] No public zero-argument method named '_bupGridDMI_fetch' found, performing generic datasource operation
    Execute Fetch Called
    === 2012-11-19 11:43:54,642 [l0-4] DEBUG AppBase - [builtinApplication.roleDMI_fetch] No userTypes defined, allowing anyone access to all operations for this application
    === 2012-11-19 11:43:54,642 [l0-5] INFO  DSResponse - [builtinApplication.bupGridDMI_fetch] DSResponse: List with 4 items
    === 2012-11-19 11:43:54,642 [l0-2] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
    === 2012-11-19 11:43:54,642 [l0-4] DEBUG AppBase - [builtinApplication.roleDMI_fetch] No public zero-argument method named '_roleDMI_fetch' found, performing generic datasource operation
    === 2012-11-19 11:43:54,642 [l0-5] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
    === 2012-11-19 11:43:54,642 [l0-4] INFO  DSResponse - [builtinApplication.roleDMI_fetch] DSResponse: List with 2 items
    === 2012-11-19 11:43:54,642 [l0-4] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
    === 2012-11-19 11:43:54,642 [l0-2] DEBUG RPCManager - non-DMI response, dropExtraFields: false
    === 2012-11-19 11:43:54,642 [l0-5] INFO  DSResponse - DSResponse: List with 2 items
    === 2012-11-19 11:43:54,643 [l0-4] DEBUG RPCManager - non-DMI response, dropExtraFields: false
    === 2012-11-19 11:43:54,643 [l0-5] DEBUG RPCManager - DMI response, dropExtraFields: true
    === 2012-11-19 11:43:54,643 [l0-5] INFO  DSResponse - DSResponse: List with 2 items
    === 2012-11-19 11:43:54,643 [l0-2] INFO  Compression - /bulkuserprovisioning/sc/IDACall: 546 -> 308 bytes
    === 2012-11-19 11:43:54,643 [l0-4] INFO  Compression - /bulkuserprovisioning/sc/IDACall: 546 -> 308 bytes
    === 2012-11-19 11:43:54,644 [l0-5] INFO  Compression - /bulkuserprovisioning/sc/IDACall: 1467 -> 656 bytes
    kicking validate grid
    Scheduling revalidate grid
    Running validation loop
    === 2012-11-19 11:43:55,075 [l0-5] INFO  RequestContext - URL: '/bulkuserprovisioning/sc/skins/Enterprise/images/actions/exclamation.png', User-Agent: 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)': MSIE with Accept-Encoding header, ready for compressed JS
    === 2012-11-19 11:43:55,076 [l0-5] INFO  Download - done streaming: D:/sandbox/eclipse/workspace/bulkuserprovisioning/war/bulkuserprovisioning/sc/skins/Enterprise/images/actions/exclamation.png


    Not working:

    Code:
    === 2012-11-19 11:42:25,373 [l0-5] INFO  RequestContext - URL: '/bulkuserprovisioning/sc/DataSourceLoader', User-Agent: 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)': MSIE with Accept-Encoding header, ready for compressed JS
    === 2012-11-19 11:42:25,374 [l0-5] INFO  DSResponse - DSResponse: List with 2 items
    === 2012-11-19 11:42:25,389 [l0-5] INFO  Compression - /bulkuserprovisioning/sc/DataSourceLoader: 5618 -> 950 bytes
    === 2012-11-19 11:42:25,413 [l0-5] INFO  Download - Returning 304: Not modified on conditional get of: D:\sandbox\eclipse\workspace\bulkuserprovisioning\war\bulkuserprovisioning\sc\skins\Enterprise\load_skin.js
    === 2012-11-19 11:42:25,892 [l0-2] INFO  Compression - /bulkuserprovisioning/sc/modules/ISC_Core.js: 719084 -> 186481 bytes
    === 2012-11-19 11:42:26,898 [l0-2] INFO  Download - Returning 304: Not modified on conditional get of: D:\sandbox\eclipse\workspace\bulkuserprovisioning\war\bulkuserprovisioning\sc\skins\Enterprise\skin_styles.css
    onFetchData grid flag set
    === 2012-11-19 11:42:30,493 [l0-2] INFO  RequestContext - URL: '/bulkuserprovisioning/sc/IDACall', User-Agent: 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)': MSIE with Accept-Encoding header, ready for compressed JS
    === 2012-11-19 11:42:30,493 [l0-6] INFO  RequestContext - URL: '/bulkuserprovisioning/sc/IDACall', User-Agent: 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)': MSIE with Accept-Encoding header, ready for compressed JS
    === 2012-11-19 11:42:30,495 [l0-0] INFO  RequestContext - URL: '/bulkuserprovisioning/sc/IDACall', User-Agent: 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)': MSIE with Accept-Encoding header, ready for compressed JS
    === 2012-11-19 11:42:30,495 [l0-6] DEBUG XML - Parsed XML from (in memory stream): 2ms
    === 2012-11-19 11:42:30,497 [l0-2] DEBUG XML - Parsed XML from (in memory stream): 4ms
    === 2012-11-19 11:42:30,497 [l0-0] DEBUG XML - Parsed XML from (in memory stream): 2ms
    === 2012-11-19 11:42:30,498 [l0-6] DEBUG RPCManager - Processing 1 requests.
    === 2012-11-19 11:42:30,498 [l0-6] INFO  DSResponse - DSResponse: List with 2 items
    === 2012-11-19 11:42:30,498 [l0-2] DEBUG RPCManager - Processing 1 requests.
    === 2012-11-19 11:42:30,499 [l0-6] DEBUG RPCManager - Request #1 (DSRequest) payload: {
        criteria:{
        },
        operationConfig:{
            dataSource:"bupGridDMI",
            operationType:"fetch",
            textMatchStyle:"substring"
        },
        componentId:"isc_BUPMainWidget_4_0",
        appID:"builtinApplication",
        operation:"bupGridDMI_fetch",
        oldValues:null
    }
    === 2012-11-19 11:42:30,499 [l0-6] INFO  IDACall - Performing 1 operation(s)
    === 2012-11-19 11:42:30,499 [l0-0] DEBUG RPCManager - Processing 1 requests.
    === 2012-11-19 11:42:30,499 [l0-6] DEBUG AppBase - [builtinApplication.bupGridDMI_fetch] No userTypes defined, allowing anyone access to all operations for this application
    === 2012-11-19 11:42:30,499 [l0-6] DEBUG AppBase - [builtinApplication.bupGridDMI_fetch] No public zero-argument method named '_bupGridDMI_fetch' found, performing generic datasource operation
    Execute Fetch Called
    === 2012-11-19 11:42:30,499 [l0-6] INFO  DSResponse - [builtinApplication.bupGridDMI_fetch] DSResponse: List with 4 items
    === 2012-11-19 11:42:30,499 [l0-6] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
    === 2012-11-19 11:42:30,499 [l0-2] DEBUG RPCManager - Request #1 (DSRequest) payload: {
        criteria:{
        },
        operationConfig:{
            dataSource:"roleDMI",
            operationType:"fetch"
        },
        appID:"builtinApplication",
        operation:"roleDMI_fetch",
        oldValues:{
        }
    }
    === 2012-11-19 11:42:30,499 [l0-2] INFO  IDACall - Performing 1 operation(s)
    === 2012-11-19 11:42:30,499 [l0-0] DEBUG RPCManager - Request #1 (DSRequest) payload: {
        criteria:{
        },
        operationConfig:{
            dataSource:"roleDMI",
            operationType:"fetch",
            textMatchStyle:"startsWith"
        },
        startRow:0,
        endRow:75,
        componentId:"isc_PickListMenu_0",
        appID:"builtinApplication",
        operation:"roleDMI_fetch",
        oldValues:{
        }
    }
    === 2012-11-19 11:42:30,499 [l0-6] INFO  DSResponse - DSResponse: List with 2 items
    === 2012-11-19 11:42:30,500 [l0-2] DEBUG AppBase - [builtinApplication.roleDMI_fetch] No userTypes defined, allowing anyone access to all operations for this application
    === 2012-11-19 11:42:30,500 [l0-0] INFO  IDACall - Performing 1 operation(s)
    === 2012-11-19 11:42:30,500 [l0-2] DEBUG AppBase - [builtinApplication.roleDMI_fetch] No public zero-argument method named '_roleDMI_fetch' found, performing generic datasource operation
    === 2012-11-19 11:42:30,500 [l0-0] DEBUG AppBase - [builtinApplication.roleDMI_fetch] No userTypes defined, allowing anyone access to all operations for this application
    === 2012-11-19 11:42:30,500 [l0-2] INFO  DSResponse - [builtinApplication.roleDMI_fetch] DSResponse: List with 2 items
    === 2012-11-19 11:42:30,500 [l0-6] DEBUG RPCManager - DMI response, dropExtraFields: true
    === 2012-11-19 11:42:30,500 [l0-0] DEBUG AppBase - [builtinApplication.roleDMI_fetch] No public zero-argument method named '_roleDMI_fetch' found, performing generic datasource operation
    === 2012-11-19 11:42:30,500 [l0-2] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
    === 2012-11-19 11:42:30,500 [l0-0] INFO  DSResponse - [builtinApplication.roleDMI_fetch] DSResponse: List with 2 items
    === 2012-11-19 11:42:30,500 [l0-0] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
    === 2012-11-19 11:42:30,500 [l0-2] DEBUG RPCManager - non-DMI response, dropExtraFields: false
    === 2012-11-19 11:42:30,500 [l0-6] INFO  DSResponse - DSResponse: List with 2 items
    === 2012-11-19 11:42:30,500 [l0-0] DEBUG RPCManager - non-DMI response, dropExtraFields: false
    === 2012-11-19 11:42:30,501 [l0-2] INFO  Compression - /bulkuserprovisioning/sc/IDACall: 546 -> 308 bytes
    === 2012-11-19 11:42:30,501 [l0-0] INFO  Compression - /bulkuserprovisioning/sc/IDACall: 546 -> 308 bytes
    === 2012-11-19 11:42:30,501 [l0-6] INFO  Compression - /bulkuserprovisioning/sc/IDACall: 1467 -> 656 bytes
    kicking validate grid
    Scheduling revalidate grid
    Running validation loop
    Best Regards, T.

    #2
    If there were an error happening in the framework, you should see it reported in the Eclipse console or Developer console.

    Most likely, one of your overrides to the grid is getting tripped up by the fact that there is no Record available for a new, unsaved row (see Grid Editing overview) and crashing.

    This also should be reported in Eclipse in the Development mode console. If you're not seeing any error reports at all, try restarting your IDE and browser, and try a different browser.

    If you ultimately decide there must be a framework issue involved, try creating a standalone test case we can run to see the problem.

    Comment


      #3
      Hi,

      I stripped away all my overrides and it is still happening. Below is the sample code of what I am doing. There wasn't any errors that I can see on the development mode console or the debug console.

      Code:
      public class Bulkuserprovisioning implements EntryPoint {
      
      	
         private MainWidget bup;
      		
         public Bulkuserprovisioning() {		
            bup = new MainWidget();
         }
      	
      	
         public void onModuleLoad() {				
            bup.draw();		
         }
      	 
      }
      
      
      //===============
      
      
      public class MainWidget extends VLayout {
      
         private BaseGrid dGrid;
      
         public MainWidget() {
            super();
            init();			
         }
      
      
         private void init() {
      		
      	
            this.setHeight100();
            this.setWidth100();
      		
      				
            // Instantiate and customize the dynamic grid
            try {
               customizeGrid();
            } catch (Exception e) {
               SC.say(langConstants.dGridInitException()+ e.getMessage());
               e.printStackTrace();
            }
         	       	       	      	    
            this.addMember(dGrid);   	       	       	       	       	       	    
         }
      
      
         private void customizeGrid() throws Exception {
      		
            dGrid =  new BaseGrid();
      
            dGrid.setUseAllDataSourceFields(false);			
      
            dGrid.bindDataSource("gridDS");
      
            dGrid.setCanRemoveRecords(true);
      		
            if (dGrid.getDataSource().getShowPrompt()) {
                dGrid.getDataSource().setShowPrompt(false);
            }
      
            dGrid.setDataFetchMode(FetchMode.LOCAL);
      
            dGrid.setAutoFetchData(true);		
      							
         }
      	
      }
      
      
      //===============
      
      
      public class BaseGrid extends ListGrid {
      
      	private DataSource dataSrc;
      	
      	public BaseGrid() {	
      		
         		super();
      		
      		//Override default and set width to 100%
      		this.setWidth100();
      		this.setHeight100();
      		
      	        this.setShowAllRecords(false);   
              	this.setSelectionType(SelectionStyle.SIMPLE);   
              	this.setSelectionAppearance(SelectionAppearance.CHECKBOX);
      
              	this.setEditOnFocus(false);
                      
      		this.setAutoFetchData(true);                               
      	}
      	
          	public void bindDataSource(String dsName) {
              	dataSrc = DataSource.get(dsName);
      	        this.setDataSource(dataSrc);
      	}
      
      	public DataSource getDataSrc() {
      		return dataSrc;
      	}
      
      	public void setDataSrc(DataSource dataSrc) {
      		this.dataSrc = dataSrc;
      	}
      	
      
      }
      Best Regards, T.

      Comment


        #4
        This is now basically the same as (working) samples, so we suspect the issue is in your DataSource.

        You can easily verify this would work with a sample DataSource by adding one of the samples DataSources to your project (eg, "supplyItem").

        Having verified that, to help further we'd need to see the DataSource definition and the data it's returning (from the RPC tab in the Developer Console).

        Comment


          #5
          I'm suspecting that it is something to do with data source interaction also since it is pretty cookie cutter stuff I am doing.

          Since we probably need the exact data source definition to troubleshoot, I'll need to send it to the support email since it is our custom data source.

          I'll see if I can get the RPC traces also when I send our data source definition.

          Comment

          Working...
          X