Пример #1
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;
 }
Пример #2
0
 public WOActionResults delete() {
   NSMutableArray personList = (NSMutableArray) session().valueForKey("personList");
   if (personList != null && personList.count() > 0) {
     for (int i = 0; i < personList.count(); i++) {
       PersonLink pers = (PersonLink) personList.objectAtIndex(i);
       if (item == EOUtilities.localInstanceOfObject(ec, pers.person())) {
         personList.removeObjectAtIndex(i);
         break;
       }
     }
   }
   return context().page();
   //		onEdit = null;
 }
Пример #3
0
  public String style() {
    // Boolean useStyles = (Boolean)valueForBinding("useStyles");
    if (Various.boolForObject(valueForBinding("useStyles"))) return null;
    // (useStyles != null && !useStyles.booleanValue())

    if (selection != null && item.equals(selection.person())) return "selection";
    if (item.sex() == null) return "grey";

    if (found != null && found.containsObject(item)) {
      if (item.sex().booleanValue()) return "foundMale";
      else return "foundFemale";
    } else {
      if (item.sex().booleanValue()) return "male";
      else return "female";
    }
  }
Пример #4
0
 public void setItem(PersonLink newItem) {
   if (newItem == null) item = null;
   else item = newItem.person();
 }