Aaron Held <[EMAIL PROTECTED]> wrote:
> I have a FunFormKit form and I need to make a 'basic' and advanced form
> 
> I could just make all of the 'advanced' fields hidden but could I subclass for the 
>servlet itself?

You could have the servlet respond to more than one form definition --
one advanced one, one simple one.  Well, in theory -- there are a
couple bugs in this which I found since the last release, and I have
to put together another release with the fixes.  Hiding the fields
should also work.  As long as you allow empty values in the missing
fields, you can also write the HTML for the form yourself and just
leave out the unneeded fields -- however, when encountering errors the
user will still get the long form.  Having two forms is probably the
cleanest way.

You can make the form definition a class variable.  It's really just
important that the form definition that is used in __init__ is always
the same, because the servlet instance that generates the form isn't
necessarily the same instance that validates or regenerates the form.
As long as you are using one module per servlet (which is what you
have to do with Webware, really), it won't matter if it's a module
global variable or a class variable.

  Ian

_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to