create new tag
, view all tags
For a long time now I've wanted "Live Forms" on TWiki. Live Forms are just TWiki forms, but they are editable from the view screen, without having to drop into an edit.

There are many applications for live forms, but the most public one is Bugs web, where being able to change the status of the bug at the same time as adding a comment would be extremely useful.

We discussed this a bit on IRC:

(07:48:55) CDot: BTW did anyone ever implement live forms?
(07:49:04) SvenDowideit: live forms?
(07:49:16) CDot: In Bugs web, I want to be able to change form fields and add a comment all in one go
(07:50:12) SvenDowideit: mmm, not something i wanted... til you mentioned it
(07:50:12) CDot: I don't want to have to create a custom comment template. I want something that will "just" make the already-attached form editable
(07:50:50) SvenDowideit: restplugin enables editing any one field
(07:50:58) SvenDowideit: but when you leave it, it saves
(07:51:05) CDot: understood; not what I meant
(07:51:06) SvenDowideit: so you'd be relying on reprev
(07:51:20) CDot: no, I want to use save, like CommentPlugin does
(07:51:21) SvenDowideit: but that would get the same result
(07:51:35) CDot: what I'm thinking of could be done in commentplugin, I think
(07:51:40) SvenDowideit: it can y. i've done something like that, but i had to make a specific comment tmpl
(07:51:56) SvenDowideit: specific to that form
(07:51:59) CDot: right
(07:52:21) SvenDowideit: the forms UI stuff is still in pretty much 2001 state
(07:52:23) CDot: in the past the form code has been so spaghetti it would have been really hard to do
(07:52:31) SvenDowideit: everything's hacked on, rather than built in
(07:52:39) CDot: but I deliberately did "renderForDisplay" and "renderForEdit", to enable this sort of thing
(07:52:48) SvenDowideit: y, thats annoying . i tried to add it as part of FORMFIELD, but even that is still naf.
not quite enough tmpl sanity
(07:53:41) CDot: what would be quite neat would be a "comment nipple". when you tweak the nipple, the comment box appears and the form 
goes editable, all on the client side. then a "save" does a commentplugin save
(07:54:22) SvenDowideit: twistyplugin is up to that already. you just need to fix "renderForDisplay" and "renderForEdit" to be properly
tmpl based and then merge them with a twistie
(07:56:25) SvenDowideit: to remove the html generation completly from the code and have that all done via tmpl's would make it a lot
simpler. then replacing tmpl with mason or t2 would also work more
(07:59:41) CDot: that's a lot more work than I had thought of.... i need to read the code to see what is possible from CommentPlugin.

So, it sounds like a mind-meld of CommentPlugin, TwistyPlugin and the existing forms code might just work. I'm not aware of any pre-existing work in this area, but I'd love to hear that someone has this done and dusted already!

Will investigate further when I have time.

-- Contributors: CrawfordCurrie - 25 Jul 2008


We had such an implementation (I didn't do it) at our site as a plugin. But it stopped working with 4.0, unfortunately. I can still dig out the code if you're interested. As far as I can remember the content became "active" (ie the save button) as soon as somebody with sufficient rights changed the content of a field. There were a lot of issues with rendering variables and the ordering of what comes first etc, and documentation on that process. It was a pretty nasty hack smile

-- YogiParish - 25 Jul 2008

AddSettingsTopicParamToEditAndSave implements the save portion - and adds the ability to save to multiple topics too. I've implemented this feature and used it exactly as you describe.

-- SvenDowideit - 25 Jul 2008

Yogi, thanks, if you have a zip please do attach it here and maybe someone can use it. I suspect if the code is pre-4.0 However the underlying Forms code has been extensively rewritten, and I doubt such old code would be much use. Good to know that it can be done, however.

Sven, thanks, I'll take a careful look at that.

-- CrawfordCurrie - 25 Jul 2008

I've attached what I found after a quick search. I doubt that is all. I will dig deeper if there's any need.

-- YogiParish - 25 Jul 2008

It is not entirely clear to me what the specification would be. To automatically generate a (complete) TWiki form on the page? Or to create a dynamic interface with some parts of the form?

There might be a way to tweak FormPlugin in either direction.

-- ArthurClemens - 25 Jul 2008

Let's take this topic as an example. When you view the topic, you see a comment box and the Change Proposal form at the bottom of the page. I want to be able to type "Don't be so bloody stupid" in the comment box, and set the CurrentState to RejectedProposal at the same time.

My preferred methodology is to click and type directly into the fields of the form. I think this could be done entirely in Javascript, if the TD's in the form had an onclick handler. I have never looked at FormPlugin before - is it JS?

-- CrawfordCurrie - 26 Jul 2008

Aha, so the idea is to make the form field change to edit state by clicking in it and adding a save button (somewhere).

-- ArthurClemens - 26 Jul 2008

The save button is the "Add Comment" button (though perhaps with a better name).

Another option would be to make the comment box also optional on clicking a "comment on this topic" button, which would display the comment box and enable the for for edit, though I don't find that as usable.

-- CrawfordCurrie - 26 Jul 2008

Very, very cool idea, if this allows us to make Basecamp like apps

-- ColasNahaboo - 26 Jul 2008

The combination with the comment box makes it tricky. This would require that the CommentPlugin form saves the field value as well.

-- ArthurClemens - 27 Jul 2008

I have some experimental code that lets you select and modify fields in the viewed form using a REST handler to set the field value, independently of the CommentPlugin. This approach fits in with my intention of using a REST handler in the next iteration of the CommentPlugin, so I was just thinking of killing two birds with one stone.

-- CrawfordCurrie - 27 Jul 2008

I like the idea of LiveForms a lot, as they can improve a wikis usability a lot.

-- MartinSeibert - 02 Aug 2008

Topic attachments
I Attachment History Action Size Date Who Comment
Compressed Zip archivetar GoolprojectPlugin.tar r1 manage 30.0 K 2008-07-25 - 08:39 YogiParish  
Edit | Attach | Watch | Print version | History: r13 < r12 < r11 < r10 < r9 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r13 - 2008-08-02 - MartinSeibert
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.