silverorange Code


Swat.SwatFlydown
/Swat/SwatFlydown.php at line 19

Class SwatFlydown

SwatObject
└─SwatUIObject
└─SwatWidget
└─SwatControl
└─SwatInputControl
└─SwatOptionControl
└─SwatFlydown

public class SwatFlydown
extends SwatOptionControl

A flydown (aka combo-box) selection widget

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

Field Summary
string

$blank_title

Blank title.

boolean

$show_blank

Show a blank option.

string

$value

Flydown value.

Fields inherited from Swat.SwatOptionControl
options, serialize_values
Fields inherited from Swat.SwatInputControl
required
Method Summary
void

addDivider(string title)

Adds a divider to this flydown.

void

display()

Displays this flydown.

protected void

displaySingle(mixed flydown_option)

Displays this flydown if there is only a single option.

protected array

getCSSClassNames()

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

string

getFocusableHtmlId()

Gets the id attribute of the XHTML element displayed by this widget that should receive focus.

boolean

getState()

Gets the current state of this flydown.

void

process()

Figures out what option was selected.

protected boolean

processValue()

Processes the value of this flydown from user-submitted form data.

void

reset()

Resets this flydown.

void

setState(boolean state)

Sets the current state of this flydown.

Methods inherited from Swat.SwatOptionControl
addOption, addOptionsByArray, getOption, getOptions, getOptionsByValue, removeOption, removeOptionsByValue
Methods inherited from Swat.SwatInputControl
getForm, init
Methods inherited from Swat.SwatControl
addMessage, getNote, printWidgetTree
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/SwatFlydown.php at line 49

blank_title

public string $blank_title = ''

Blank title

The user visible title to display in the blank field.


/Swat/SwatFlydown.php at line 40

show_blank

public boolean $show_blank = true

Show a blank option

Whether or not to show a blank value at the top of the flydown.


/Swat/SwatFlydown.php at line 31

value

public string $value = null

Flydown value

The index value of the selected option, or null if no option is selected.


Method Detail

/Swat/SwatFlydown.php at line 172

addDivider

public void addDivider(string title)

Adds a divider to this flydown

A divider is an unselectable flydown option.

Parameters:
title - the title of the divider. Defaults to two em dashes.

/Swat/SwatFlydown.php at line 59

display

public void display()

Displays this flydown

Displays this flydown as a XHTML select.


/Swat/SwatFlydown.php at line 284

displaySingle

protected void displaySingle(mixed flydown_option)

Displays this flydown if there is only a single option


/Swat/SwatFlydown.php at line 316

getCSSClassNames

protected array getCSSClassNames()

Gets the array of CSS classes that are applied to this flydown

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

/Swat/SwatFlydown.php at line 235

getFocusableHtmlId

public string getFocusableHtmlId()

Gets the id attribute of the XHTML element displayed by this widget that should receive focus

Returns:
the id attribute of the XHTML element displayed by this widget that should receive focus or null if there is no such element.
See Also:
SwatWidget::getFocusableHtmlId()

/Swat/SwatFlydown.php at line 202

getState

public boolean getState()

Gets the current state of this flydown

Returns:
the current state of this flydown.
See Also:
SwatState::getState()

/Swat/SwatFlydown.php at line 148

process

public void process()

Figures out what option was selected

Processes this widget and figures out what select element from this flydown was selected. Any validation errors cause an error message to be attached to this widget in this method.


/Swat/SwatFlydown.php at line 259

processValue

protected boolean processValue()

Processes the value of this flydown from user-submitted form data

Returns:
true if the value was processed from form data

/Swat/SwatFlydown.php at line 186

reset

public void reset()

Resets this flydown

Resets this flydown to its default state. This method is useful to call from a display() method when form persistence is not desired.


/Swat/SwatFlydown.php at line 217

setState

public void setState(boolean state)

Sets the current state of this flydown

Parameters:
state - the new state of this flydown.
See Also:
SwatState::setState()

silverorange Code