|
www.element4solution.com | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecte4s.util.E4Object
e4s.html.E4HtmlObject
e4s.html.E4HtmlElementGeneral
e4s.html.input.list.E4InputList
public abstract class E4InputList
Display a few lines of input data with direct editing possibilities. Support
changing the order of rows, deletion, line numbering, printing.
You need to implement and instanciate a class which is derived from this
class, and define one row of input fields using the #setFields(e4s.html.input.extended.E4InputField_Intf)
function. Then, add this object to your HTML context using the
#add2body(e4s.html.BODY,e4s.servlet.E4ServletImplementation_Intf.
Specify the number of existing (not new) rows using the implemented
getNumRows() function in your class. Some new input rows will be
added additionally, their number can be set using a call to
setNewRows(int).
You should make this object session persistant by using
e4s.servlet.E4ServletImplementation_Intf#setSessionObject(String, Object).
On creation, you can provide a {@link e4s.html.E4Method} method which
will be called.
On the first run, data is queried in your class using the overridden method
{@link #setValue(int, e4s.html.input.extended.E4Fieldset}. This function will
be called for every input row, starting at 0. To save the values after the
user clicks the save button, your class will be called by the function
{@link #saveRow(int, boolean, e4s.html.input.extended.E4Fieldset)}.
{@tutorial Example_E4InputList}
| Field Summary | |
|---|---|
static int |
_SORTING_ALL
|
static int |
_SORTING_NON_EMPTY_ROWS_ONLY
|
static int |
_SORTING_NONE
|
static java.lang.String |
JS_NAME_SAVE
|
static E4InputFieldName |
PARAM_SESS_OBJ
|
| 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 | |
|---|---|
E4InputList()
Constructor for the E4InputList element unsing a default method implementation. |
|
E4InputList(E4Method mref_update)
Constructor for the E4InputList element. |
|
| Method Summary | |
|---|---|
static java.lang.String |
_getSVNVersionString()
Get version info string from subversion. |
void |
add2body(BODY body,
E4ServletImplementation_Intf servlet)
This function adds the input-list element to the body and (if printing is active) calls the printer dialog. |
protected void |
addRowPrinting(TR tr,
int n,
E4ServletImplementation_Intf servlet)
|
E4InputField_Intf |
beforeDisplay(int row,
E4InputFieldName_Intf fieldname,
E4InputField_Intf field)
Is called before a field is displayed in the form. |
protected E4InputFieldName |
changeName(E4InputFieldName_Intf fieldname,
int n)
|
void |
collectScripts(E4ScriptsVec vec,
E4ServletImplementation_Intf servlet)
Collect the scripts required. |
void |
collectStylesForEditing(E4StylesHash v,
E4ServletImplementation_Intf servlet)
Build a list (Vector) with style definitions used so far during display of this page. |
void |
collectTranslationsForEditing(E4TranslationsVec v,
E4ServletImplementation_Intf servlet)
Collect the scripts required. |
E4HtmlElement_Intf |
finishedSavingValues()
This function is called after the last call to {@link #saveRow(int,boolean,e4s.html.input.extended.E4Fieldset) to refresh the data by the instanciating method. |
Align |
getAlign(int column,
E4InputField_Intf field)
|
E4Label_Intf |
getCaption()
Get the caption for the data components. |
boolean |
getEnableDelete()
|
boolean |
getEnablePrinting()
Is printing enabled? |
boolean |
getEnableSorting()
|
E4InputField_Intf[] |
getFields()
Get the fields defined for this E4InputList. |
E4Color |
getHighlightColor()
Get the color for row highlighting. |
int |
getNewRows()
Get the number of new rows to be appended after existing rows. |
abstract int |
getNumRows()
Get the initial number of rows. |
java.lang.String |
getObjectID()
Get a session object, by default this will be the class name, which will not work when your application uses different objects of this class - so it is recommended that you will implement this function in yout instance. |
int |
getPageSize()
Get the number of rows displayed per page. |
E4CgiParams |
getParameters()
Get the parameters once stored using #processParams(e4s.html.E4CgiParams). |
boolean |
getShowRowCount()
|
STYLE_Name |
getStyleHeader()
|
STYLE_Name |
getStyleTable()
|
boolean |
isPrinting()
Get the current display mode. |
boolean |
isValidated()
|
boolean |
processParams(E4CgiParams params,
E4ServletImplementation_Intf servlet)
Process teh parameters (input values and internal navigation and controlling stuff). |
abstract void |
saveRow(int row,
boolean deleted,
E4Fieldset fieldset)
Saves the changed value on save. |
void |
setCaption(E4Label_Intf caption)
Set the caption for the horizontal data components. |
void |
setCaption(java.lang.String caption)
Set the caption for the data components. |
void |
setEnableDelete(boolean delete)
|
void |
setEnablePrinting(boolean mode)
Enable printing. |
void |
setEnableSorting(boolean sorting)
Deprecated. |
void |
setEnableSorting(int sorting)
Define if sorting will be possible or not. |
void |
setField(E4InputField_Intf field)
Add a field to the representation of a row. |
void |
setFields(E4Fieldset fieldset)
Define the data fields for one representative row. |
void |
setFields(E4InputField_Intf[] fields)
Define the data fields for one representative row. |
void |
setHighlightColor(E4Color color)
Set the color for row highlighting. |
void |
setNewRows(int newrows)
Set the number of new rows to be appended after existing rows. |
void |
setPageSize(int pagesize)
Set the number of rows displayed per page. |
abstract void |
setRow(int row,
E4Fieldset fieldset)
Set the initial values of the fields. |
void |
setShowRowCount(boolean show)
|
void |
setStyleHeader(STYLE_Name m_style_header)
|
void |
setStyleTable(STYLE_Name m_style_table)
|
void |
swapIndex(int a,
int b,
E4CgiParams params)
This function is called when sorting is enabled and the user selects a up/down arrow. |
void |
toHtml(E4StringBufferHtml buf,
E4ServletImplementation_Intf servlet)
Render this object. |
boolean |
validateRow(int row,
E4Fieldset fieldset)
|
| Methods inherited from class e4s.html.E4HtmlObject |
|---|
E4ID, 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, 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, toString, 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 |
| Methods inherited from interface e4s.html.E4HtmlElement_Intf |
|---|
addScript, addScript, addScript, debugToString, findElement, findElement, getElements, getElementsVec, getField, getId, getStringContent, isContentClass, removeAll, removeElementById, removeElements, set_e4sID, setId, setReadOnly, setValue, toHtml_hidden, validate |
| Field Detail |
|---|
public static final int _SORTING_NONE
setEnableSorting(int),
_SORTING_ALL,
_SORTING_NON_EMPTY_ROWS_ONLY,
Constant Field Valuespublic static final int _SORTING_ALL
setEnableSorting(int),
_SORTING_NONE,
_SORTING_NON_EMPTY_ROWS_ONLY,
Constant Field Valuespublic static final int _SORTING_NON_EMPTY_ROWS_ONLY
setEnableSorting(int),
_SORTING_NONE,
_SORTING_ALL,
Constant Field Valuespublic static final E4InputFieldName PARAM_SESS_OBJ
public static final java.lang.String JS_NAME_SAVE
| Constructor Detail |
|---|
public E4InputList(E4Method mref_update)
mref_update - a method, should call #processParams(e4s.html.E4CgiParams)
and add2body(e4s.html.BODY, e4s.servlet.E4ServletImplementation_Intf).E4InputList()public E4InputList()
E4InputList(e4s.html.E4Method),
E4ModuleListHandling.processE4InputList| Method Detail |
|---|
public abstract int getNumRows()
throws java.lang.Exception
setPageSize(int).
java.lang.ExceptionsetNewRows(int),
setPageSize(int),
setRow(int,e4s.html.input.extended.E4Fieldset),
setFields(e4s.html.input.extended.E4Fieldset),
saveRow(int,boolean,e4s.html.input.extended.E4Fieldset)
public abstract void setRow(int row,
E4Fieldset fieldset)
throws java.lang.Exception
row - the current row, starting with 0 and less than
getNumRows() + getNewRows(). Data of the row
might also be empty.fieldset - a fieldset containing the form input elements with the basically
names specified, even if the form using different names.
java.lang.ExceptiongetNumRows(),
setFields(e4s.html.input.extended.E4Fieldset),
saveRow(int,boolean,e4s.html.input.extended.E4Fieldset)
public abstract void saveRow(int row,
boolean deleted,
E4Fieldset fieldset)
throws java.lang.Exception
row - the current row, starting with 0 and less than
getNumRows() + getNewRows(). Data of the row
might also be empty.deleted - true means, that this row has been deleted (if deletion is
supported setEnableDelete(boolean).fieldset - a fieldset containing the form input elements with the basically
names specified, even if the form using different names.
java.lang.ExceptiongetNumRows(),
setFields(e4s.html.input.extended.E4Fieldset),
setRow(int,e4s.html.input.extended.E4Fieldset)
public E4HtmlElement_Intf finishedSavingValues()
throws java.lang.Exception
java.lang.ExceptionsaveRow(int,boolean,e4s.html.input.extended.E4Fieldset)public void setFields(E4InputField_Intf[] fields)
setRow(int, e4s.html.input.extended.E4Fieldset).
Each field will get a unique name while rolled out to the different input rows.
fields - an array of fields, each representing a column in the input tablegetFields(),
setFields(e4s.html.input.extended.E4Fieldset)public void setFields(E4Fieldset fieldset)
setRow(int, e4s.html.input.extended.E4Fieldset).
Each field will get a unique name while rolled out to the different input rows.
fieldset - contains the fields (one row only)getFields(),
#setFields(e4s.html.input.extended.E4InputField_Intf)public void setField(E4InputField_Intf field)
setFields(e4s.html.input.extended.E4Fieldset),
setFields(e4s.html.input.extended.E4InputField_Intf[])public boolean getEnableSorting()
public boolean getEnableDelete()
public void setEnableSorting(int sorting)
swapIndex(int, int, e4s.html.E4CgiParams) will
be called.
sorting - a value of _SORTING_NONE disables sorting, a value of _SORTING_ALL enables sorting for all (including empty) rows
and a value of _SORTING_NON_EMPTY_ROWS_ONLY only for rows that do have data._SORTING_ALL,
_SORTING_NON_EMPTY_ROWS_ONLY,
_SORTING_NONE,
getEnableSorting(),
swapIndex(int, int, e4s.html.E4CgiParams)public void setEnableSorting(boolean sorting)
setEnableSorting(int)public void setEnableDelete(boolean delete)
public boolean getShowRowCount()
public void setShowRowCount(boolean show)
public void toHtml(E4StringBufferHtml buf,
E4ServletImplementation_Intf servlet)
throws java.lang.Exception
toHtml in interface E4HtmlElement_IntftoHtml in class E4HtmlElementGeneralservlet - the servlet context.
java.lang.Exception
public void collectScripts(E4ScriptsVec vec,
E4ServletImplementation_Intf servlet)
collectScripts in interface E4HtmlElement_IntfcollectScripts in class E4HtmlElementGeneralvec - collect the names of all scriptsservlet - the servlet contextE4JavaScript
public void collectTranslationsForEditing(E4TranslationsVec v,
E4ServletImplementation_Intf servlet)
collectTranslationsForEditing in interface E4HtmlElement_IntfcollectTranslationsForEditing in class E4HtmlElementGeneralv - the Vector where the styles will be collected, may not be nullservlet - the current servlet instanceE4Label_Intf
public void collectStylesForEditing(E4StylesHash v,
E4ServletImplementation_Intf servlet)
E4HtmlElementGeneralE4StyleUsage.
collectStylesForEditing in interface E4HtmlElement_IntfcollectStylesForEditing in class E4HtmlElementGeneralv - the Vector where the styles will be collected, may not be nullservlet - the servlet contextE4ServletImplementation_Intf.sessionCanEditStyles(),
#collectStylesForEditing(e4s.html.style.E4StylesHash, STYLE_Name, boolean)
public boolean processParams(E4CgiParams params,
E4ServletImplementation_Intf servlet)
throws java.lang.Exception
params - the parameters received in the E4Method call
java.lang.Exceptionadd2body(e4s.html.BODY, e4s.servlet.E4ServletImplementation_Intf),
getParameters()
public void swapIndex(int a,
int b,
E4CgiParams params)
a - first indexb - second index (!= a)params - the current parameters needed to be passed throught to change the values of the input fieldssetEnableSorting(int),
getEnableSorting()
public void add2body(BODY body,
E4ServletImplementation_Intf servlet)
body - the above body element where this grid shall be added.#processParams(e4s.html.E4CgiParams)
public boolean validateRow(int row,
E4Fieldset fieldset)
protected void addRowPrinting(TR tr,
int n,
E4ServletImplementation_Intf servlet)
throws java.lang.Exception
java.lang.Exception
public Align getAlign(int column,
E4InputField_Intf field)
public E4InputField_Intf beforeDisplay(int row,
E4InputFieldName_Intf fieldname,
E4InputField_Intf field)
row - the current row (0 < row <= getNumRows() + getNewRows())fieldname - the name of the field as defined in setField(e4s.html.input.extended.E4InputField_Intf), this is not the current name of the fieldfield - the current field
protected E4InputFieldName changeName(E4InputFieldName_Intf fieldname,
int n)
public STYLE_Name getStyleHeader()
public void setStyleHeader(STYLE_Name m_style_header)
public STYLE_Name getStyleTable()
public void setStyleTable(STYLE_Name m_style_table)
public int getNewRows()
setNewRows(int),
getNumRows()public void setNewRows(int newrows)
newrows - greqter or equal than 0, the default value is 3getNewRows(),
getNumRows()public E4Color getHighlightColor()
TR.getHighlightColor(),
setHighlightColor(e4s.html.E4Color)public void setHighlightColor(E4Color color)
color - the color or null if no highlighting is wantedTR.setHighlightColor(e4s.html.E4Color),
getHighlightColor()public void setEnablePrinting(boolean mode)
mode - true, if printing is enabledgetEnablePrinting(),
isPrinting()public boolean getEnablePrinting()
setEnablePrinting(boolean),
isPrinting()public boolean isPrinting()
setEnablePrinting(boolean),
getEnablePrinting()public void setPageSize(int pagesize)
pagesize - the pagesize, -1 (default) disables paginggetPageSize()public int getPageSize()
setPageSize(int)public java.lang.String getObjectID()
getObjectID in interface E4ClientObject_IntfgetObjectID in interface E4SessionObject_Intfpublic void setCaption(E4Label_Intf caption)
caption - the caption_horizontal to setgetCaption(),
setCaption(String),
setCaption(e4s.translate.E4Label_Intf)public void setCaption(java.lang.String caption)
caption - the caption to be setgetCaption(),
setCaption(e4s.translate.E4Label_Intf),
setCaption(String)public E4Label_Intf getCaption()
setCaption(String),
setCaption(e4s.translate.E4Label_Intf)public E4CgiParams getParameters()
#processParams(e4s.html.E4CgiParams).
public E4InputField_Intf[] getFields()
#setFields(e4s.html.input.extended.E4InputField_Intf),
setFields(e4s.html.input.extended.E4Fieldset)public boolean isValidated()
public static java.lang.String _getSVNVersionString()
E4Util.getRevisionCodeFromSVN(Class)
|
www.element4solution.com | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||