www.element4solution.com

e4s.html.input.extended
Class E4InputField

java.lang.Object
  extended by e4s.util.E4Object
      extended by e4s.html.E4HtmlObject
          extended by e4s.html.E4HtmlElementGeneral
              extended by e4s.html.input.extended.E4FieldsetLayout
                  extended by e4s.html.input.extended.E4InputField
Direct Known Subclasses:
CHECKBOX, CONSTANTFIELD, DATEFIELD, E4InputMultiState, E4InputMultiValue, FLOATFIELD, HIDDENFIELD, LONGFIELD, SELECT, TEXTFIELD

public abstract class E4InputField
extends E4FieldsetLayout

Base class for all input fields.

Since:
JDK 1.4
See Also:
TEXTFIELD, TEXTAREA, FLOATFIELD, LONGFIELD, IMAGEFIELD, DATEFIELD, CHECKBOX, HIDDENFIELD, PASSWORDFIELD, SELECT

Nested Class Summary
protected  class E4InputField.A_PICK
           
 
Field Summary
static java.lang.String BGCOLOR_READONLY
           
static java.lang.String HTML_TAG
           
 java.lang.String m_helpid
           
protected  E4Label_Intf m_label
           
protected  int m_multiple_tablerows_id
           
protected  E4InputFieldName_Intf m_name
           
protected  E4MethodPickup m_pickup_ref
           
protected  boolean m_readonly
           
protected  boolean m_show_label
           
protected  STYLE_Name m_style_active
           
protected  STYLE_Name m_style_inactive
           
 AEP_ValidationObject_Intf m_validation_object
           
 E4Label_Intf m_validationmessage
           
protected  java.lang.String m_value
           
protected  boolean m_visible
           
protected static java.lang.String ms_help_image
           
static java.lang.String PICKUP_IMAGE_NAME_PREFIX
          Prefix for the <IMG>-Tag used in the pickup list to identify the image.
 
Fields inherited from class e4s.html.E4HtmlElementGeneral
m_elements, m_needed_scripts
 
Fields inherited from class e4s.html.E4HtmlObject
m_parent_e4sID
 
Fields inherited from class e4s.util.E4Object
CRLF, E4S_CORE_SYSTEM_LANGUAGE, NBSP, NULLSTR, URL_ENCODING_CHARSET
 
Constructor Summary
  E4InputField(E4ID parent_id)
           
  E4InputField(E4ID parent_id, E4InputFieldName_Intf name)
           
  E4InputField(E4ID parent_id, E4InputFieldName_Intf name, E4Label_Intf label)
           
  E4InputField(E4ID parent_id, E4InputFieldName_Intf name, java.lang.String label)
           
protected E4InputField(E4InputField field)
           
 
Method Summary
static java.lang.String _getSVNVersionString()
          Get version info string from subversion.
 void addElement(E4HtmlElement_Intf element)
          Adds an element to the internal Vector.
protected  void AppendValidationE4Message(Language lang_dest, E4StringBufferHtml buf)
           
 void changeColumnName(E4InputFieldName_Intf name)
          Change the name for the input field.
 void collectStylesForEditing(E4StylesHash v, E4ServletImplementation_Intf servlet)
          Internal use only - collect all style elements of this and sun elements.
 void collectTranslationsForEditing(E4TranslationsVec translations, E4ServletImplementation_Intf servlet)
          Build a list (Vector) with translation texts used so far during display of this page.
 java.lang.String debugToString(int level)
          For debug reasons only.
 A_FORM definePickupList(E4MethodPickup mref)
          Defines a pickup list.
 A_FORM definePickupList(E4MethodPickup mref, boolean add)
          Defines a pickup list.
 A_FORM definePickupList(E4MethodPickup mref, boolean add, E4JavaScript js_notify)
          Defines a pickup list.
protected  A_FORM definePickupList(E4MethodPickup mref, E4InputFieldName_Intf columnname)
          Defines a pickup list.
protected  A_FORM definePickupList(E4MethodPickup mref, E4InputFieldName_Intf columnname, boolean add)
          Defines a pickup list.
