After some debugging, I've reduced the problem to being that:
cocoon.reqest.get();
Will not return an array. If one option is selected, it returns a
string such as:
"jeff".
If more than one option is selected, it returns a String that looks
like an array, but it can't be accessed as an array, only a string.
e.g. the String looks like:
"[jeff, john]"
But, if I try to access modellerArray.length, I get a runtime error
that there is no such .length property of the string.
Is there an easy way to get the string into the array besides manually
parsing it and adding it to an array variable manually, or is there
perhaps some kind of cocoon.request.getArray() function?
Thanks,
Jeff
On Oct 10, 2008, at 9:36 AM, Jeff Schmitz wrote:
Hello,
I have a page with the following select/option list in a form:
<select id="listImportExportUsers" size="5" multiple="multiple"
name="listImportExportUsers">
<option value="jeff">jeff jones</option>
<option value="john">john smith</option>
</select>
When this is submitted, how can I get a hold of the entire option
list from within flowscript? I tried the following, but nothing in
my loop below runs, even making sure both options were selected:
var modellerArray = cocoon.request.get("listImportExportUsers");
for (var i=0; i<modellerArray.length; i++) {
var uri = "ssp/ivhm/" + secIntegrator + "/ModelRole-" +
modellerArray + "-" + neutralInstModel + "-modeller/" +
neutralInstModel + "/ivhmrbac:modeller/" + "saveModelPermissions.jx";
var os = new java.io.ByteArrayOutputStream();
cocoon.processPipelineTo(uri, null, os);
}
Note that
Thanks,
Jeff