1. #1
    Sencha User
    Join Date
    May 2008
    Location
    Germany
    Posts
    59
    Vote Rating
    0
    LukasP is on a distinguished road

      0  

    Default TreePanel text change on model not forwarded

    TreePanel text change on model not forwarded


    When using a TreePanel and changing the text field of the BaseModelData, the displayed text on the tree item is not updated.

    Using:
    Web mode
    GXT 2.1.1
    GWT 2.0.2
    Firefox 3.5.8

    Sample code:

    Code:
    public class MainEntryPoint implements EntryPoint {
        
        public void onModuleLoad() {
        
            final TreePanel tree = new TreePanel(new TreeStore());
            tree.setDisplayProperty("text");
    
            final ModelData m = new BaseModelData();
            m.set("text", "SomeText");
            tree.getStore().add(m, false);
            
            RootPanel.get().add(tree);
    
            Button b1 = new Button("A");
            b1.addSelectionListener(new SelectionListener<ButtonEvent>(){
    
                @Override
                public void componentSelected(ButtonEvent ce) {
                    m.set("text", "A");
                }
    
            });
    
            RootPanel.get().add(b1);
    
            Button b2 = new Button("B");
            b2.addSelectionListener(new SelectionListener<ButtonEvent>(){
    
                @Override
                public void componentSelected(ButtonEvent ce) {
                    List<ModelData> l = tree.getStore().getAllItems();
                    for(ModelData m: l) {
                        m.set("text", "B");
                    }
                }
    
            });
            RootPanel.get().add(b2);
    
        }
    }
    Both changing the field on the Model directly and retrieving the Model from the Store and then changing the field do not have any effect on the text displayed on the TreePanel.

    Any help appreciated!

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    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


    If you are looking for help, you need to post in the correct forum. I moved the post now. ALso this was dicussed several times and you can try to use the forum search.

  3. #3
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    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


    BaseModelData does not fire any events. So you need to call update on the store manually.

  4. #4
    Sencha User
    Join Date
    May 2008
    Location
    Germany
    Posts
    59
    Vote Rating
    0
    LukasP is on a distinguished road

      0  

    Default


    Thanks for your quick reply! - next time I will be more cautious before posting in Bugs :-)

    I was not aware of the fact the BaseModelData does not fire events, nor could I find any useful hints while search for "TreePanel text change".

  5. #5
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    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


    You can also change it to BaseModel and before adding the model set monitor changes to true on the store. These are the two solutions for your problems

  6. #6
    Sencha User
    Join Date
    May 2008
    Location
    Germany
    Posts
    59
    Vote Rating
    0
    LukasP is on a distinguished road

      0  

    Default


    Yes, changing my superclass to BaseModel was all I had to do. I had monitorChanges set to true already.

    Thanks again, you really helped me a lot!

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi