-
Smart GWT and GWT version:
I am using smartgwt 2.5 and gwt 2.3
Also I am testing on ie 8 and the picktree is embedded in a page. No link to an external css file on the page itself. -
Client side problem:
I have a ipicktreeitem that works fine for a majority of the time but on random occassions the tree blanks out all the display values. It blanks out the values when I click on the menu button and it starts to display the tree. Once it blanks the tree display values, it remains that way indefinitely until you recycle the application. There is no glitch in terms of the placement or css style sheets but rather that the displayed values on the picktree disappear for no reason. -
Sample Code:
The code that I used is as follows(please note the only way I could get it to do it was by playing with the tree manually):
public class TestClass {
private IPickTreeItem searchPickTree;
public void onModuleLoad() {
searchPickTree = new IPickTreeItem();
searchPickTree.setCanSelectParentItems(true);
searchPickTree.setTitle(“Selected Location”);
searchPickTree.setShowTitle(true);
searchPickTree.setWrapTitle(false);
searchPickTree.setDataSource(OrgTreeDS.getInstance());
searchPickTree.setDisplayField(“name”);
searchPickTree.setValueField(“orgId”);
searchPickTree.addChangedHandler(new ChangedHandler() {
public void onChanged(
ChangedEvent event) {
// added this below to see if it would fix the display issue
searchPickTree.redraw();
}
});
}
}
public class OrgTreeDS extends DataSource {
private static OrgTreeDS instance = null;
public static OrgTreeDS getInstance() {
if (instance == null) {
instance = new OrgTreeDS("orgTreeDS");
}
return instance;
}
public OrgTreeDS(String id) {
setID(id);
setTitleField("Name");
setRecordXPath("/list/org");
DataSourceTextField nameField = new DataSourceTextField("name", "name", 128);
DataSourceTextField idField = new DataSourceTextField( "orgId", "orgId" );
idField.setPrimaryKey(true);
idField.setRequired(true);
DataSourceTextField parentField = new DataSourceTextField( "parentId", "parentId" );
parentField.setRequired(true);
parentField.setForeignKey(id + ".orgId");
parentField.setRootValue("o0");
setFields( nameField, idField, parentField );
setDataURL("/org.xml");
setClientOnly(true);
}
}
<?xml version=“1.0” encoding=“utf-8” ?>
<list>
<org>
<orgId>o23</orgId>
<name>Sample Corporation</name>
<parentId>o0</parentId>
</org>
<org>
<orgId>e10144</orgId>
<name>Sample Location 1</name>
<parentId>o23</parentId>
</org>
<org>
<orgId>e10143</orgId>
<name>Sample Location 2</name>
<parentId>o23</parentId>
</org>
<org>
<orgId>e10042</orgId>
<name>Sample Location 3</name>
<parentId>o23</parentId>
</org>
<org>
<orgId>e10051</orgId>
<name>Sample Location 4</name>
<parentId>o23</parentId>
</org>
<org>
<orgId>e10683</orgId>
<name>Sample Location 5</name>
<parentId>o23</parentId>
</org>
</list>
