silverorange Code


Swat.SwatFormField
/Swat/SwatFormField.php at line 20

Class SwatFormField

SwatObject
└─SwatUIObject
└─SwatWidget
└─SwatContainer
└─SwatDisplayableContainer
└─SwatFormField

public class SwatFormField
extends SwatDisplayableContainer

A container to use around control widgets in a form

Adds a label and space to output messages.

Copyright:
2004-2006 silverorange
License:
http://www.gnu.org/copyleft/lesser.html LGPL License 2.1

Field Summary
string

$access_key

Access key.

protected string

$container_tag

Container tag to use.

protected string

$contents_tag

Contents tag to use.

boolean

$display_messages

Whether or not to display validation messages in this form field.

boolean

$note

Optional note of text to display with the field.

string

$note_content_type

Optional content type for the note.

mixed

$required

boolean

$show_colon

Whether or not to show a colon after the title of this form field.

string

$title

The visible name for this field, or null.

string

$title_content_type

Optional content type for the title.

mixed

$title_reversed

protected string

$widget_class

A CSS class name set by the subwidgets in this form field.

Constructor Summary

SwatFormField(string id)

Creates a new form field.

Method Summary
void

display()

Displays this form field.

protected void

displayContent()

protected void

displayMessages()

protected void

displayNotes()

protected void

displayRequired()

protected void

displayTitle()

protected array

getCSSClassNames()

Gets the array of CSS classes that are applied to this form field.

string

getTitle()

Gets the title of this form field.

protected SwatHtmlTag

getTitleTag()

Get a SwatHtmlTag to display the title.

protected void

notifyOfAdd(SwatWidget widget)

Notifies this widget that a widget was added.

Methods inherited from Swat.SwatDisplayableContainer
display, getCSSClassNames
Methods inherited from Swat.SwatContainer
add, addChild, copy, display, displayChildren, getChild, getChildren, getDescendantStates, getDescendants, getFirst, getFirstDescendant, getFocusableHtmlId, getHtmlHeadEntrySet, getMessages, hasMessage, init, notifyOfAdd, packEnd, packStart, printWidgetTree, process, remove, replace, sendAddNotifySignal, setDescendantStates
Methods inherited from Swat.SwatWidget
addCompositeWidget, addMessage, confirmCompositeWidgets, copy, createCompositeWidgets, display, displayHtmlHeadEntries, getCSSClassNames, getCompositeWidget, getCompositeWidgets, getFocusableHtmlId, getHtmlHeadEntrySet, getMessages, hasMessage, init, isDisplayed, isInitialized, isProcessed, isSensitive, printWidgetTree, process, replaceWithContainer
Methods inherited from Swat.SwatUIObject
addComment, addJavaScript, addStyleSheet, addTangoAttribution, copy, getCSSClassNames, getCSSClassString, getFirstAncestor, getHtmlHeadEntrySet, getInlineJavaScript, getUniqueId, isVisible

Field Detail

/Swat/SwatFormField.php at line 70

access_key

public string $access_key = null

Access key

Sets an access key for the label of this form field, if one exists.


/Swat/SwatFormField.php at line 112

container_tag

protected string $container_tag = 'div'

Container tag to use

Subclasses can change this to change their appearance.


/Swat/SwatFormField.php at line 121

contents_tag

protected string $contents_tag = 'div'

Contents tag to use

Subclasses can change this to change their appearance.


/Swat/SwatFormField.php at line 100

display_messages

public boolean $display_messages = true

Whether or not to display validation messages in this form field

Defaults to true. Set to false to prevent the displaying of messages in this form field.


/Swat/SwatFormField.php at line 52

note

public boolean $note = null

Optional note of text to display with the field


/Swat/SwatFormField.php at line 61

note_content_type

public string $note_content_type = 'text/plain'

Optional content type for the note

Default text/plain, use text/xml for XHTML fragments.


/Swat/SwatFormField.php at line 45

required

public mixed $required = false

/Swat/SwatFormField.php at line 79

show_colon

public boolean $show_colon = true

Whether or not to show a colon after the title of this form field

By default, a colon is shown.


/Swat/SwatFormField.php at line 29

title

public string $title = null

The visible name for this field, or null


/Swat/SwatFormField.php at line 38

title_content_type

public string $title_content_type = 'text/plain'

Optional content type for the title

Default text/plain, use text/xml for XHTML fragments.


/Swat/SwatFormField.php at line 90

title_reversed

public mixed $title_reversed = null

/Swat/SwatFormField.php at line 130

widget_class

protected string $widget_class

A CSS class name set by the subwidgets in this form field

See Also:
SwatFormField::notifyOfAdd()

Constructor Detail

/Swat/SwatFormField.php at line 142

SwatFormField

public SwatFormField(string id)

Creates a new form field

Parameters:
id - a non-visible unique id for this widget.
See Also:
SwatWidget::__construct()

Method Detail

/Swat/SwatFormField.php at line 173

display

public void display()

Displays this form field

Associates a label with the first widget of this container.


/Swat/SwatFormField.php at line 233

displayContent

protected void displayContent()

/Swat/SwatFormField.php at line 246

displayMessages

protected void displayMessages()

/Swat/SwatFormField.php at line 285

displayNotes

protected void displayNotes()

/Swat/SwatFormField.php at line 220

displayRequired

protected void displayRequired()

/Swat/SwatFormField.php at line 205

displayTitle

protected void displayTitle()

/Swat/SwatFormField.php at line 334

getCSSClassNames

protected array getCSSClassNames()

Gets the array of CSS classes that are applied to this form field

Returns:
the array of CSS classes that are applied to this form field.
See Also:
SwatUIObject::getCSSClassString()

/Swat/SwatFormField.php at line 160

getTitle

public string getTitle()

Gets the title of this form field

Satisfies the {SwatTitleable::getTitle()} interface.

Returns:
the title of this form field.

/Swat/SwatFormField.php at line 361

getTitleTag

protected SwatHtmlTag getTitleTag()

Get a SwatHtmlTag to display the title

Subclasses can change this to change their appearance.

Returns:
a tag object containing the title.

/Swat/SwatFormField.php at line 392

notifyOfAdd

protected void notifyOfAdd(SwatWidget widget)

Notifies this widget that a widget was added

This sets class propertes on this form field when certain classes of widgets are added.

Parameters:
widget - the widget that has been added.
See Also:
SwatContainer::notifyOfAdd()

silverorange Code