SmartGWT EE 2.5 (March 1st build)
Firefox 3.6.16
Following the showcase example for Drog’nDrop . Problem is the list grids don’t display any rows even though the listGrid.getTotalRows() function returns the correct counts. What am I missing ?
EntryPoint code
public class StandAloneCase implements EntryPoint {
public void onModuleLoad() {
HStack hStack = new HStack(10);
hStack.setHeight(160);
final ListGrid myList1 = new ListGrid();
myList1.setCanDragRecordsOut(true);
myList1.setCanAcceptDroppedRecords(true);
myList1.setCanReorderFields(true);
myList1.setDragDataAction(DragDataAction.MOVE);
myList1.setData(PartData.getRecords());
hStack.addMember(myList1);
final ListGrid myList2 = new ListGrid();
myList2.setCanDragRecordsOut(true);
myList2.setCanAcceptDroppedRecords(true);
myList2.setCanReorderRecords(true);
VStack vStack = new VStack(10);
vStack.setWidth(32);
vStack.setHeight(74);
GWT.log("count is " + myList1.getTotalRows());
hStack.addMember(vStack);
hStack.addMember(myList2);
hStack.draw();
}
}
Here are the data structures (from showcase)
package com.reliable.app.client.forms;
import com.reliable.app.client.forms.PartRecord;
public class PartData {
private static PartRecord[] records;
public static PartRecord[] getRecords() {
if (records == null) {
records = getNewRecords();
}
return records;
}
public static PartRecord[] getNewRecords() {
return new PartRecord[]{
new PartRecord("Blue", "cube_blue.png", 1),
new PartRecord("Yellow", "cube_yellow.png", 2),
new PartRecord("Green", "cube_green.png", 3),
new PartRecord("Blue", "cube_blue.png", 4),
new PartRecord("Yellow", "cube_yellow.png", 5),
new PartRecord("Green", "cube_green.png", 6),
new PartRecord("Blue", "cube_blue.png", 7),
new PartRecord("Yellow", "cube_yellow.png", 8),
new PartRecord("Green", "cube_green.png", 9),
};
}
}
package com.reliable.app.client.forms;
import com.smartgwt.client.widgets.grid.ListGridRecord;
public class PartRecord extends ListGridRecord {
public PartRecord() {
}
public PartRecord(String partName, String partSrc, int partNum) {
setPartName(partName);
setPartSrc(partSrc);
setPartNum(partNum);
}
public void setPartName(String partName) {
setAttribute("partName", partName);
}
public void setPartSrc(String partSrc) {
setAttribute("partSrc", partSrc);
}
public void setPartNum(int partNum) {
setAttribute("partNum", partNum);
}
}