You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by br...@apache.org on 2004/02/02 09:54:07 UTC

cvs commit: cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/flow/javascript/v2 ScriptableWidget.java

bruno       2004/02/02 00:54:07

  Modified:    src/blocks/woody/java/org/apache/cocoon/woody/flow/javascript/v2
                        ScriptableWidget.java
  Log:
  Allow setting the JXPath based selection list too.
  
  Revision  Changes    Path
  1.6       +14 -0     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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ScriptableWidget.java	30 Jan 2004 23:53:25 -0000	1.5
  +++ ScriptableWidget.java	2 Feb 2004 08:54:07 -0000	1.6
  @@ -639,6 +639,20 @@
           }
       }
   
  +    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);
  +            }
  +        }
  +    }
  +
       static final Object[] WIDGET_CLASS_MAP = {
           Form.class, "Form",
           Field.class, "Field",