bruno 2004/02/06 07:55:32
Modified: src/blocks/woody/java/org/apache/cocoon/woody/flow/javascript/v2
ScriptableWidget.java
Log:
Merged the two jsFunction_setSelectionList methods into one, since
Rhino doesn't distinguish between them.
Revision Changes Path
1.7 +19 -23
cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/flow/javascript/v2/ScriptableWidget.java
Index: ScriptableWidget.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/flow/javascript/v2/ScriptableWidget.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ScriptableWidget.java 2 Feb 2004 08:54:07 -0000 1.6
+++ ScriptableWidget.java 6 Feb 2004 15:55:32 -0000 1.7
@@ -617,38 +617,34 @@
}
}
- public void jsFunction_setSelectionList(Object arg) throws Exception {
+ public void jsFunction_setSelectionList(Object arg, Object valuePathArg,
Object labelPathArg) throws Exception {
if (delegate instanceof Field ||
delegate instanceof MultiValueField) {
arg = unwrap(arg);
- if (arg instanceof SelectionList) {
- SelectionList selectionList = (SelectionList)arg;
+ if (valuePathArg != Undefined.instance && labelPathArg !=
Undefined.instance) {
+ String valuePath = Context.toString(valuePathArg);
+ String labelPath = Context.toString(labelPathArg);
if (delegate instanceof Field) {
- ((Field)delegate).setSelectionList(selectionList);
+ ((Field)delegate).setSelectionList(arg, valuePath,
labelPath);
} else {
-
((MultiValueField)delegate).setSelectionList(selectionList);
+ ((MultiValueField)delegate).setSelectionList(arg,
valuePath, labelPath);
}
} else {
- String str = Context.toString(arg);
- if (delegate instanceof Field) {
- ((Field)delegate).setSelectionList(str);
+ if (arg instanceof SelectionList) {
+ SelectionList selectionList = (SelectionList)arg;
+ if (delegate instanceof Field) {
+ ((Field)delegate).setSelectionList(selectionList);
+ } else {
+
((MultiValueField)delegate).setSelectionList(selectionList);
+ }
} else {
- ((MultiValueField)delegate).setSelectionList(str);
+ String str = Context.toString(arg);
+ if (delegate instanceof Field) {
+ ((Field)delegate).setSelectionList(str);
+ } else {
+ ((MultiValueField)delegate).setSelectionList(str);
+ }
}
- }
- }
- }
-
- public void jsFunction_setSelectionList(Object objectArg, Object
valuePathArg, Object labelPathArg) throws Exception {
- if (delegate instanceof Field ||
- delegate instanceof MultiValueField) {
- Object object = unwrap(objectArg);
- String valuePath = Context.toString(valuePathArg);
- String labelPath = Context.toString(labelPathArg);
- if (delegate instanceof Field) {
- ((Field)delegate).setSelectionList(object, valuePath,
labelPath);
- } else {
- ((MultiValueField)delegate).setSelectionList(object,
valuePath, labelPath);
}
}
}