net.sf.jsm.widgets
Class JsmSelectField

java.lang.Object
  extended bynet.sf.jsm.JsmObject
      extended bynet.sf.jsm.widgets.JsmSelectField
All Implemented Interfaces:
JsmWidget

public class JsmSelectField
extends JsmObject
implements JsmWidget

Author:
ronald ploeger

Field Summary
static Log logger
           
 
Fields inherited from class net.sf.jsm.JsmObject
attributes, id, META_DATA_NAME_PROPERTY_PATH, META_DATA_NAME_VALUE, metaData
 
Constructor Summary
JsmSelectField()
           
JsmSelectField(java.util.Map options)
           
JsmSelectField(java.util.Map options, boolean multi, int size)
           
 
Method Summary
 JsmSelectField addAttribute(java.lang.String name, java.lang.String value)
           
 JsmSelectField addMetaData(java.lang.String name, java.lang.String value)
           
 JsmSelectField addOption(java.lang.String value, java.lang.String label)
           
 JsmSelectField addOptions(java.util.List valueObjects, java.lang.String pathForValue, java.lang.String pathForLabel)
          Add options for the list of value objects where the value is retrieved using the path 'pathForValue' and the label using the path 'pathForLabel'
 JsmSelectField addOptions(java.util.Map options)
          Add the specified options
 java.lang.String generateJavaScript()
           
 java.util.Map getOptions()
           
 java.lang.String getOptionsAsJSON()
           
 int getSize()
           
 boolean isMulti()
           
 JsmSelectField setAttributes(java.util.Map attributes)
           
 JsmSelectField setMetaData(java.util.Map metaData)
           
 JsmSelectField setMulti(boolean multi)
           
 JsmSelectField setOptions(java.util.Map options)
          Set the specified options
 JsmSelectField setSize(int size)
           
 
Methods inherited from class net.sf.jsm.JsmObject
addAttributeX, addJmsObjectStuff, addMetaDataX, escapeQuote, getAttributes, getId, getMetaData, setAttributesX, setId, setMetaDataX
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static Log logger
Constructor Detail

JsmSelectField

public JsmSelectField()

JsmSelectField

public JsmSelectField(java.util.Map options)

JsmSelectField

public JsmSelectField(java.util.Map options,
                      boolean multi,
                      int size)
Method Detail

getOptions

public java.util.Map getOptions()

setOptions

public JsmSelectField setOptions(java.util.Map options)
Set the specified options

Parameters:
options - Map of value-label elements
Returns:

addOptions

public JsmSelectField addOptions(java.util.Map options)
Add the specified options

Parameters:
options -
Returns:

addOptions

public JsmSelectField addOptions(java.util.List valueObjects,
                                 java.lang.String pathForValue,
                                 java.lang.String pathForLabel)
                          throws JsmException
Add options for the list of value objects where the value is retrieved using the path 'pathForValue' and the label using the path 'pathForLabel'

Parameters:
valueObjects -
pathForValue -
pathForLabel -
Returns:
Throws:
JsmException

addOption

public JsmSelectField addOption(java.lang.String value,
                                java.lang.String label)

isMulti

public boolean isMulti()

setMulti

public JsmSelectField setMulti(boolean multi)

getSize

public int getSize()

setSize

public JsmSelectField setSize(int size)

setAttributes

public JsmSelectField setAttributes(java.util.Map attributes)

addAttribute

public JsmSelectField addAttribute(java.lang.String name,
                                   java.lang.String value)

setMetaData

public JsmSelectField setMetaData(java.util.Map metaData)

addMetaData

public JsmSelectField addMetaData(java.lang.String name,
                                  java.lang.String value)

getOptionsAsJSON

public java.lang.String getOptionsAsJSON()

generateJavaScript

public java.lang.String generateJavaScript()
Specified by:
generateJavaScript in interface JsmWidget
Specified by:
generateJavaScript in class JsmObject