EOWidgetController actions
EOWidgetController actions
- Subject: EOWidgetController actions
- From: Rob Caljouw <email@hidden>
- Date: Mon, 24 Mar 2003 21:33:44 -0500
Hi,
I'm trying to add actions to a EOWidgetController. I've been overriding
defaultActions and canPerformActionPerformed as described in Java Client
Desktop Applications (Adding Custom Actions to Controllers).
The widget works fine on the screen but no actions seem to be called.
This is the code I'm using:
public class CustomDateController extends EOWidgetController{
public DatePicker dp;
public EOXMLUnarchiver unarchiver;
public CustomDateController(EOXMLUnarchiver unarchiver) {
super(unarchiver);
this.unarchiver = unarchiver;
}
protected JComponent newWidget() {
dp = new DatePicker();
return dp;
}
public NSArray defaultActions() {
NSMutableArray actions = new NSMutableArray();
actions.addObject(EOAction.actionForControllerHierarchy("setValue",
"Set Value", "Set Value", null, null, null, 300, 50, false));
return EOAction.mergedActions(actions, super.defaultActions());
}
public void setValue() {
EOGenericRecord theEntity = (EOGenericRecord)
unarchiver.decodeValueForKey("entity.name");
theEntity.takeValueForKey((Object)dp.getDateString(),
(String)unarchiver.decodeValueForKey("attribute.name"));
}
public boolean canPerformActionNamed(String actionName) {
return actionName.equals("setValue") ||
super.canPerformActionNamed(actionName);
}
}
Thanks in advance for any suggestions.
- Rob
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.