1. #1
    Ext GWT Premium Member
    Join Date
    Sep 2011
    Posts
    14
    Vote Rating
    0
    B.Oury is on a distinguished road

      0  

    Question Unanswered: Treepanel : The grandparents of selected tree node is NULL

    Unanswered: Treepanel : The grandparents of selected tree node is NULL


    Hi,
    I've a problem when I click on a node with depth 2, I can't recover its grandparents, there is null.

    Code:
      TreeStore<BeanModel> objStore = new TreeStore<BeanModel>();
      TreePanel<BeanModel> objTree = new TreePanel<BeanModel>(objStore);
    
    objTree.getSelectionModel().addListener(Events.BeforeSelect, new Listener<SelectionEvent<BeanModel>>() {
    
          @Override
          public void handleEvent(SelectionEvent<BeanModel> be) {
            AgdRdvDTO selectAppointment = null;
            AgdDemandeDTO selectDemande = null;
            AgdSuiviDTO selectSuivi = null;
    
            TreePanelSelectionModel<BeanModel> tree = (TreePanelSelectionModel<BeanModel>) be.getSource();
            BeanModel item = be.getModel();
            if (item.getBean() instanceof AgdDemandeDTO) {
              selectDemande = item.getBean();
            } else if (item.getBean() instanceof AgdSuiviDTO) {
              selectSuivi = item.getBean();
              selectDemande = objStore.getParent(item).getBean();
            } else if (item.getBean() instanceof AgdRdvDTO) {
              selectAppointment = item.getBean();
    
              BeanModel beanSuivi = objStore.getParent(item);
              selectSuivi = beanSuivi.getBean();
              BeanModel grandParents= objStore.getParent(objStore.getParent(item));
              if (grandParents!= null) {
                selectDemande = grandParents.getBean();
              }
              AgendaEventBus.getEventBus().fireEvent(new SelectDetailEvent(selectDemande, selectSuivi, selectAppointment));
            }
          }
        });
    The first time I clicked, grandParents is initialized and if i clicked on an other item of the same parent, the grandParents is always null.

    Thanks for your help

  2. #2
    Sencha Premium Member
    Join Date
    Aug 2011
    Posts
    15
    Answers
    1
    Vote Rating
    0
    dariusjb is on a distinguished road

      0  

    Default


    You should try get the store reference everytime you need it. May be one update/load has changed it. Therefore your reference does not reflect what is actually in it.

    tree.getStore() instead of using objStore

  3. #3
    Sencha Premium Member
    Join Date
    Aug 2011
    Posts
    15
    Answers
    1
    Vote Rating
    0
    dariusjb is on a distinguished road

      0  

    Default


    I meant:
    objectTree.getStore()

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