water.api
Class RequestArguments.InputSelect<T>

java.lang.Object
  extended by water.Iced
      extended by water.api.RequestArguments.Argument<T>
          extended by water.api.RequestArguments.InputSelect<T>
All Implemented Interfaces:
java.lang.Cloneable, Request.Filter, Freezable
Direct Known Subclasses:
RequestArguments.EnumArgument, RequestArguments.FrameKeyVec, RequestArguments.H2OHexKeyCol, RequestArguments.StringList
Enclosing class:
RequestArguments

public abstract class RequestArguments.InputSelect<T>
extends RequestArguments.Argument<T>

Select element from the list of options. Array of values and arrays of names can be specified together with the selected element's value.


Field Summary
 
Fields inherited from class water.api.RequestArguments.Argument
_displayName, _field, _hideInQuery, _name, _prerequisites, _readOnly, _requestHelp, _required
 
Constructor Summary
RequestArguments.InputSelect(java.lang.String name, boolean required)
          Constructor just calls super.
 
Method Summary
protected  java.lang.String jsRefresh(java.lang.String callbackName)
          Refresh is supported using standard jQuery change event.
protected  java.lang.String jsValue()
          Get value is supported by the standard val() jQuery function.
protected  java.lang.String queryElement()
          Displays the query element.
protected abstract  java.lang.String selectedItemValue()
          Returns which value should be selected.
protected  java.lang.String[] selectNames()
          Override this method to determine the value names, that is the names displayed in the browser.
protected abstract  java.lang.String[] selectValues()
          Override this method to provide the values for the options.
 
Methods inherited from class water.api.RequestArguments.Argument
addPrerequisite, check, defaultValue, disable, disable, disabled, errors, jsAddons, originalValue, parse, query, queryAddons, queryComment, queryDescription, record, refreshOnChange, requestHelp, reset, run, setRefreshOnChange, specified, valid, value
 
Methods inherited from class water.Iced
clone, frozenType, init, newInstance, read, toDocField, write, writeJSON, writeJSONFields
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestArguments.InputSelect

public RequestArguments.InputSelect(java.lang.String name,
                                    boolean required)
Constructor just calls super.

Method Detail

selectValues

protected abstract java.lang.String[] selectValues()
Override this method to provide the values for the options. These will be the possible values returned by the form's input and should be the possible values for the JSON argument.


selectedItemValue

protected abstract java.lang.String selectedItemValue()
Returns which value should be selected. This is *not* the default value itself, as the default values may be of any type, but the input value that should be selected in the browser.


selectNames

protected java.lang.String[] selectNames()
Override this method to determine the value names, that is the names displayed in the browser. Return null, if the value strings should be used (this is default behavior).


queryElement

protected java.lang.String queryElement()
Displays the query element. It is a select tag with option tags inside. If the argument is required then additional empty value is added with name "Please select..." that ensures that the user selects actual value.

Specified by:
queryElement in class RequestArguments.Argument<T>

jsRefresh

protected java.lang.String jsRefresh(java.lang.String callbackName)
Refresh is supported using standard jQuery change event.

Specified by:
jsRefresh in class RequestArguments.Argument<T>

jsValue

protected java.lang.String jsValue()
Get value is supported by the standard val() jQuery function.

Specified by:
jsValue in class RequestArguments.Argument<T>