[ic] Table editor and form profiles
Peter
peter at pajamian.dhs.org
Thu Mar 12 20:43:49 UTC 2009
On 03/12/2009 07:33 AM, Jeff Boes wrote:
> Sent this about a week ago, didn't see any response so I'm trying again. Is
> there really no one on the list that has done anything with these before? I
> can't be the first down this path ...
>
> I am looking for guidance on the use of form profiles within the table editor.
> Within the "admin/db_metaconfig.html" page, there's a space for "Form profile",
> which by experimentation I determined could be filled with a standard form
> profile (I'd really rather have this in an external profile, but I couldn't
> figure out how to direct this to that). I've verified that the profile is
> invoked, and that failures in the profile do cause the table editor to
> re-display the row you were editing. However, there's no evidence that the field
> error (or any other indicator) is displayed.
Unfortunately a lot of the functionality of [table-editor] is
undocumented which is a shame because it is very powerful. That said it
is also very confusing and if I were to write this functionality now
chances are I would not use [table-editor] at all. Anyways here is some
code that I wrote up for table editor a while ago, it does something
similar to what you want. The example should help you to figure out how
to make yours work.
IIRC, defaults=1 makes the values stored in Values space appear in the
fields. By setting the scratch after the tag runs it means that the
user will always get a blank form the first time through, but when it is
presented again the form will contain the values that they filled in. I
think the keep_errors="[scratchd errors]" is required to make the errors
show up with the labels but I'm really not sure on this one and would
have to look back at the source for the [table-editor] tag to be sure.
Try it with and without that line to see what happens:
[table-editor
table=affiliate
wizard=1
no_meta=1
ui_wizard_fields="affiliate password verify"
mv_nextpage=newaffiliate2
defaults="[scratch newaffiliate1]"
keep_errors="[scratchd errors]"
check.affiliate=|
required Please enter a Username.
unique affiliate That Username is already taken. Please
enter another.
|
label.password="Password"
check.password="length 6 Please supply a password at least 6
chars long."
widget.password=password
label.verify="Verify Password"
check.verify="match password Password must match verify"
widget.verify=password
]
[set newaffiliate1]1[/set]
Peter
More information about the interchange-users
mailing list