1. #1
    Ext User
    Join Date
    Aug 2010
    Posts
    12
    Vote Rating
    0
    batkins is on a distinguished road

      0  

    Exclamation TreeStore.update() not updating nodes in TreePanel

    TreeStore.update() not updating nodes in TreePanel


    After updating a tree item on the tree store using TreeStore.update(), calling TreePanelSelectionModel.getSelectedItem() results in a stale item being returned.

    I'm making a call to update an item on a tree store as follows:
    Code:
    BeanModel itemModel = beanModelFactory.createModel(item);
    tree.getStore().update(itemModel);
    The new tree item appears correctly in the tree based on the icon, as set in a custom iconSelector. That is, the items being passed to the icon selector include the updated item. Checking the actual TreeStore pointed to by both the TreePanel and the selection model shows that the updated item is indeed present in the tree store. The stale item does not exist in the store after the update.

    I'm getting the currently selected item as follows:
    Code:
    TreePanelSelectionModel<BeanModel> selModel = tree.getSelectionModel();
    BeanModel model = selModel.getSelectedItem();
    The model item is the pre-updated item (again, an item that does not exist in TreeStore, post update). However, Looking at the node list in the TreePanel itself shows the stale item is still in the node list. My understanding is that the update call on the tree store fires the Update event. Shouldn't this event result in updating the nodes in the tree?

    How can I force the tree to see the update to the treestore? I need to have the selected item reflect the current item in the TreeStore, not a stale item held in the TreePanel.

    Thanks!

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,966
    Vote Rating
    130
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    There are some known limitations with update.

    What are you doing exaclty? Why do you create a new BeanModel instance?

  3. #3
    Ext User
    Join Date
    Aug 2010
    Posts
    12
    Vote Rating
    0
    batkins is on a distinguished road

      0  

    Default


    The change to the item is a status flag. This flag results in a new icon for the item in the tree and a different behavior of the context menu when that item is selected. I didn't want to reload the entire tree for a change to only a single item.

  4. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,966
    Vote Rating
    130
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    I dont understand why your selectionmodel still returns the old model with the old flag.

    Can you try to reproduce your code in a small standalone testcase that implements EntyrPoint?

  5. #5
    Ext User
    Join Date
    Aug 2010
    Posts
    12
    Vote Rating
    0
    batkins is on a distinguished road

      0  

    Default


    Ok, I'll try, but it'll be some time before I can get to it. I'm just reloading the entire tree for the time being.

Similar Threads

  1. Replies: 2
    Last Post: 19 Sep 2010, 7:22 AM
  2. TreeStore not updating? (source included)
    By british_trader in forum Ext GWT: Discussion
    Replies: 6
    Last Post: 25 May 2010, 4:35 AM
  3. Adding a model to TreeStore results in duplicate nodes
    By erincarikan in forum Ext GWT: Help & Discussion (1.x)
    Replies: 1
    Last Post: 25 Mar 2009, 1:20 PM

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar