[Kss-devel] currentFormVar and list of checkboxes

Radim Novotny novotny.radim at gmail.com
Sat May 26 19:16:47 CEST 2007


Hello all,

I'm trying to create funcionality similar to KSSMasterSelectWidget. 
Everything works as expected (changing of fields visibility) but I'v 
found a bug in currentFormVar.

I'm using azax 1.1 (SVN checkout of 
http://codespeak.net/svn/kukit/azax/branch/1.1), Zope 2.9, Plone 2.5.3. 
I have base_edit form which contains several <select> fields and one set 
of checkboxes.
Set of checkboxes consists of 7 <input>s.

I'v been digging into forms.js, method kukit.fo.getValueOfFormElement
http://codespeak.net/svn/kukit/kukit.js/trunk/kukit/forms.js

if "element" is list of checkboxes, "null" is returned. It seems this 
method is missing something like there is done for "list of radios"

>     } else if (typeof element.length != 'undefined' && typeof element.item != 'undefined' && element.item(0).type == "radio") {
>         var radioList = element;
>         value = null;
>         for (var i=0; i < radioList.length; i++) {
>             var radio = radioList.item(i);
>             if (radio.checked) {
>                 value = radio.value;
>             }
>         }

I'v added similar code block for element.item(0).type == "checkbox" and 
tried to return array of selected values, but I'v got error message 
about invalid response (it seems response parser does not like arrays?)
client_reason="Response parsing error: ResponseParsingError: Unknown 
server error (invalid KSS response, no error info received)"

I have no idea what is done with this response so I can't provide more 
informations.

Btw, my goal is to display formatted text from several fields user 
selected, for example: Your selection: ...someitem... and these values: 
Checkbox1, Checkbox5, Checkbox7. The formatted text should change with 
every selection change. This works for me, except the checkboxes.

Second, less important bug, is in logging part of method 
kukit.fo.getFormVar. If "element" is list of items, there is logged 
"undefined" or something like that, instead of element.tagName or 
element.name.


Thank you for feedback,
-- 
naro



More information about the Kss-devel mailing list