Hi, I'm afraid my focus was using Rivet to develop a website, rather than developing Rivet, so my hacking the Rivet functionality was aimed at getting my site up.
That project never got funded, so I'm not working on it now. (This is always subject to change. ) If you (or anyone else) thinks my start is worth expanding, feel free to do whatever you think is best for the Rivet code base. I was new to Rivet when I wrote that code. I don't recall if I used the loop because the original code didn't function correctly, or if I just didn't know that the load_response method should be there. Clif On Mon, Feb 13, 2012 at 12:07:05PM +0100, Harald Oehlmann wrote: > 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 -- ... Clif Flynt ... http://www.cwflynt.com ... c...@cflynt.com ... .. Tcl/Tk: A Developer's Guide (3'd edition) - Morgan Kauffman .. .... 19'th Annual Tcl/Tk Conference: 2012, Chicago, IL USA .... ............. http://www.tcl.tk/community/tcl2012/ ............ --------------------------------------------------------------------- To unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org For additional commands, e-mail: rivet-dev-h...@tcl.apache.org