protected  A_FORM definePickupList(E4MethodPickup mref, E4InputFieldName_Intf columnname, boolean add, E4JavaScript js_notify)
          Defines a pickup list.
 A_FORM definePickupList(E4MethodPickup mref, E4JavaScript js_notify)
          Defines a pickup list.
 boolean display_simpleReport()
          Deprecated.  
 E4ID E4ID()
          Get the E4ID of the object.
 boolean equalsIgnoreCase(E4InputFieldName_Intf name)
          Test, if this fieldname equals the specified name.
 java.lang.StringBuffer eventHandlers()
           
 boolean getCanChangeLayout()
           
 E4InputFieldName_Intf getColumnName()
          Get the name of the input field.
 E4Label_Intf getErrorMessage()
          Get the error message for the field.
 E4HashEventHandler getEventHandlers()
           
 java.lang.String getHelpId()
           
 java.lang.String getHtmlParamName()
          Get the name of the input field as to be used (and visible) in a FORM element.
 E4Label_Intf getLabel()
           
 int getMultipleTablerowsId()
          Get the marks-up the name of the field, in the case that there are the same input fields in several table rows.
static E4PersistantRepository getPersistant(E4ServletImplementation_Intf servlet)
           
static E4FieldsetPersistantLayout getPersistantLayout(E4ServletImplementation_Intf servlet, java.lang.String helpid)
           
 E4MethodPickup getPickupList()
          Get the Definition for a pickup list.
 boolean getReadOnly()
          Get the read-only state of a field
 STYLE_Name getSTYLE()
          Get the active style.
 STYLE_Name getSTYLE(boolean active)
          Get the style.
 AEP_ValidationObject_Intf getValidator()
          Gets a validator for this input element.
 java.lang.String getValue_native()
           
 void hideLabel()
           
static java.lang.String HtmlEncode(java.lang.String s)
          Change characters like Ä into Ä
 boolean isHiddenField()
          Is this a hidden field ?
 boolean isMandatory()
          Check, if this input field requires a mandatory value.
 boolean isVisible()
          Get the visibility status.
 E4EventHandlerInputField onChange()
          Define an unnamed input handler (Java-Script) that is called when the value of the field changes.
 void onChange(E4ServletImplementation_Intf servlet, E4Method mref)
          Define an input handler that calls a method, the value of the field is handled as parameter using the field's name getHtmlParamName().
 E4EventHandlerInputField onChange(java.lang.String js_name)
          Define a named input handler (Java-Script) that is called when the value of the field changes.
 E4EventHandlerInputField onClick()
          Create an input handler that is activated by the E4JavaScript command onClick in the input field tag.
 void removePickupList()
           
 void resetValidation()
          Clears any previous defined validation.
 void setCanChangeLayout(boolean mode)
           
 void setErrorMessage(E4Label_Intf error)
          Set the error message for the field.
 void setErrorMessage(java.lang.String error)
          Set the error message for the field.
 void setEventHandler(E4EventHandlerInputField handler)
           
 void setHelpId(java.lang.String helpid)
           
static void setHelpImage(java.lang.String helpimage)
           
 void setLabel(E4Label_Intf label)
           
 void setMultipleTablerowsId(int row)
          This marks-up the name of the field, in the case that there are the same input fields in several table rows.
 void setReadOnly()
          Sets the read-only state of a field to read-only.
 void setReadOnly(boolean readonly)
          Toggle the read-only state of a field
 void setReadOnly(E4Permission perm, E4ApplObj_Intf applobj)
          Toggle the read-only state of a field if the permission is not set.
 void setSTYLE(CLASS_Name class_name)
          Set the style for the input field.
 void setSTYLE(CLASS_Name class_name_active, CLASS_Name class_name_inactive)
          Set the style for the input field.
 void setValidation(AEP_ValidationObject_Intf validationObj)
          Deprecated.  
 void setValidator(AEP_ValidationObject_Intf validationObj)
          Sets a validator for this input element.
 void setValue(boolean value)
           
 void setValue(char value)
           
 void setValue(java.util.Date value)
          Never call this function, use setValue(java.util.Date, String) instead, this function is only intended for completeness of the classes that implement vanE4InputField_Intf and is supported by real Date input classes only.
 void setValue(E4CgiParams params)
          Look in the parameter list, and if the HTML-fieldname matches one of the parameters, assign it as String.
 void setValue(E4Long value)
           
 void setValue(E4String value)
           
 void setValue(float value)
           
 void setValue(int value)
           
 void setValue(Language dest_lang, E4Label_Intf value)
           
 void setValue(long value)
           
 void setValue(java.lang.String value)
           
 void setVisible(boolean visible)
          Normal, a field which is defined for display can be set to the visible state, which means that it is not displayed and treatened similar to a HIDDENFIELD.
 HIDDENFIELD toHIDDENFIELD()
          Convert this field to a HIDDENFIELD.
 void toHtml_drawSimpleReport(E4StringBufferHtml buf, E4ServletImplementation_Intf servlet)
          This function is intended for simple output only
 void toHtml_drawSimpleReport(E4StringBufferHtml buf, E4ServletImplementation_Intf servlet, boolean printing)
           
 void toHtml_drawSimpleReport(E4StringBufferHtml buf, E4ServletImplementation_Intf servlet, java.lang.String value, boolean printing)
          This function is intended for simple output only
 void toHtml_hidden(E4StringBufferHtml buf, E4ServletImplementation_Intf context)
           
 void toHtml(E4StringBufferHtml buf, E4ServletImplementation_Intf servlet, java.lang.String formelement)
           
 java.lang.String toString()
           
