Ejemplo n.º 1
0
  /**
   * When a listItem in the corresponding listbox is selected.<br>
   * Event is forwarded in the corresponding listbox.
   *
   * @param event
   */
  public void onSelect$listBoxBranch(Event event) {
    // logger.debug(event.toString());

    // selectedBranche is filled by annotated databinding mechanism
    final Branche aBranche = getSelectedBranche();

    if (aBranche == null) {
      return;
    }

    // check first, if the tabs are created
    if (getBranchMainCtrl().getBranchDetailCtrl() == null) {
      Events.sendEvent(new Event("onSelect", getBranchMainCtrl().tabBranchDetail, null));
      // if we work with spring beanCreation than we must check a little
      // bit deeper, because the Controller are preCreated ?
    } else if (getBranchMainCtrl().getBranchDetailCtrl().getBinder() == null) {
      Events.sendEvent(new Event("onSelect", getBranchMainCtrl().tabBranchDetail, null));
    }

    // INIT ALL RELATED Queries/OBJECTS/LISTS NEW
    getBranchMainCtrl().getBranchDetailCtrl().setSelectedBranche(aBranche);
    getBranchMainCtrl().getBranchDetailCtrl().setBranche(aBranche);

    // store the selected bean values as current
    getBranchMainCtrl().doStoreInitValues();

    // show the objects data in the statusBar
    final String str = Labels.getLabel("common.Branch") + ": " + aBranche.getBraBezeichnung();
    EventQueues.lookup("selectedObjectEventQueue", EventQueues.DESKTOP, true)
        .publish(new Event("onChangeSelectedObject", null, str));
  }