Announcement

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

    Difference in Tree behaviour from ver 2.2 and ver 2.0

    Hi,

    I recently upgraded to SmartGWT ver 2.2 from ver 2.0. I immediately noticed a difference in how a tree we have in our application is rendering.

    The tree uses the following xm format to render data:


    <List>
    <accountInfo>
    <id>309876</id>
    <type>relationship</type>
    <identifier>ABC</identifier>
    </accountInfo>

    <accountInfo>
    <id>998</id>
    <clientId>961028611</clientId>
    <parentId>309876</parentId>
    <type>client</type>
    <identifier>XYZ</identifier>
    </accountInfo>

    <accountInfo>
    <id>755799479998</id>
    <parentId>998</parentId>
    <type>account</type>
    <identifier>100000000</identifier>
    </accountInfo>

    <accountInfo>
    <id>998</id>
    <clientId>78452263</clientId>
    <parentId>309876</parentId>
    <type>client</type>
    <identifier>XYZ</identifier>
    </accountInfo>

    <accountInfo>
    <id>781780865998</id>
    <parentId>998</parentId>
    <type>account</type>
    <identifier>200000000</identifier>
    </accountInfo>

    </List>


    With version 2.0 it rendered the nodes correctly, with ABC as the topmost. XYZ as the child of ABC and the two accounts under XYZ.

    ABC--|
    |
    XYZ--|
    |
    200000000
    100000000

    With version 2.2 it renders only one account and it seems like a node is overwritten:

    ABC--|
    |
    XYZ--|
    |
    200000000


    The client side code displays the nodes based on the <identifier> field, thus:

    TreeGridField treeGridField = new TreeGridField("identifier");


    Including the Datasource code also:


    setID(id);
    setTitleField("identifier");
    setRecordXPath("//List/accountInfo");
    DataSourceTextField nameField = new DataSourceTextField("identifier", "AC", 128);

    DataSourceIntegerField acInfoField = new DataSourceIntegerField("id", "id");
    acInfoField.setPrimaryKey(true);
    acInfoField.setRequired(true);

    DataSourceIntegerField parentField = new DataSourceIntegerField("parentId", "parentId");
    parentField.setRequired(true);
    parentField.setForeignKey(id + ".id");
    parentField.setRootValue("1");

    DataSourceTextField typeField = new DataSourceTextField("type", "type");
    DataSourceTextField clIdField = new DataSourceTextField("clientId", "clientId");

    setFields(nameField, acInfoField, parentField, typeField,clIdField);
    setDataURL(fetchUrl+accountNumber);







    Could anyone know why this is happening and what the resolution might be?

    Thanks.
    Last edited by san1001_99; 11 Oct 2010, 11:33. Reason: Added Datasource code

    #2
    Originally posted by san1001_99
    Hi,

    I recently upgraded to SmartGWT ver 2.2 from ver 2.0. I immediately noticed a difference in how a tree we have in our application is rendering.

    The tree uses the following xm format to render data:


    <List>
    <accountInfo>
    <id>309876</id>
    <type>relationship</type>
    <identifier>ABC</identifier>
    </accountInfo>

    <accountInfo>
    <id>998</id>
    <clientId>961028611</clientId>
    <parentId>309876</parentId>
    <type>client</type>
    <identifier>XYZ</identifier>
    </accountInfo>

    <accountInfo>
    <id>755799479998</id>
    <parentId>998</parentId>
    <type>account</type>
    <identifier>100000000</identifier>
    </accountInfo>

    <accountInfo>
    <id>998</id>
    <clientId>78452263</clientId>
    <parentId>309876</parentId>
    <type>client</type>
    <identifier>XYZ</identifier>
    </accountInfo>

    <accountInfo>
    <id>781780865998</id>
    <parentId>998</parentId>
    <type>account</type>
    <identifier>200000000</identifier>
    </accountInfo>

    </List>


    With version 2.0 it rendered the nodes correctly, with ABC as the topmost. XYZ as the child of ABC and the two accounts under XYZ.

    ABC--|
    |
    XYZ--|
    |
    200000000
    100000000

    With version 2.2 it renders only one account and it seems like a node is overwritten:

    ABC--|
    |
    XYZ--|
    |
    200000000


    The client side code displays the nodes based on the <identifier> field, thus:

    TreeGridField treeGridField = new TreeGridField("identifier");


    Including the Datasource code also:


    setID(id);
    setTitleField("identifier");
    setRecordXPath("//List/accountInfo");
    DataSourceTextField nameField = new DataSourceTextField("identifier", "AC", 128);

    DataSourceIntegerField acInfoField = new DataSourceIntegerField("id", "id");
    acInfoField.setPrimaryKey(true);
    acInfoField.setRequired(true);

    DataSourceIntegerField parentField = new DataSourceIntegerField("parentId", "parentId");
    parentField.setRequired(true);
    parentField.setForeignKey(id + ".id");
    parentField.setRootValue("1");

    DataSourceTextField typeField = new DataSourceTextField("type", "type");
    DataSourceTextField clIdField = new DataSourceTextField("clientId", "clientId");

    setFields(nameField, acInfoField, parentField, typeField,clIdField);
    setDataURL(fetchUrl+accountNumber);







    Could anyone know why this is happening and what the resolution might be?

    Thanks.

    Does anybody at Smartgwt know if this is a bug or a known issue ? I have looked through the forums but did not get any information.

    Again, the description of the problem is: With version 2.2, in a treegrid, whenever there is a collision in a parent node, the child nodes are bieng overwritten as well as the parent.

    The observed behaviour with version 2.0 was that in case of a collision, the child nodes would get appended to the existing parent node.

    Thanks,
    Sandeep.



    Thanks.
    Last edited by san1001_99; 12 Oct 2010, 09:38. Reason: TreeGrid node collision issue with version 2.2

    Comment

    Working...
    X