formulator troubles
Somhorst JJT <[email protected]> Tue, 24 May 2005 16:45:38 +0200
| Newsgroups | gmane.comp.web.zope.silva.general,gmane.comp.web.zope.formulator.devel |
|---|---|
| Message-ID | <[email protected]> |
After some weeks i discoverd ( stupid me ) a bug in the extension. I'm using a form.form to show the fields i want to be filled in and edited ( in another form.form. ) The problem lies in the edit mode. After someone changed the values and pressed the save button a save_helper.py will save the values into the object. For almost all fields this works well only for the multicheckboxes it doesnt? Im using an IF statement to know which form ( node ) im dealing with and what i should do then. For the multicheckboxes this is something like this: editor.replace_text(node, ', '.join(request['field_'+node.nodeName])) if someone checked only 1 value in the formfield it goes wrong.. lets say i have the following values: dutch | dutch, english | english the code stated above will split this into pieces where it encounters a comma. When multiple boxes are checked this does work and everything works well. But for some reason when someon just checked one box I get the following output: d,u,t,c,h, I dont know whats causing this because im using the same technnique on adding ( creating ) a new object to create the xml out of the data im getting from the form. Also why does it insert comma's when it has to join ? I tried to fix this by inserting a if statement that counted the elements and if it was bigger then 1 join the element's otherwise get me the value of the first. This didnt work, why I dont know because it just gave me a runtime error without telling me what's wrong. Could somebody tell me how to fix this strange behaviour or, if not fixable, telling me its a bug :P Yours Sincerely, J.somhorst