Announcement

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

    RestDataSource giving me an empty dynamic form?

    Hi,

    I am following the "Master Detail" sample and trying to add a detail record section to a working application. For some reason I don't understand I'm getting a completely blank (empty) detail.

    The thought I had is: the data from the datasource shows up slowly, is it possible that the DynamicForm looked at it before any data was there?


    I create the datasource first
    Code:
    final RestDataSource ds = new RestDataSource();
    ds.setFetchDataURL("/test/heard");
    ds.setDataFormat(DSDataFormat.JSON);
    
    OperationBinding fetch = new OperationBinding();
    fetch.setOperationType(DSOperationType.FETCH);
    fetch.setDataProtocol(DSProtocol.GETPARAMS);
    
    ds.setOperationBindings(fetch);
    Then I create the grid
    Code:
    final ListGrid grid = new ListGrid();
    grid.setCanEdit(true);
    grid.setWidth(800);
    grid.setHeight(600);
    grid.setShowAllRecords(true);
    grid.setCellHeight(22);
    grid.setAlternateRecordStyles(true);
    grid.setDataSource(ds);
    grid.setGroupStartOpen(GroupStartOpen.NONE);
    grid.setGroupByField("customer");
    grid.setAutoFetchData(true);
    Then finally the detail form:
    Code:
    final DynamicForm detail = new DynamicForm();
    detail.setIsGroup(true);
    detail.setGroupTitle("Detail");
    detail.setWidth(800);
    detail.setHeight(200);
    detail.setMargin(15);
    detail.setNumCols(4);
    detail.setDataSource(ds);
    Then finally I add a record click handler. I tried this two ways: one is the way the example does it with .editSelectedData(listGrid), the othe is as you see below. Neither worked:

    Code:
    grid.addRecordClickHandler(new RecordClickHandler() {
    	@Override
    	public void onRecordClick(RecordClickEvent event) {
    		Record r = event.getRecord();
    
    		int platform = r.getAttributeAsInt("platformId");
    		status.setContents("Selected record " + platform);
    		detail.editRecord(r);
    	}
    });
    When I select a record, the developers console says:

    Code:
    16:19:08.699:MDN7:INFO:EventHandler:Target Canvas for event 'mousedown': [GridBody ID:isc_ListGrid_0_body]
    16:19:08.844:MUP8:INFO:EventHandler:Target Canvas for event 'mouseup': [GridBody ID:isc_ListGrid_0_body]
    16:19:08.845:MUP8:INFO:redraws:isc_Label_0:Scheduling redraw (setContents)
    16:19:08.845:MUP8:INFO:redraws:isc_DynamicForm_0:Scheduling redraw (setValues)
    16:19:08.848:RDQ1:INFO:drawing:isc_Label_0:$ra(): redrawing
    16:19:08.849:RDQ1:INFO:sizing:isc_Label_0:Specified size: 400x100, drawn scroll size: 400x100, border: 0x0, margin: 0x0, old size: 400x100, reason: redraw
    16:19:08.849:RDQ1:DEBUG:DynamicForm:isc_DynamicForm_0:blur w/o handler: no item to blur
    16:19:08.850:RDQ1:INFO:drawing:isc_DynamicForm_0:$ra(): redrawing
    16:19:08.851:RDQ1:INFO:tablePolicy:isc_DynamicForm_0:totalWidth: 768, generated colWidths: 100,284,100,284
    16:19:08.851:RDQ1:INFO:tablePolicy:
    totalWidth: 768, totalHeight: 161
    specified sizes:
    cols:[
    100,
    284,
    100,
    284
    ], rows: [
    
    ]
    16:19:08.851:RDQ1:INFO:tablePolicy:
    derived sizes:
    cols:[
    100,
    284,
    100,
    284
    ], rows: [
    
    ]
    16:19:08.852:RDQ1:INFO:sizing:isc_DynamicForm_0:Specified size: 800x200, drawn scroll size: 768x7, border: 2x2, margin: 37x30, old size: 768x7, reason: redraw
    16:19:08.853:RDQ1:INFO:drawing:isc_DynamicForm_0:redrawPeers(): 1 peers
    16:19:08.853:RDQ1:INFO:redraws:isc_DynamicForm_0_groupLabel:Immediate redraw (redrawPeers)
    16:19:08.854:RDQ1:INFO:drawing:isc_DynamicForm_0_groupLabel:$ra(): redrawing
    16:19:08.855:RDQ1:INFO:sizing:isc_DynamicForm_0_groupLabel:Specified size: 1x1, drawn scroll size: 36x14, border: 0x0, margin: 0x0, old size: 36x14, reason: redraw

    so I don't see any crazy errors in there, debugging is at level INFO right now except for DynamicForm (debug).


    Am I on the right general path at least?

    Thanks,

    --Chris
Working...
X