Am 21.05.2012 00:01, schrieb Massimo Manghi: > I made a very trivial patch of form.tcl that seems to cure the wrong > handling of checkbox input fields when a value carries a space character > in it (see bug #52653). I think this patch somehow modifies what Jeff > did to the form.tcl recently.
Dear Massimo, thank you for the patch: < if {![info exists DefaultValues(__${name})]} { < if {[string match $DefaultValues($name) $data(value)]} { < set data(checked) "checked" < } < } else { I can only say, that this brakes my current code: To generate the default array, I do: - for values: set response(entry) [var get entry] - for lists: set response(select) [var list select] I should add a: set response(__select) 1 to remake it work. --- I am sorry about all the comments in the bug data base: https://issues.apache.org/bugzilla/show_bug.cgi?id=52653 https://issues.apache.org/bugzilla/show_bug.cgi?id=52909 This was mainly due to a bug in Itcl4 "info exists" which is fixed now. --- Our main issue is, that we currently can crash our web server by values which are wrong lists: http://test/test.rvt?select=%7B ( %7B is "{" ) --- Here is my opinion what should be done: 1) method: load-variables 1.1) Remove the __xxx indexes 1.2) Add one meta index __listvars which is a list of indexes which are lists 1.3) Document the meta index in the documentation 2) package: form, default handling: 2.1) support meta index __listvars for all widget types 2.2) document meta index __listvars to list all default values which are lists The attached patch only treats the list/value issue for one widget type. Unfortunately, this must be done for all widget types. If the meta-index "__listvars" is not a good idea, we may stick with the current meta-indexes __xxx. In this case, point 1.3 and all point 2 items are still valid. --- Implementation ideas: Method import_data should have an extra parameter "defaultIsList". Each widget type may query for the required format and the method may transform lists to value and vers versa in dependency of this parameter and the contents of the meta-index (__xxx or __listvars). The following widget types require list-type: - select multiple - radio - checkbox --- As I have little knowledge in itcl, I don't favor to implement this. But it is possible. --- Thank you all, Harald --------------------------------------------------------------------- To unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org For additional commands, e-mail: rivet-dev-h...@tcl.apache.org