Hi Massimo,

The form.tcl with the new autogeneration works well for me.
I would:
- Name the whole feature "autoid"
- Name the option "-autoidprefix" (prefix is to global IMHO)
- have the "_" in the prefix:
        ${autoid_prefix}[incr auto_cnt]
        default for variable 'autoid_prefix' is 'autogen_'
instead
        > ${prefix}_[incr auto_cnt]
        > default for variable 'prefix' is 'autogen'
to give custom settings more flexibility.

---

I am still against calling it form2.tcl.

Change summary to the user:

1) Bugfix of:treat default sometimes as value, sometimes as list
In consequence, package may crash by special user input

Authors of changes: Massimo, Harald

- use __$name indexes to indicate lists in default values
- extend the (so far undocumented but exported) method default_value
  by a -list option to get and set parameters in list style
- extend "select" method to detect -multi 1 option and to use list style
default.

Possible incompatiblilities:
this code does not work any more:
        set response(radio1) [var list radio1]
        set response(checkbox1) [var list checkbox1]
        form my_form -default response
        my_form start
        my_form radio radio1 -value "v 1" -label "l 1"
        my_form checkbox checkbox1 -value "v 1" -label "l 1"
        my_form end

as the "__name" indexes are missing.

This works now and is not vulnerable for attacks like "t.rvt?radio1=%7B"
(crash) or "t.rvt?radio1=v%201" (no detection) any more:

        load_response
        form my_form -default response
        my_form start
        my_form radio radio1 -value "v 1" -label "l 1"
        my_form checkbox checkbox1 -value "v 1" -label "l 1"
        my_form end

this didn't work before and works now:

        load_response
        form my_form -default response
        my_form start
        my_form select select1 -multiple 1 -values {"v 1" "v 2"}
        my_form end

The first example must now be written as:

        form my_form -default response
        my_form default_value radio1 -list [var list radio1]
        my_form default_value checkbox1 -list [var list checkbox1]
        my_form start
        my_form radio radio1 -value "v 1" -label "l 1"
        my_form checkbox checkbox1 -value "v 1" -label "l 1"
        my_form end

or as:

        set response(radio1) [var list radio1]
        set response(__radio1) ""
        ...

2) Bugfix/new method: checkboxes

Author of changes: Harald

The method "checkbox" docs stated, that it support the parameters
"-values" and "-labels". This was wrong.
In consequence, I added the method "checkboxes, which have those
parameters and which is similar to the methods radiobuttons/radio

It might be discussed if this is a bug-fix or a new feature.
Anyway, it is useful and does not harm anybody.

3) Bugfix/new function: Reference the option id in the label and
autogenerate an id if there is no id given (method checkbox/radiobutton)

Authors: Jeff, Damon, Massimo

There is a new option "-autoidprefix".

IMHO this is a new good harmless feature.
No incompatibilities introduced.

---

Looking to the changed issues, there is IMHO nothing justifying a new
form2.tcl package.
Most parts are bugfixes which must anyway be included in form.tcl. Or do
we just catch the "lsearch" and live with the status quo ?
Also, two packages must be:
- documented
- maintained !!!!!!
in future releases separately (IMHO the strongest argument, we have
other things to do)

I would prefer that others would test the new package and tell, if they
could live with that.

My much to long two pennies....
Harald

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org
For additional commands, e-mail: rivet-dev-h...@tcl.apache.org

Reply via email to