static void updatePersistantLayout(E4ServletImplementation_Intf servlet, E4FieldsetPersistantLayout layout)
           
 boolean validate()
          If a validation function is declared, then it is called and any String result returning from this validation function indicates that something with the field went wrong, and the return value will be false.
 boolean validate(char mode, E4Fieldset fieldset)
           
 boolean validate(E4CgiParams params, E4ServletImplementation_Intf servlet)
          Set the parameters specified and validate.
 
Methods inherited from class e4s.html.input.extended.E4FieldsetLayout
isNextRow, layoutToNextRow
 
Methods inherited from class e4s.html.E4HtmlElementGeneral
addScript, addScript, addScript, addStyleForEditing, addTranslationForEditing, buildStyleAttribute, buildStyleClassReference, collectScripts, collectStylesForEditing, collectStylesForEditing, collectTranslationsForEditing, createScript, createScript, findElement, findElement, findElement, findElement, getElements, getElementsVec, getField, getId, getLastElement, getStringContent, getStyle, getStyle, hasScripts, hasSTYLE, isContentClass, isE4InputField_Intf, openTag, removeAll, removeElementById, removeElements, removeElements, removeStyle, setId, setStyle, setStyle, setSTYLE, Style, Style, toHtml
 
Methods inherited from class e4s.html.E4HtmlObject
E4ID, set_e4sID
 
Methods inherited from class e4s.util.E4Object
Calendar, CName, CName, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelSys, E4LabelSys, e4sCopyright, e4sVersion, encode, encode, encode, encodeHtml, encodeHtml, encodeHtml, encodeURL, encodeURL, encodeURL, finalize, getLINE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTraceMemory, HtmlEncode, HtmlEncode, isdecimal, isdigit, isnotok, isnotok, isnumeric, isok, isok, isok, isok, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingStack, mkdirs, null2nbsp, null2nbsp, null2nbsp, ok, ok, ok, ok, outPrintln, setLogFile4Trace, setTraceMemory, STACKTRACE, toDebug, toDouble, toFloat, toFloat, TRACE_CALLS, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, wait
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BGCOLOR_READONLY

public static java.lang.String BGCOLOR_READONLY

m_name

protected E4InputFieldName_Intf m_name

m_label

protected E4Label_Intf m_label

m_value

protected java.lang.String m_value

m_validationmessage

public E4Label_Intf m_validationmessage

m_validation_object

public AEP_ValidationObject_Intf m_validation_object

m_multiple_tablerows_id

protected int m_multiple_tablerows_id

m_readonly

protected boolean m_readonly

m_visible

protected boolean m_visible

m_helpid

public java.lang.String m_helpid

m_pickup_ref

protected E4MethodPickup m_pickup_ref

m_show_label

protected boolean m_show_label

m_style_active

protected STYLE_Name m_style_active

m_style_inactive

protected STYLE_Name m_style_inactive

ms_help_image

protected static java.lang.String ms_help_image

PICKUP_IMAGE_NAME_PREFIX

public static final java.lang.String PICKUP_IMAGE_NAME_PREFIX
Prefix for the <IMG>-Tag used in the pickup list to identify the image.

See Also:
Constant Field Values

HTML_TAG

public static final java.lang.String HTML_TAG
See Also:
Constant Field Values
Constructor Detail

E4InputField

protected E4InputField(E4InputField field)

E4InputField

public E4InputField(E4ID parent_id)

E4InputField

public E4InputField(E4ID parent_id,
                    E4InputFieldName_Intf name,
                    java.lang.String label)

E4InputField

public E4InputField(E4ID parent_id,
                    E4InputFieldName_Intf name,
                    E4Label_Intf label)

E4InputField

public E4InputField(E4ID parent_id,
                    E4InputFieldName_Intf name)
Method Detail

getPersistant

