[ic] [table-editor] requires {TOP_OF_FORM}

Dan Browning interchange-users@icdevgroup.org
Sun May 11 02:41:01 2003


At 12:04 AM 5/11/2003 -0400, you wrote:
>Quoting Dan Browning (dbml@kavod.com):
> > Lately I've been saving myself hours and hours by using the wondrous 
> [table-editor] in 4.9 CVS.  But it seems that [table-editor] will not 
> display anything if you omit the {TOP_OF_FORM} and {BOTTOM_OF_FORM}.
> >
> > Problem demonstration:
> >
> > <form>
> > [table-editor table=country]
> >         {HIDDEN_FIELDS} <table> {:REST} </table>
> > [/table-editor]
> > ... lots of other stuff here ...
> > [button text="Next"]mv_nextpage=aboutus[/button]
> > </form>
> >
> > Work-around:
> >
> > <form>
> > [table-editor table=country]
> >         [tmp a]{TOP_OF_FORM}[/tmp]
> >         {HIDDEN_FIELDS} <table> {:REST} </table>
> >         [tmp a]{BOTTOM_OF_FORM}[/tmp]
> > [/table-editor]
> > ... lots of other stuff here ...
> > [button text="Next"]mv_nextpage=aboutus[/button]
> > </form>
> >
> > Notice how we still get the effect of removing TOP_OF_FORM by using 
> [tmp][/tmp].
> >
> > Is this the desired behavior?  (In other words, am I the only one who 
> wants to embed table-editor within their own <form>?)
>
>It was supposed to protect people against themselves, but I guess I
>shouldn't do that. 8-)
>
>         $overall_template =~ /{TOP_OF_FORM}/
>             or return $death->('TOP_OF_FORM');
>         $overall_template =~ /{HIDDEN_FIELDS}/
>             or return $death->('HIDDEN_FIELDS');
>         $overall_template =~ /{BOTTOM_OF_FORM}/
>             or return $death->('BOTTOM_OF_FORM');

Aha.  I should have grepped the source for 'death' before I posted.  :-)

>I will make this:
>
>         $overall_template =~ /{TOP_OF_FORM}/
>             or $opt->{i_really_mean_it}
>             or return $death->('TOP_OF_FORM');
>         $overall_template =~ /{HIDDEN_FIELDS}/
>             or $opt->{i_really_mean_it}
>             or return $death->('HIDDEN_FIELDS');
>         $overall_template =~ /{BOTTOM_OF_FORM}/
>             or $opt->{i_really_mean_it}
>             or return $death->('BOTTOM_OF_FORM');
>
>I guess i-really-mean-it=1 is not very intuitive, but I am
>running out of option names for table editor.

How about "gee--i-am-not-too-sure-but-try-it-anyway=1"  ;-)

>Perhaps
>
>         [table-editor incomplete-form-ok=1 ...]
>
>I made it:
>
>         unless($opt->{incomplete_form_ok}) {
>             $overall_template =~ /{TOP_OF_FORM}/
>                 or return $death->('TOP_OF_FORM');
>             $overall_template =~ /{HIDDEN_FIELDS}/
>                 or return $death->('HIDDEN_FIELDS');
>             $overall_template =~ /{BOTTOM_OF_FORM}/
>                 or return $death->('BOTTOM_OF_FORM');
>         }
>
>That is now in CVS.

Great.  Thanks Mike!

--
Dan Browning, Kavod Technologies, <db@kavod.com> 360.843.4074x217
6700 NE 162nd Ave, Ste 611-210, Vancouver, WA.      Random quote:
Food for thought is no substitute for the real thing.
                 -- Walt Kelly, "Putluck Pogo"