cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Angela vassar" <angela.vas...@gmail.com>
Subject Re: multivalueField
Date Thu, 29 Mar 2007 06:40:28 GMT
Hey,
i have fixed it by doing the following but now i get a js error:
in my flowscript i have:

var data = new Object();

data.qList = new Array();
 for(var i=0; i < data.size(); i++){

data.qList[i] = {value:data.getID().toString(), label:data.getLabel()};

 }

and my in my form model i have:

  <fd:selection-list type="flow-jxpath" list-path="qList"
                   value-path="value" label-path="label" />

within the multivalue filed widget definition



the widget is displaying probably, however when i select an item from the
selection list i get the following js error:

Error: data_test_jsWidget is null or not an object

not sure why the widget is null?



thanks



On 3/29/07, Angela vassar <angela.vassar@gmail.com> wrote:
>
> Hi Guys,
>
> im attempting to dynamically create the selectionlist for a mutli-value
> field widget from my flowscript.
>
> what i have is this :
>
> var values;
> values[0] = 1;
> values[1] = 2;
> values[2] = 3;
> form.getChild("test").setValue(values);  // where test is the label of the
> multi-value field widget
>
> in my form model file i define 'test' to be:
>
>
> <fd:multivaluefield id="test" >
>   <fd:label>Test</fd:label>
>   <fd:datatype base="integer"/>
>   <fd:selection-list/>
> </fd:multivaluefield>
>
> I get the following error
> org.mozilla.javascript.EcmaError: TypeError: Cannot set property "0.0" of
> undefined to "1"
> (file:/C:/cocoon/build/webapp/test/forms/test/flow/flow.js#272)
> *TypeError* - file:/C:/cocoon/build/webapp/test/forms/test/flow/flow.js -
> 272:0
> Cocoon stacktrace[hide]
> *TypeError: Cannot set property "0.0" of undefined to "1"
> (file:/C:/cocoon/build/webapp/test/forms/test/flow/flow.js#272)*
>    file:/C:/cocoon/build/webapp/test/forms/test/flow/flow.js - 272:0
>  *TypeError*
>
> *Error calling flowscript function do_edit_section*
>    file:/C:/cocoon/build/webapp/test/forms/test/flow/flow.js - 272:0
>  *[EcmaError]*
>  file:/C:/cocoon/build/webapp/test/forms/test/flow/flow.js - 272:-1
>  **
>  file:/C:/cocoon/build/webapp/test/forms/test/sitemap.xmap - 32:36
>  *<map:call>*
>  file:/C:/cocoon/build/webapp/test/forms/sitemap.xmap - 312:68
>  *<map:mount>*
>  file:/C:/cocoon/build/webapp/test/sitemap.xmap - 63:65
>  *<map:mount>*
>  file:/C:/cocoon/build/webapp/sitemap.xmap - 1034:92
>  *<map:mount>*
>
>
> i know what im doing is most probably completely wrong, so how do i fix
> it?
>
> Thanks
>

Mime
View raw message