cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Danny Bols" <db...@osirion.be>
Subject Woody: selection list problem
Date Fri, 21 Nov 2003 09:31:40 GMT
Hello,

when trying to populate a selection list from within flow script I ran into
a problem. The following piece of code did not work:

 function myform(form) {
     var widget = form.form.getWidget("myfield");
     var selectionList = new
Packages.org.apache.cocoon.woody.datatype.StaticSelectionList(widget.getData
type());
     selectionList.addItem("AL", "Alabama");
     selectionList.addItem("AK", "Alaska");
     widget.setSelectionList(selectionList);
     form.showForm("flow/myform.form");
}


Changing the code as folows did make it work
from
     selectionList.addItem("AL", "Alabama");
     selectionList.addItem("AK", "Alaska");
to
     selectionList.addItem("AL", null);
     selectionList.addItem("AK", null);


Analyzing this it looks as if the StaticSelectionList is causing the
problem.
Using a null label bypasses the  "interpreter" code and causes my flowscript
example to work:

            if (label != null) {
                interpreter.recycle();
                interpreter.setContentHandler(contentHandler);
                interpreter.deserialize(label);
            } else {
                contentHandler.characters(stringValue.toCharArray(), 0,
stringValue.length());
            }


Any ideas how to solve this?

--
Danny


Mime
View raw message