Wexus2 0.20
|
#include <Form.h>
Public Types | |
enum | { Method_Post, Method_Get, Method_Upload } |
Public Member Functions | |
Form (const QString &formname, const QString &rawurl=pathTo(), int method=Method_Post) | |
Form (ActiveRecord &rec, const QString &rawurl=pathTo(), int method=Method_Post) | |
~Form () | |
destructor | |
wexus::HTMLString | textField (const QString &fieldName, const QVariant &defaultVal=QVariant(), int sz=30, int maxlen=60, const ValidationExpr &valExpr=ValidationExpr()) const |
wexus::HTMLString | submitButton (const QString &desc, const QString &fieldName=QString()) const |
Static Public Member Functions | |
static void | testFlashValidators (const QVariantMap ¶ms, const QVariantMap &flash, Context::Errors &errors) |
Protected Member Functions | |
wexus::HTMLString | fullFieldName (const QString &fieldName) const |
QVariant | formValue (const QString &fieldName) const |
Protected Attributes | |
QString | dm_formname |
ActiveRecord * | dm_rec |
A general HTML form.
wexus::Form::Form | ( | const QString & | formname, |
const QString & | rawurl = pathTo() , |
||
int | method = Method_Post |
||
) |
Constructor.
wexus::Form::Form | ( | ActiveRecord & | rec, |
const QString & | rawurl = pathTo() , |
||
int | method = Method_Post |
||
) |
Constructor that uses the given ActiveRecord for default values.
QVariant wexus::Form::formValue | ( | const QString & | fieldName | ) | const [protected] |
Returns the current value from the form. If there isn't one, then this returns the current value of fieldName in the active record. If there is no activerecord for this form, then this returns QVariant (an inValid QVariant)
wexus::HTMLString wexus::Form::fullFieldName | ( | const QString & | fieldName | ) | const [protected] |
Emits the form field to output
wexus::HTMLString wexus::Form::submitButton | ( | const QString & | desc, |
const QString & | fieldName = QString() |
||
) | const |
The submit button. fieldName is optional and not often used.
wexus::HTMLString wexus::Form::textField | ( | const QString & | fieldName, |
const QVariant & | defaultVal = QVariant() , |
||
int | sz = 30 , |
||
int | maxlen = 60 , |
||
const ValidationExpr & | valExpr = ValidationExpr() |
||
) | const |
A basicl text field.