Wexus2 0.20
wexus::Form Class Reference

#include <Form.h>

List of all members.

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 &params, 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
ActiveRecorddm_rec

Detailed Description

A general HTML form.

Author:
Aleksander Demko

Constructor & Destructor Documentation

wexus::Form::Form ( const QString &  formname,
const QString &  rawurl = pathTo(),
int  method = Method_Post 
)

Constructor.

Author:
Aleksander Demko
wexus::Form::Form ( ActiveRecord rec,
const QString &  rawurl = pathTo(),
int  method = Method_Post 
)

Constructor that uses the given ActiveRecord for default values.

Author:
Aleksander Demko

Member Function Documentation

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)

Author:
Aleksander Demko
wexus::HTMLString wexus::Form::fullFieldName ( const QString &  fieldName) const [protected]

Emits the form field to output

Author:
Aleksander Demko
wexus::HTMLString wexus::Form::submitButton ( const QString &  desc,
const QString &  fieldName = QString() 
) const

The submit button. fieldName is optional and not often used.

Author:
Aleksander Demko
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.

Author:
Aleksander Demko

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations Enumerator