コード例 #1
0
ファイル: KSBrowser.java プロジェクト: ulkeba/ks-development
 @Override
 public void selected(List<String> selectedIds) {
   if (selectedIds.size() == 0) {
     Window.alert("Please select a row before clicking");
     return;
   }
   Map<String, Object> parameters = new LinkedHashMap<String, Object>();
   parameters.put(nextParamMetadata.getKey(), selectedIds.get(0));
   nextBrowsePanel.setParameters(parameters);
   nextBrowsePanel.executeSearch(
       new Callback<Boolean>() {
         public void exec(Boolean result) {}
       });
 }
コード例 #2
0
ファイル: KSBrowser.java プロジェクト: ulkeba/ks-development
  public KSBrowser(LookupMetadata fieldLookup, Controller controller) {
    this.fieldLookup = fieldLookup;

    if (config == null) {
      config = new WidgetConfigInfo();
    }

    browsePanels = new ArrayList<BrowsePanel>();
    cascadingLookups = new ArrayList<LookupMetadata>();
    cascadingChildParameters = new ArrayList<LookupParamMetadata>();
    cascadingLookups.add(this.fieldLookup);
    this.addChildLookups(this.fieldLookup);
    Collections.reverse(cascadingChildParameters);
    Collections.reverse(cascadingLookups);

    for (LookupMetadata lookupMetadata : cascadingLookups) {
      BrowsePanel browsePanel = new BrowsePanel(lookupMetadata);
      browsePanels.add(browsePanel);
      layout.add(browsePanel);
    }
    for (int i = 0; i < browsePanels.size() - 1; i++) {
      BrowsePanel currentBP = browsePanels.get(i);
      LookupParamMetadata nextParamMetadata = this.cascadingChildParameters.get(i);
      BrowsePanel nextBP = browsePanels.get(i + 1);
      currentBP.setOnSelectectedCallback(new ExecuteNextSearchCallback(nextBP, nextParamMetadata));
    }
    browsePanels
        .get(browsePanels.size() - 1)
        .setOnSelectectedCallback(new ViewCourseCallback(controller));

    this.initWidget(layout);
    browsePanels
        .get(0)
        .executeSearch(
            new Callback<Boolean>() {
              public void exec(Boolean result) {}
            });
  }