xuzhf / crmdipity

Automatically exported from code.google.com/p/crmdipity
0 stars 0 forks source link

NavigationPane onDataLoaded #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Need to be able to select the associated record in the NavigationPane in a 
nested Presenter's onRevel() method.

Which isn't possible id the ListGird hasn't been populated.

// NavigationPaneSectionListGrid

  ...

    // register the Data Arrived Handler
    this.addDataArrivedHandler(new DataArrivedHandler() {
      @Override
      public void onDataArrived(DataArrivedEvent event) {
        Log.debug("onDataArrived()"); 
        selectRecord(0);
      }
    }); 

// MainPageView

    navigationPane.addSectionHeaderClickHandler(new SectionHeaderClickHandler() {
      @Override
      public void onSectionHeaderClick(SectionHeaderClickEvent event) {
        SectionStackSection section = event.getSection();
        String name = ((NavigationPaneSection)section).getSelectedRecord();

        // 
        // TO DO: revisit this ???
        //         

        // if there is no selected record e.g. the data hasn't finished loading ...
        // see NavigationPaneSectionListGrid -> onDataArrived then name == ""

        if (name.isEmpty()) {

          Log.debug("name.isEmpty()"); 

          if (section.getTitle().equals(Serendipity.getConstants().SettingsStackSectionName())) {
            name = Serendipity.getConstants().AdministrationMenuItemName();
          }
          else if (section.getTitle().equals(Serendipity.getConstants().ResourceCentreStackSectionName())) {
            name = Serendipity.getConstants().HighlightsMenuItemName();
          } 
        }

        Log.debug("name = " + name); 

        if (getUiHandlers() != null) {
          getUiHandlers().onNavigationPaneSectionHeaderClicked(name);
        }
      }
    });

Original issue reported on code.google.com by rob.ferg...@gtempaccount.com on 25 Jan 2011 at 10:30

GoogleCodeExporter commented 9 years ago
Fixed in 0.4.1

Original comment by rob.ferg...@gtempaccount.com on 25 Jan 2011 at 10:31

GoogleCodeExporter commented 9 years ago
Fixed in Milestone 0.5.0

Original comment by rob.ferg...@gtempaccount.com on 8 Feb 2011 at 1:52