Exemple #1
0
  public void appendToResponse(WOResponse aResponse, WOContext aContext) {
    try {
      Number b = (Number) valueForBinding("firstNameDisplay");
      if (b != null) firstNameDisplay = b.intValue();
      else firstNameDisplay = 2;

      b = (Number) valueForBinding("secondNameDisplay");
      if (b != null) secondNameDisplay = b.intValue();
      else secondNameDisplay = 2;

    } catch (ClassCastException cex) {
      throw new IllegalArgumentException("NameDisplay bindings should be integer");
    }
    String request = (String) valueForBinding("searchRequest");
    if (request != null) {
      performSearchRequest(request);
    } else {
      selection =
          (PersonLink)
              EOUtilities.localInstanceOfObject(
                  ec, (EOEnterpriseObject) valueForBinding("selection"));
      //			syncSelection();
    }
    if (selection == null && Various.boolForObject(valueForBinding("showPopup"))) {
      selection = defaultSelectionValue();
      setValueForBinding(selection, "selection");
    }
    super.appendToResponse(aResponse, aContext);
    found = null;
    //		searchMessage = null;
  }
Exemple #2
0
 public WOComponent create() {
   //		searchMessage = null;
   //		canCreate = false;
   selection = null;
   setValueForBinding(selection, "selection");
   PersonLink onEdit = Person.Utility.create(ec, entity(), searchString);
   WOComponent returnPage = context().page();
   WOComponent popup = null;
   //		try {
   //			popup = pageWithName("PersonInspector");
   //		} catch (Exception e) {
   popup = pageWithName("SelectorPopup");
   //		}
   if (returnPage instanceof SelectorPopup) {
     SelectorPopup sp = (SelectorPopup) returnPage;
     popup.takeValueForKey(sp.returnPage, "returnPage");
     popup.takeValueForKey(sp.resultPath, "resultPath");
     popup.takeValueForKey(sp.resultGetter, "resultGetter");
     popup.reset();
   } else {
     popup.takeValueForKey(returnPage, "returnPage");
   }
   if (popup instanceof SelectorPopup) {
     NSDictionary dict =
         (NSDictionary) session().valueForKeyPath("strings.RujelBase_Base.newPerson");
     popup.takeValueForKey(onEdit.person(), "value");
     popup.takeValueForKey(dict, "dict");
     //		} else {
     //			popup.takeValueForKey(onEdit, "personLink");
   }
   return popup;
 }
Exemple #3
0
 public void takeValuesFromRequest(WORequest aRequest, WOContext aContext) {
   super.takeValuesFromRequest(aRequest, aContext);
   if (!Various.boolForObject(valueForBinding("showPopup"))) {
     selection =
         (PersonLink)
             EOUtilities.localInstanceOfObject(
                 ec, (EOEnterpriseObject) valueForBinding("selection"));
     //			syncSelection();
   }
 }