phpPeanuts  2.2.0
phpPeanuts framework
 All Data Structures Namespaces Files Functions Variables
Public Member Functions | Data Fields
PntSelectWidget Class Reference

Inherits PntFormWidget.

Inherited by SelectWidget.

Public Member Functions

 __construct ($whole, $requestData, $formText=null, $optionItems=null)
 
 getName ()
 
 initialize ($text, $options=null)
 
 setSelectedId ($value)
 
 setSettedCompulsory ($value)
 
 setWidth ($value)
 
 setAutoSelectFirst ($value)
 
 setOptions ($value)
 
 setOnChangeScript ($value)
 
 setOptionsFromObjects ($objects, $type)
 
 addOptionFromObject (&$options, $obj, $type, $cnv, $idProp)
 
 setOptionsFromValues ($values, $type, $cnv)
 
 setWidthFromOptionsMaxLength ($multiplier, $min=null, $max=null)
 
 printBody ()
 
 printOnChangeScript ()
 
 printStyle ()
 
 printUnselectOption ()
 
 printSelectOptions ()
 
 getOptionSelected ($id)
 
 getOptions ()
 
 getSelectedId ()
 
 getSettedCompulsory ()
 
 getAutoSelectFirst ()
 
- Public Member Functions inherited from PntFormWidget
 __construct ($whole, $requestData, $formText=null)
 
 initialize ($formText)
 
 setFormKey ($value)
 
 setValue ($value)
 
 setError ($errorMessage)
 
 printBody ()
 
 printFormKey ()
 
 printValue ()
 
 initDialogUrlNoId ($nav)
 
 getCssClass ()
 
 getCssClassAdder ()
 
 printTitle ()
 
- Public Member Functions inherited from PntPagePart
 printBody ()
 
 ajaxPrintUpdates ($preFix='')
 
 getThisPntHandlerName ()
 
 getType ()
 
 getRequestedObject ()
 
 getFormTexts ()
 
 getOwnFormTexts ()
 
 getFootprintId ()
 
 getExcludedMultiValuePropButtonKeys ()
 
- Public Member Functions inherited from PntPage
 getInfoStyle ()
 
 setInfoStyle ($value)
 
 printHeader ()
 
 printFooter ()
 
 printBodyTagIeExtraPiece ()
 
 includeSkin ($name, $param=null)
 
 printSetTitle ($title=null)
 
 getButton ($caption, $script, $ghost=false, $len=null)
 
 handleRequest ()
 
 getPartId ()
 
 ajaxHandleRequest ()
 
 ajaxPrintHeaders ()
 
 ajaxPrintUpdates ($preFix='')
 
 getAjaxUpdatePartIds ()
 
 getAjaxUpdateSubPartIds ($prefix)
 
 ajaxShouldUpdate ($partId, $partName=null, $extraParam=null)
 
 ajaxPrintPartUpdate ($partName, $partId=null, $extraParam=null)
 
 isRequestAjax ()
 
 ajaxPrintPartAttributes ()
 
 getAjaxLoadingMessage ()
 
 initForHandleRequest ()
 
 checkAccess ()
 
 isLayoutReport ()
 
 printHeaders ()
 
 printHeaderXframeOptions ()
 
 getCharset ()
 
 printBody ()
 
 printMainPart ()
 
 printPart ($partName)
 
 imp_printPart ($args)
 
 getPart ($args, $cache=true)
 
 getPartIncludeTryParams ($partName)
 
 getSpecificPartPrefix ($partName=null)
 
 printPartDebugComment ($partName, $debug)
 
 printInformationPart ()
 
 getFilterPartString ()
 
 getButtonsList ()
 
 addMultiValuePropertyButtons (&$buttons)
 
 getExcludedMultiValuePropButtonKeys ()
 
 getMultiValuePropertyButtonScript ($propName, $edit=false)
 
 getThisPntContext ()
 
 getDetailsHref ($appName, $pntType)
 
 getLinkDirFromNav ($nav, $pntHandler='')
 
 getTargetAppName ($nav, $pntHandler='')
 
 getDetailsLinkPntHandler ()
 
 getNoItemsMessage ()
 
 getRequestDuration ()
 
 getConvert ($obj, $path, $kind=0, $preformatAndTab=0)
 
 getInitConverter ($prop)
 
 addContextButtonTo (&$buttons)
 
 doScouting ()
 
 getFootprintId ()
 
 printFootprintJsLiteral ($quote="'")
 
 getPropertyName ()
 
 printNextActionTicket ()
 
 getAndCreateNextActionTicket ()
 
 printExtraHeaders ()
 
 getImagesDir ()
 