public static E4PersistantRepository getPersistant(E4ServletImplementation_Intf servlet)
                                            throws java.io.IOException
Throws:
java.io.IOException

getPersistantLayout

public static E4FieldsetPersistantLayout getPersistantLayout(E4ServletImplementation_Intf servlet,
                                                             java.lang.String helpid)
                                                      throws java.io.IOException
Throws:
java.io.IOException

updatePersistantLayout

public static void updatePersistantLayout(E4ServletImplementation_Intf servlet,
                                          E4FieldsetPersistantLayout layout)
                                   throws java.io.IOException
Throws:
java.io.IOException

setHelpImage

public static void setHelpImage(java.lang.String helpimage)

setHelpId

public void setHelpId(java.lang.String helpid)

hideLabel

public void hideLabel()

getHelpId

public java.lang.String getHelpId()

getColumnName

public E4InputFieldName_Intf getColumnName()
Get the name of the input field.

See Also:
getHtmlParamName(), changeColumnName(e4s.html.input.extended.E4InputFieldName_Intf)

getHtmlParamName

public java.lang.String getHtmlParamName()
Get the name of the input field as to be used (and visible) in a FORM element. The difference is on DATEFIELD where the name in the context includes a flag for the date format.

See Also:
getHtmlParamName(), changeColumnName(e4s.html.input.extended.E4InputFieldName_Intf)

getLabel

public E4Label_Intf getLabel()

setLabel

public void setLabel(E4Label_Intf label)

getValue_native

public java.lang.String getValue_native()

setValue

public void setValue(java.lang.String value)

setValue

public void setValue(E4String value)

setValue

public void setValue(E4Long value)

setValue

public void setValue(Language dest_lang,
                     E4Label_Intf value)

setValue

public void setValue(E4CgiParams params)
Look in the parameter list, and if the HTML-fieldname matches one of the parameters, assign it as String. Dangerous for Date, long, boolean input elements which should implement their own version including necessary conversions.

Overrides:
setValue in class E4HtmlElementGeneral
Parameters:
params - the whole parameter list
See Also:
E4InputField_Intf.setValue(e4s.html.E4CgiParams), #validate(e4s.html.E4CgiParams)

setValue

public void setValue(java.util.Date value)
              throws java.lang.Exception
Never call this function, use setValue(java.util.Date, String) instead, this function is only intended for completeness of the classes that implement vanE4InputField_Intf and is supported by real Date input classes only.

Throws:
java.lang.Exception

setValue

public void setValue(boolean value)

setValue

public void setValue(long value)

setValue

public void setValue(int value)

setValue

public void setValue(float value)

setValue

public void setValue(char value)

getErrorMessage

public E4Label_Intf getErrorMessage()
Get the error message for the field. Each field can handle it's own error message, caused by a validation.

Returns:
return the error message
See Also:
#setValidation(Object,String), setErrorMessage(String), setErrorMessage(E4Label_Intf), validate()

setErrorMessage

public void setErrorMessage(E4Label_Intf error)
Set the error message for the field. Each field can handle it's own error message, caused by a validation.

Parameters:
error - the String for the error message. A value of null resets the error message.
See Also:
getErrorMessage(), #setValidation(Object,String), validate(), setErrorMessage(String)

setErrorMessage

public void setErrorMessage(java.lang.String error)
Set the error message for the field. Each field can handle it's own error message, caused by a validation. Same as setErrorMessage(new Label_Sys(String)).

Parameters:
error - the String for the error message. A value of null resets the error message.
See Also:
getErrorMessage(), #setValidation(Object,String), validate(), setErrorMessage(e4s.translate.E4Label_Intf)

toHtml

public void toHtml(E4StringBufferHtml buf,
                   E4ServletImplementation_Intf servlet,
                   java.lang.String formelement)
            throws java.lang.Exception
Throws:
java.lang.Exception

AppendValidationE4Message

protected void AppendValidationE4Message(Language lang_dest,
                                         E4StringBufferHtml buf)

toHtml_hidden

public void toHtml_hidden(E4StringBufferHtml buf,
                          E4ServletImplementation_Intf context)
                   throws java.lang.Exception
Overrides:
toHtml_hidden in class E4HtmlElementGeneral
Throws:
java.lang.Exception

toHtml_drawSimpleReport

public void toHtml_drawSimpleReport(E4StringBufferHtml buf,
                                    E4ServletImplementation_Intf servlet)
                             throws java.lang.Exception
This function is intended for simple output only

Throws:
java.lang.Exception

toHtml_drawSimpleReport

public void toHtml_drawSimpleReport(E4StringBufferHtml buf,
                                    E4ServletImplementation_Intf servlet,
                                    boolean printing)
                             throws java.lang.Exception
Throws:
java.lang.Exception

toHtml_drawSimpleReport

public void toHtml_drawSimpleReport(E4StringBufferHtml buf,
                                    E4ServletImplementation_Intf servlet,
                                    java.lang.String value,
                                    boolean printing)
                             throws java.lang.Exception
This function is intended for simple output only

Throws:
java.lang.Exception

validate

public boolean validate(E4CgiParams params,
                        E4ServletImplementation_Intf servlet)
                 throws java.lang.Exception
Set the parameters specified and validate. Note that this also will change the current value of the field.

Overrides:
validate in class E4HtmlElementGeneral
Parameters:
params - the current cgi parameters
Returns:
true, if all defined validations will return true. false, if at least one validation returns false. Note, that in any case all validations must be performed to set the fields error-messages.
Throws:
java.lang.Exception
See Also:
validate(), e4s.html.E4HtmlElementGeneral#validate(e4s.html.E4CgiParams)

validate

public boolean validate()
                 throws java.lang.Exception
If a validation function is declared, then it is called and any String result returning from this validation function indicates that something with the field went wrong, and the return value will be false. This indication is stored in the m_validationmessage variable for further use. Only visible fields are validated (see isVisible()).

Returns:
true, if everything is o.k.
Throws:
java.lang.Exception

validate

public boolean validate(char mode,
                        E4Fieldset fieldset)
                 throws java.lang.Exception
Throws:
java.lang.Exception

setValidation

public void setValidation(AEP_ValidationObject_Intf validationObj)
Deprecated. 

See Also:
setValidator(e4s.html.input.extended.AEP_ValidationObject_Intf)

setValidator

public void setValidator(AEP_ValidationObject_Intf validationObj)
Sets a validator for this input element. The validator is executed when the validate() function is called and returns either null or a message causing the validation violation.

See Also:
validate(), getValidator(), e4s.html.input.extended.E4Fieldset#validate()

getValidator

public AEP_ValidationObject_Intf getValidator()
Gets a validator for this input element. The validator is executed when the validate() function is called and returns either null or a message causing the validation violation.

See Also:
validate(), setValidator(e4s.html.input.extended.AEP_ValidationObject_Intf), e4s.html.input.extended.E4Fieldset#validate()

isMandatory

public boolean isMandatory()
Check, if this input field requires a mandatory value. This means, that the user must type a value and there will be a special markup within the field's label. This requires a validation object to be defined, using setValidator(e4s.html.input.extended.AEP_ValidationObject_Intf)).

See Also:
AEP_ValidationObject_Intf.isMandatory(), setValidator(e4s.html.input.extended.AEP_ValidationObject_Intf)

resetValidation

public void resetValidation()
Clears any previous defined validation.

See Also:
setValidator(e4s.html.input.extended.AEP_ValidationObject_Intf)

setMultipleTablerowsId

public void setMultipleTablerowsId(int row)
This marks-up the name of the field, in the case that there are the same input fields in several table rows. Default == -1, which means that there can only be one row and each fieldname must be unique within the whole input form.


getMultipleTablerowsId

public int getMultipleTablerowsId()
Get the marks-up the name of the field, in the case that there are the same input fields in several table rows. Default == -1, which means that there can only be one row and each fieldname must be unique within the whole input form.


setReadOnly

public void setReadOnly(E4Permission perm,
                        E4ApplObj_Intf applobj)
                 throws java.lang.Exception
Toggle the read-only state of a field if the permission is not set.

Parameters:
permission - the permission to be checked
applobj - an application object, {@link e4s.servlet.E4ModuleImplementation#getApplObj()}
Throws:
java.lang.Exception
See Also:
getReadOnly(), setReadOnly(boolean), setReadOnly()

setReadOnly

public void setReadOnly(boolean readonly)
Toggle the read-only state of a field

Overrides:
setReadOnly in class E4HtmlElementGeneral
Parameters:
readonly - (true = readonly, false = input possible)
See Also:
getReadOnly(), setReadOnly(), setReadOnly(e4s.db.systabledef.E4Permission,e4s.application.E4ApplObj_Intf)

setReadOnly

public void setReadOnly()
Sets the read-only state of a field to read-only.

See Also:
getReadOnly(), setReadOnly(boolean)

getReadOnly

public boolean getReadOnly()
Get the read-only state of a field

Returns:
the readonly state (true = readonly, false = input possible)
See Also:
setReadOnly(boolean)

display_simpleReport

public boolean display_simpleReport()
Deprecated. 

See Also:
./ public boolean getDisplayOnly() { return getReadOnly(); }

toString

public java.lang.String toString()
Overrides:
toString in class E4Object

definePickupList

protected A_FORM definePickupList(E4MethodPickup mref,
                                  E4InputFieldName_Intf columnname)
Defines a pickup list. A pickup list typical openes in a new window and offers values to be picked. For example a calendar would be a typical pickup implementation. When the user clicks on the value, it is stored into the input field. While the callback functions are running in the pickup mode (that means, that there is a field expecting a value some time), then the E4CgiParams E4Constants.PARAM_ISPICKUP is set to a value of true (1).

Parameters:
mref - Defining the function to be called
columnname - is intended to be used for DATEFIELD, as this fields append their format to the name. E.g. field = "TODAY" coudl result in "TODAY#dd.mm.yyyy"
See Also:
E4Constants.PARAM_ISPICKUP, getPickupList()

definePickupList

protected A_FORM definePickupList(E4MethodPickup mref,
                                  E4InputFieldName_Intf columnname,
                                  boolean add)
Defines a pickup list. A pickup list typical openes in a new window and offers values to be picked. For example a calendar would be a typical pickup implementation. When the user clicks on the value, it is stored into the input field. While the callback functions are running in the pickup mode (that means, that there is a field expecting a value some time), then the E4CgiParams E4Constants.PARAM_ISPICKUP is set to a value of true (1).

Parameters:
mref - Defining the function to be called
columnname - is intended to be used for DATEFIELD, as this fields append their format to the name. E.g. field = "TODAY" coudl result in "TODAY#dd.mm.yyyy"
add - add the pickup element to the field (this value should be set to true)
See Also:
E4Constants.PARAM_ISPICKUP, getPickupList()

removePickupList

public void removePickupList()

definePickupList

protected A_FORM definePickupList(E4MethodPickup mref,
                                  E4InputFieldName_Intf columnname,
                                  boolean add,
                                  E4JavaScript js_notify)
Defines a pickup list. A pickup list typical openes in a new window and offers values to be picked. For example a calendar would be a typical pickup implementation. When the user clicks on the value, it is stored into the input field. While the callback functions are running in the pickup mode (that means, that there is a field expecting a value some time), then the E4CgiParams E4Constants.PARAM_ISPICKUP is set to a value of true (1).

Parameters:
mref - Defining the function to be called
columnname - is intended to be used for DATEFIELD, as this fields append their format to the name. E.g. field = "TODAY" coudl result in "TODAY#dd.mm.yyyy"
add - add the pickup element to the field (this value should be set to true)
js_notify - a script that will be called upon return of the pickup function
See Also:
E4Constants.PARAM_ISPICKUP, getPickupList()

definePickupList

public A_FORM definePickupList(E4MethodPickup mref)
Defines a pickup list. A pickup list typical openes in a new window and offers values to be picked. For example a calendar would be a typical pickup implementation. When the user clicks on the value, it is stored into the input field. While the callback functions are running in the pickup mode (that means, that there is a field expecting a value some time), then the E4CgiParams E4Constants.PARAM_ISPICKUP is set to a value of true (1).

Parameters:
mref - Defining the function to be called
See Also:
E4Constants.PARAM_ISPICKUP, getPickupList()

definePickupList

public A_FORM definePickupList(E4MethodPickup mref,
                               boolean add)
Defines a pickup list. A pickup list typical openes in a new window and offers values to be picked. For example a calendar would be a typical pickup implementation. When the user clicks on the value, it is stored into the input field. While the callback functions are running in the pickup mode (that means, that there is a field expecting a value some time), then the E4CgiParams E4Constants.PARAM_ISPICKUP is set to a value of true (1).

Parameters:
mref - Defining the function to be called
add - add the pickup element to the field (this value should be set to true)
See Also:
E4Constants.PARAM_ISPICKUP, getPickupList()

definePickupList

public A_FORM definePickupList(E4MethodPickup mref,
                               boolean add,
                               E4JavaScript js_notify)
Defines a pickup list. A pickup list typical openes in a new window and offers values to be picked. For example a calendar would be a typical pickup implementation. When the user clicks on the value, it is stored into the input field. While the callback functions are running in the pickup mode (that means, that there is a field expecting a value some time), then the E4CgiParams E4Constants.PARAM_ISPICKUP is set to a value of true (1).

Parameters:
mref - Defining the function to be called
add - add the pickup element to the field (this value should be set to true)
js_notify - a script that will be called upon return of the pickup function
See Also:
E4Constants.PARAM_ISPICKUP, getPickupList()

definePickupList

public A_FORM definePickupList(E4MethodPickup mref,
                               E4JavaScript js_notify)
Defines a pickup list. A pickup list typical openes in a new window and offers values to be picked. For example a calendar would be a typical pickup implementation. When the user clicks on the value, it is stored into the input field. While the callback functions are running in the pickup mode (that means, that there is a field expecting a value some time), then the E4CgiParams E4Constants.PARAM_ISPICKUP is set to a value of true (1).

Parameters:
mref - Defining the function to be called
js_notify - a script that will be called upon return of the pickup function
See Also:
E4Constants.PARAM_ISPICKUP, getPickupList()

getPickupList

public E4MethodPickup getPickupList()
Get the Definition for a pickup list.

Returns:
an object defining the function to be called, or null if no pickup list is defined.
See Also:
definePickupList(e4s.html.E4MethodPickup, e4s.html.input.extended.E4InputFieldName_Intf)

debugToString

public java.lang.String debugToString(int level)
For debug reasons only.

Overrides:
debugToString in class E4HtmlElementGeneral
Parameters:
level - is the nested level
Returns:
printout of the main field parameter

addElement

public void addElement(E4HtmlElement_Intf element)
Adds an element to the internal Vector.

Parameters:
element - the element to be added

isHiddenField

public boolean isHiddenField()
Is this a hidden field ? Normally, returns false - except HIDDENFIELD

Returns:
false

setVisible

public void setVisible(boolean visible)
Normal, a field which is defined for display can be set to the visible state, which means that it is not displayed and treatened similar to a HIDDENFIELD. Different from isHiddenField().

Parameters:
visible - true: display on HTML output
See Also:
isVisible(), isHiddenField()

isVisible

public boolean isVisible()
Get the visibility status.

Returns:
true, if visible
See Also:
setVisible(boolean)

onClick

public E4EventHandlerInputField onClick()
Create an input handler that is activated by the E4JavaScript command onClick in the input field tag.

Returns:
the new created and added handler.

setEventHandler

public void setEventHandler(E4EventHandlerInputField handler)

eventHandlers

public java.lang.StringBuffer eventHandlers()

getEventHandlers

public E4HashEventHandler getEventHandlers()

setCanChangeLayout

public void setCanChangeLayout(boolean mode)

getCanChangeLayout

public boolean getCanChangeLayout()

E4ID

public E4ID E4ID()
Description copied from class: E4HtmlObject
Get the E4ID of the object. The E4ID is a unique identifier for an nested HTML element, it can be either the name of the class or any previous assigned string.

Overrides:
E4ID in class E4HtmlObject
Returns:
the E4ID
See Also:
E4HtmlObject.E4ID(String), E4HtmlObject.set_e4sID(e4s.util.E4ID)

setSTYLE

public void setSTYLE(CLASS_Name class_name_active,
                     CLASS_Name class_name_inactive)
Set the style for the input field. Note, that an input field can be disabled (getReadOnly() and therefore, two styles (classes) are required: one for the active case and one for the in-active (disabled) case.

Parameters:
class_name_active - active (enabled) class
class_name_inactive - inactive (disabled) class
See Also:
setSTYLE( e4s.html.style.CLASS_Name ), getSTYLE()

setSTYLE

public void setSTYLE(CLASS_Name class_name)
Set the style for the input field. Note, that an input field can be disabled (getReadOnly() and therefore, two styles (classes) are required: one for the active case and one for the in-active (disabled) case. This function sets both classes, so disabling the field would make no visual difference for the display GUI.

Parameters:
class_name_active - active (enabled) and inactive (disabled) class
See Also:
setSTYLE( e4s.html.style.CLASS_Name, e4s.html.style.CLASS_Name ), getSTYLE()

getSTYLE

public STYLE_Name getSTYLE(boolean active)
Get the style. Note, that an input field can be disabled (getReadOnly() and therefore, two styles (classes) are required: one for the active case and one for the in-active (disabled) case. This function sets both classes, so disabling the field would make no visual difference for the display GUI.

Parameters:
active - true, to get the style for the active (enabled) status or false to get the style for the inactive (disabled) status.
Returns:
the style (containing the class)
See Also:
setSTYLE(e4s.html.style.CLASS_Name, e4s.html.style.CLASS_Name)

getSTYLE

public STYLE_Name getSTYLE()
Get the active style. Same as getSTYLE(boolean)(true). Note, that an input field can be disabled (getReadOnly() and therefore, two styles (classes) are required: one for the active case and one for the in-active (disabled) case. This function sets both classes, so disabling the field would make no visual difference for the display GUI.

Overrides:
getSTYLE in class E4HtmlElementGeneral
Returns:
the style (containing the class)
See Also:
setSTYLE(e4s.html.style.CLASS_Name, e4s.html.style.CLASS_Name), getSTYLE(boolean)

collectStylesForEditing

public void collectStylesForEditing(E4StylesHash v,
                                    E4ServletImplementation_Intf servlet)
Internal use only - collect all style elements of this and sun elements.

Overrides:
collectStylesForEditing in class E4HtmlElementGeneral
Parameters:
v - the Vector where the styles are collected
See Also:
E4ServletImplementation_Intf.sessionCanEditStyles(), #collectStylesForEditing(e4s.html.style.E4StylesHash, STYLE_Name, boolean)

collectTranslationsForEditing

public void collectTranslationsForEditing(E4TranslationsVec translations,
                                          E4ServletImplementation_Intf servlet)
Description copied from class: E4HtmlElementGeneral
Build a list (Vector) with translation texts used so far during display of this page. Run throught all subclasses elements and collect their texts as well. Note, that a text will only be added one time. The Vector contains elements of class E4Label.

Overrides:
collectTranslationsForEditing in class E4HtmlElementGeneral
Parameters:
translations - the Vector where the styles will be collected, may not be null
servlet - the current servlet instance
See Also:
E4Label_Intf

equalsIgnoreCase

public boolean equalsIgnoreCase(E4InputFieldName_Intf name)
Test, if this fieldname equals the specified name.

Parameters:
name - the name to be checked
Returns:
true, if either the getHtmlParamName() or getColumnName() name matches.

HtmlEncode

public static java.lang.String HtmlEncode(java.lang.String s)
Change characters like Ä into Ä

Parameters:
s - the string which needs to be changed
Returns:
an empty String if s == null or s with replaced characters ../ protected String HtmlEncode( String s ) { String res = ""; if (s != null) { int l = s.length(); for( int i = 0; i < l; i++ ) { char ch = s.charAt(i); switch(ch) { case 'Ü': res += "Ü"; break; case 'Ö': res += "Ö"; break; case 'Ä': res += "Ä"; break; case 'ü': res += "ü"; break; case 'ö': res += "ö"; break; case 'ä': res += "ä"; break; case '&': res += "&"; break; default: res += ch; } } } return res; }

changeColumnName

public void changeColumnName(E4InputFieldName_Intf name)
Change the name for the input field. Normally, a name is assigned during declaration.

See Also:
getHtmlParamName(), getColumnName()

onChange

public E4EventHandlerInputField onChange()
Define an unnamed input handler (Java-Script) that is called when the value of the field changes. The input handler is created and added using setEventHandler(e4s.html.input.extended.E4EventHandlerInputField) using E4EventHandlerInputField._EVENT_ONCHANGE.

Returns:
the created and added input handler.
See Also:
onChange( e4s.servlet.E4ServletImplementation_Intf, e4s.html.E4Method ), onChange( String )

onChange

public E4EventHandlerInputField onChange(java.lang.String js_name)
Define a named input handler (Java-Script) that is called when the value of the field changes. The input handler is created and added using setEventHandler(e4s.html.input.extended.E4EventHandlerInputField) using E4EventHandlerInputField._EVENT_ONCHANGE.

Parameters:
js_name - name of the JavaScript
Returns:
the created and added input handler.
See Also:
onChange( e4s.servlet.E4ServletImplementation_Intf, e4s.html.E4Method ), onChange()

onChange

public void onChange(E4ServletImplementation_Intf servlet,
                     E4Method mref)
Define an input handler that calls a method, the value of the field is handled as parameter using the field's name getHtmlParamName().

Parameters:
servlet - the servlet
mref - the method

toHIDDENFIELD

public HIDDENFIELD toHIDDENFIELD()
Convert this field to a HIDDENFIELD.

Returns:
a new created HIDDENFIELD with the getColumnName() as name and the value of the field.

_getSVNVersionString

public static java.lang.String _getSVNVersionString()
Get version info string from subversion.

Returns:
the version info string.
See Also:
E4Util.getRevisionCodeFromSVN(Class)

www.element4solution.com