Hi Clif, thank you for the snippet and for the missing "create" word in the syntax.
IMHO, the form package tries to solve the functionality of your loop by internal functionality: % load_response response Load all response vars in the array "response". % form form_request -method get -name request -defaults response If a field is created within this form with a name where "response" has a member, it adds its contents with a "-value" close on the html level. That is also what your proposed loop does. Unfortunately this did not work for me and I supposed it is due to my very fresh Itcl. I could use the loop method as an alternative which would work. I think it is worth while to implement the form package using TclOO instead Itcl. So I also wanted to use your implementation. It is unfortune, that: - the package has the same name (package require form) - but the syntax is different ("form create" vs "form") Anyway, thank you for your help and making Rivet nicer, -Harald Am 11.02.2012 03:34, schrieb Clif Flynt: > On Fri, Feb 10, 2012 at 05:28:33PM +0100, Harald Oehlmann wrote: >> ... >> I also tried Clif Flints tclOO-version. >> It complains on the call >> form form_request -method get -name request -defaults response >> about: wrong method: use new, create or delete > > I'm not sure about defaults, but here's a code snippet using the > TclOO form command. The big caveat on this code is that it works > for the features I needed, but I didn't have time to run it through > complete testing. > > form create spForm -method post -name create > spForm start > > foreach {fld txt size} { > name "Unit Name" 50} { > if {![var exists $fld]} {set $fld ""} else {set $fld $vals($fld)} > html $txt b > spForm text $fld -size $size -value [set $fld] > html <br> > } > > html "Type of Unit" b > html "(Private is controlled access. Public are groups anyone can join)" > html "" br > spForm radiobuttons payInfo -values "paid free" -labels "Private Public" > > spForm hidden displayed -value 1 > html "" br > spForm submit submit -value "Create" > spForm end > > Hope this helps, > Clif --------------------------------------------------------------------- To unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org For additional commands, e-mail: rivet-dev-h...@tcl.apache.org