- Public Member Functions inherited from PntRequestHandler
 __construct ($whole, $requestData)
 
 getDir ()
 
 getDomainDir ($type=null)
 
 getBaseUrl ()
 
 getConverter ()
 
 getDebugMode ()
 
 initForHandleRequest ()
 
 startSession ()
 
 getContextHref ($footprintId)
 
 getController ()
 
 getScout ()
 
 getGlobalFilters ()
 
 forwardRequest ($requestData, $information=null)
 
 redirectRequest ($requestData, $information=null, $dir=null)
 
 queryStringFrom ($requestData, $param=null)
 
 getRequestParam ($key)
 
 getReqParam ($key, $asHtml=false)
 
 htOut ($aString)
 
 getRequestHandler ($requestData, $dir=null)
 
 tryUseHandlerClass ($handlerClass, &$attempted)
 
 getHandlersTriedString ($attempted)
 
 __toString ()
 
 toString ()
 
 getLabel ()
 
 getName ()
 
 getThisPntHandlerName ()
 
 getInformation ()
 
 getEventualItemNotFoundMessage ()
 
 setInformation ($value)
 
 getTypeLabel ()
 
 getType ()
 
 checkAlphaNumeric ($value)
 
 getTryUseClassTryParams ($className, $dir)
 
 getIncludesDir ()
 
 tryUseClass ($className, $dir)
 
 useClass ($className, $dir)
 
 getTypeClassDescriptor ()
 
 getRequestedObject ()
 
 setRequestedObject ($value)
 
 getFormTexts ()
 
 getFormTextPaths ()
 
 setFormTexts ($value)
 
 getMarkedItemsCollector ()
 

Data Fields

 $settedCompulsory = true
 
 $autoSelectFirst = false
 
 $width
 
 $unselectLabel = ''
 
 $cssClass = 'pntSelectWidget'
 
 $selectedId
 
- Data Fields inherited from PntFormWidget
 $value
 
 $formKey
 
 $cssClass = 'pntFormWidget'
 
 $error
 

Additional Inherited Members

- Static Public Member Functions inherited from PntPage
static getInfoStyleOk ()
 
static getInfoStyleError ()
 
static getInfoStyleWarning ()
 

Constructor & Destructor Documentation

__construct (   $whole,
  $requestData,
  $formText = null,
  $optionItems = null 
)

Member Function Documentation

addOptionFromObject ( $options,
  $obj,
  $type,
  $cnv,
  $idProp 
)

Adds an option

Parameters
array&$optionswhere the option is to be added to
Object$objof $type
string$typeof $object
PntStringConverter$cnvinitialized to convert id and $obj toLabel and toHtml
PntPropertyDescriptor$idPropto derive the id from the object
getAutoSelectFirst ( )
Returns
boolean $value wheather the first option in the list should be automatically selected when selecteId is empty, 0 or null
getName ( )
getOptions ( )
Returns
array associative with strings (not HTML) as its keys and option content (HTML) as its values
getOptionSelected (   $id)
getSelectedId ( )
Returns
string the selected id or value, not HTML
getSettedCompulsory ( )
Returns
boolean $value wheather the user must select a value. If not, an option is included in the list for unselecting unless autoselectFirst
initialize (   $text,
  $options = null 
)
Exceptions
PntError
printBody ( )
printOnChangeScript ( )
printSelectOptions ( )
printStyle ( )
printUnselectOption ( )
setAutoSelectFirst (   $value)
Parameters
boolean$valuewheather the first option in the list should be automatically selected when selecteId is empty, 0 or null
setOnChangeScript (   $value)
Parameters
javacriptvalue of the onChanged attribute of the select tag
setOptions (   $value)
Parameters
arrayassociative of strings with strings (not HTML) as the keys and option content (HTML) as the values
setOptionsFromObjects (   $objects,
  $type 
)
Parameters
array$objectsof $type to derive the options from
string$typeof the objects, must have a ClassDescriptor that supports ::getPeanutWithId
setOptionsFromValues (   $values,
  $type,
  $cnv 
)

set options using the labels of the values as keys and as HTML as values

Parameters
array$valuesof mixed
string$typeof value
PntStringConverter$cnvinitialized to convert the $values toLabel and toHtml
setSelectedId (   $value)

string the selected id or value, not HTML

setSettedCompulsory (   $value)
Parameters
boolean$valuewheather the user must select a value. If not, an option is included in the list for unselecting unless autoselectFirst
setWidth (   $value)
setWidthFromOptionsMaxLength (   $multiplier,
  $min = null,
  $max = null 
)

Calculate the width from $this->optionsMaxLength and set it to the calculated value Only has effect if $this->optionsMaxLength is set and > 0

Parameters
int$multiplierthe number of pixels per character
int$minthe minimum width. If null no minimum is applied
int$maxthe maximum width. If null no maximum is applied
Returns
int the calculated value or null if nothing was calculated

Field Documentation

$autoSelectFirst = false
$cssClass = 'pntSelectWidget'
$selectedId
$settedCompulsory = true
$unselectLabel = ''

string label of the option by which to select 'no value'

$width

The documentation for this class was generated from the following file: