www.element4solution.com

e4s.html.input.grid
Class E4Grid

java.lang.Object
  extended by e4s.util.E4Object
      extended by e4s.html.E4HtmlObject
          extended by e4s.html.E4HtmlElementGeneral
              extended by e4s.html.input.grid.E4Grid
All Implemented Interfaces:
E4HtmlElement_Intf, E4ClientObject_Intf, E4SessionObject_Intf

public abstract class E4Grid
extends E4HtmlElementGeneral
implements E4HtmlElement_Intf, E4SessionObject_Intf, E4ClientObject_Intf

This is an abstract elements that enables editing of larger portions of data where vertical and horizontal paging is required. Compared to other elements of E4S (e.g. Tree-Elements) the grid is not a complete implementation, as this is an abstract class, a class extending this grid must implement the missing methods to support data handling, createing input fields and storing values into the database. The function #processParams(e4s.html.E4CgiParams) is required to set all the navigation values of this grid (e.g. the user has branched one page to the right).

Example_Grid.java


Field Summary
static java.lang.String JS_NAME_SETMAP
           
static java.lang.String MAP_PLACEHOLDER
           
static E4InputFieldName PARAM_COL
           
static E4InputFieldName PARAM_GRID_SIZE
           
static java.lang.String PARAM_IS_PRINTING
           
static E4InputFieldName PARAM_ROW
           
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
E4Grid(E4Method mref)
          Construct a E4Grid object with 1 header cell, each vertically and horizontally.
E4Grid(E4Method mref, int numHeaderCols, int numHeaderRows)
          Construct a E4Grid object.
E4Grid(int numHeaderCols, int numHeaderRows)
          Construct a E4Grid object.
 
Method Summary
static java.lang.String _getSVNVersionString()
          Get version info string from subversion.
 void add2body(BODY body, E4ServletImplementation_Intf servlet)
          This function adds the grid element to the body and (if printing is active) calls the printer dialog.
 void addDisplaySize(E4GridSize gs)
          Add a new display layout (size) component the user can select from.
 void addDisplaySize(int width, int height)
          Add a new display layout (size) component the user can select from.
 void addDisplaySizeDefault()
          Add some default sizes.
 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.
 void createdForm(FORM form)
          A good place to add hidden fields to the form just beeing created
static int[] createScaleGaps(int maxIdx, int treshhold, int actualIdx)
          If an interval 0..maxIdx is greater than a specified treshold, then use only the first elements, the last elements, the elements around actualIdx and every 10th element.
 java.lang.String drawCell_Csv(int row, int col)
          Draw a black/white representation of the value (typically, this will be NOT an input field).
abstract  void drawCell_Printer(TD td, int row, int col)
          Draw a black/white representation of the value (typically, this will be NOT an input field).
abstract  void drawCell_Screen(TD td, E4InputFieldName fieldname, int row, int col)
          Draw a cell (typically, this will be an imput field) and set the value of that cell.
 java.lang.String drawFirstGrid_Csv()
           
 void drawFirstGrid_Printer(TD tdDummy)
          Here, output to the first column/row is possible when printing.
 void drawFirstGrid_Screen(TD tdDummy)
          Here, output to the first column/row is possible.
 java.lang.String[] drawHorizontalHeader_Csv(int row)
           
 void drawHorizontalHeader_Printer(TD[] td, int row)
          Draw a header (one or more columns) for the horizontal rows when printing.
abstract  void drawHorizontalHeader_Screen(TD[] td, int row)
          Draw a header (one or more columns) for the horizontal rows.
 java.lang.String[][] drawVerticalHeaders_Csv(int firstCol, int lastCol)
           
 void drawVerticalHeaders_Printer(TR[] tr, int firstCol, int lastCol)
          Draw a header (one or more rows) for the vertical columns when printing.
abstract  void drawVerticalHeaders_Screen(TR[] tr, int firstCol, int lastCol)
          Draw a header (one or more rows) for the vertical columns.
 boolean enableNewWindow()
          Is opening of new windows enabled?
 void enableNewWindow(boolean mode)
          Enable to open a new window printing.
 E4Label_Intf getCaption_horizontal()
          Get the caption for the horizontal data components.
 E4Label_Intf getCaption_vertical()
          Get the caption for the vertical data components.
 int getDisplayCols()
          Get the current display size (number of columns).
 int getDisplayRows()
          Get the current display size (number of rows).
static E4InputFieldName getE4InputFieldName(int row, int col)
          Get an input field name for the cell at specified row/column.
 boolean getEnableExcel()
          Is xcel export enabled?
 boolean getEnablePrinting()
          Is printing enabled?
 int getFirstCol()
          Get the index of the first column (including) currently displayed.
 int getFirstRow()
          Get the index of the first row (including) currently displayed.
 E4Color getLabelColor()
          Get the color for displaying the labels.
 int getLastCol()
          Get the index of the last column (including) currently displayed.
 int getLastRow()
          Get the index of the last row (including) currently displayed.
 E4Color getNavigationColor()
          Get the color for displaying the navigation items.
 int getNumHeaderCols()
          Get the number of header rows.
 int getNumHeaderRows()
          Get the number of header rows.
 java.lang.String getObjectID()
          Get the ID of the Object.
abstract  int horizontalSize()
          Get the horizontal size for this E4Grid.
 boolean isPrinting()
          Get the current display mode.
 boolean isSaving()
          Check, if the saving process with subsequent calls to saveValue(e4s.html.input.extended.E4InputFieldName, e4s.html.E4CgiParams, int, int) is in progress.
 boolean isWindow()
          Get the current window mode.
 boolean openingWindow()
          Get the current window mode.
 void processParams(E4CgiParams params, E4ServletImplementation_Intf servlet)
          Process the parameters to the internal navigation functions.
 void processParams(E4ServletImplementation_Intf servlet)
          Deprecated.  
 void saveFinished(E4ServletImplementation_Intf servlet)
           
abstract  boolean saveValue(E4InputFieldName fieldname, E4CgiParams params, int row, int col)
          Save the value into the database.
 void setActualSizeIndex(int grid_size_index)
          Set the grid size.
 void setCaption_horizontal(E4Label_Intf caption_horizontal)
          Set the caption for the horizontal data components.
 void setCaption_horizontal(java.lang.String caption_horizontal)
          Set the caption for the horizontal data components.
 void setCaption_vertical(E4Label_Intf caption_vertical)
          Set the caption for the vertical data components.
 void setCaption_vertical(java.lang.String caption_vertical)
          Set the caption for the vertical data components.
 void setEnableExcel(boolean mode)
          Enable excel export.
 void setEnablePrinting(boolean mode)
          Enable printing.
 void setFirstColumn(int col)
          Set the first display column.
 void setFirstRow(int row)
          Set the first display row.
 void setLabelColor(E4Color color)
          Set the color for displaying the labels.
 void setNavigationColor(E4Color color)
          Set the color for displaying the navigation items.
 void setNumHeaderCols(int cols)
          Set the number of header columns for the horizontal headers.
 void setNumHeaderRows(int rows)
          Set the number of header rows for the vertical headers.
 boolean showNumbers()
          Get the row/column-number display mode.
 void showNumbers(boolean mode)
          Set the row/column-number display mode.
 java.lang.StringBuffer toExcel()
           
 void toHtml(E4StringBufferHtml buf, E4ServletImplementation_Intf servlet)
          Render this object.
 java.lang.String toString()
           
abstract  int verticalSize()
          Get the vertical size for this E4Grid.
 
Methods inherited from class e4s.html.E4HtmlElementGeneral
addScript, addScript, addScript, addStyleForEditing, addTranslationForEditing, buildStyleAttribute, buildStyleClassReference, collectStylesForEditing, collectStylesForEditing, collectTranslationsForEditing, createScript, createScript, debugToString, findElement, findElement, findElement, findElement, getElements, getElementsVec, getField, getId, getLastElement, getStringContent, getStyle, getSTYLE, getStyle, hasScripts, hasSTYLE, isContentClass, isE4InputField_Intf, openTag, removeAll, removeElementById, removeElements, removeElements, removeStyle, setId, setReadOnly, setStyle, setStyle, setSTYLE, setValue, Style, Style, toHtml_hidden, validate
 
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, 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

PARAM_COL

public static final E4InputFieldName PARAM_COL

PARAM_ROW

public static final E4InputFieldName PARAM_ROW

PARAM_IS_PRINTING

public static final java.lang.String PARAM_IS_PRINTING
See Also:
Constant Field Values

PARAM_GRID_SIZE

public static final E4InputFieldName PARAM_GRID_SIZE

PARAM_SESS_OBJ

public static final E4InputFieldName PARAM_SESS_OBJ

JS_NAME_SETMAP

public static final java.lang.String JS_NAME_SETMAP
See Also:
Constant Field Values

MAP_PLACEHOLDER

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

E4Grid

public E4Grid(E4Method mref,
              int numHeaderCols,
              int numHeaderRows)
Construct a E4Grid object.

Parameters:
mref - the Method-Reflection that is called, when this E4Grid requires repaint. This method shall call #add2body(e4s.html.BODY) and #processParams(e4s.html.E4CgiParams).
numHeaderCols - the number of rows for the matrix top-header
numHeaderRows - the number of columns for the matrix left-header
See Also:
E4Grid(e4s.html.E4Method)

E4Grid

public E4Grid(int numHeaderCols,
              int numHeaderRows)
Construct a E4Grid object.

Parameters:
mref - the Method-Reflection that is called, when this E4Grid requires repaint. This method shall call #add2body(e4s.html.BODY) and #processParams(e4s.html.E4CgiParams).
numHeaderCols - the number of rows for the matrix top-header
numHeaderRows - the number of columns for the matrix left-header
See Also:
E4Grid(e4s.html.E4Method)

E4Grid

public E4Grid(E4Method mref)
Construct a E4Grid object with 1 header cell, each vertically and horizontally.

Parameters:
mref - the Method-Reflection that is called, when this E4Grid requires repaint. This method shall call #add2body(e4s.html.BODY) and #processParams(e4s.html.E4CgiParams).
See Also:
E4Grid(e4s.html.E4Method,int,int)
Method Detail

isPrinting

public boolean isPrinting()
Get the current display mode.

Returns:
true, if the user has clicked the print-button.
See Also:
drawCell_Printer(e4s.html.TD, int, int), setEnablePrinting(boolean), getEnablePrinting()

setEnablePrinting

public void setEnablePrinting(boolean mode)
Enable printing.

Parameters:
mode - true, if printing is enabled
See Also:
getEnablePrinting(), isPrinting()

getEnablePrinting

public boolean getEnablePrinting()
Is printing enabled?

Returns:
true, if printing is enabled
See Also:
setEnablePrinting(boolean), isPrinting()

setEnableExcel

public void setEnableExcel(boolean mode)
Enable excel export.

Parameters:
mode - true, if printing is enabled
See Also:
getEnableExcel()

getEnableExcel

public boolean getEnableExcel()
Is xcel export enabled?

Returns:
true, if printing is enabled
See Also:
setEnableExcel(boolean)

isWindow

public boolean isWindow()
Get the current window mode.

Returns:
true, if the user has opened a new window
See Also:
enableNewWindow(boolean)

openingWindow

public boolean openingWindow()
Get the current window mode.

Returns:
true, if the user has opened a new window
See Also:
enableNewWindow(boolean)

enableNewWindow

public void enableNewWindow(boolean mode)
Enable to open a new window printing.

Parameters:
mode - true, if opening a new window is enabled
See Also:
enableNewWindow(), isPrinting()

enableNewWindow

public boolean enableNewWindow()
Is opening of new windows enabled?

Returns:
true, if opening a new window is enabled
See Also:
enableNewWindow(boolean), isWindow()

showNumbers

public boolean showNumbers()
Get the row/column-number display mode.

Returns:
true, if row and column numbering is enabled.
See Also:
showNumbers(boolean)

showNumbers

public void showNumbers(boolean mode)
Set the row/column-number display mode. To display row/column-numbers means, that an additional row and column is rendered, containing the actual row and column number (counting starts at 1).

Parameters:
mode - true, if row and column numbering is enabled.
See Also:
showNumbers()

setNumHeaderRows

public void setNumHeaderRows(int rows)
Set the number of header rows for the vertical headers. Typically, this value is to display exactly one label for each vertical column. But in some cases, it makes sense to display more than 1 label, then this value can be increased.

Parameters:
rows - the number of header rows.
See Also:
getNumHeaderRows(), drawVerticalHeaders_Screen(e4s.html.TR[], int, int), drawVerticalHeaders_Printer(e4s.html.TR[], int, int)

getNumHeaderRows

public int getNumHeaderRows()
Get the number of header rows.

Returns:
the number of header rows.
See Also:
setNumHeaderRows(int)

setNumHeaderCols

public void setNumHeaderCols(int cols)
Set the number of header columns for the horizontal headers. Typically, this value is to display exactly one label for each horizontal row. But in some cases, it makes sense to display more than 1 label, then this value can be increased.

Parameters:
cols - the number of header columns.
See Also:
getNumHeaderCols(), #drawHorizontalHeaders_Screen, #drawHorizontalHeaders_Printer

getNumHeaderCols

public int getNumHeaderCols()
Get the number of header rows.

Returns:
the number of header rows.
See Also:
setNumHeaderCols(int)

addDisplaySize

public void addDisplaySize(E4GridSize gs)
Add a new display layout (size) component the user can select from. This results in small boxes on the footer of the grid to choose the size. This is only a layout issue, this size has nothing to do with the whole data size.

Parameters:
gs - the grid-size element to be added.
See Also:
addDisplaySize(int,int)

addDisplaySize

public void addDisplaySize(int width,
                           int height)
Add a new display layout (size) component the user can select from. This results in small boxes on the footer of the grid to choose the size. This is only a layout issue, this size has nothing to do with the whole data size.

Parameters:
width - the grid-size width.
height - the grid-size width.
See Also:
#addDisplaySize(e4s.html.grid.E4GridSize)

addDisplaySizeDefault

public void addDisplaySizeDefault()
Add some default sizes.

See Also:
addDisplaySize(e4s.html.input.grid.E4GridSize)

getDisplayRows

public int getDisplayRows()
Get the current display size (number of rows).

Returns:
number of rows currently displayed (can be higher than the number on the screen, because of incomplete pages). If no size is defined, return a number of 10.
See Also:
#setDisplaySize, getDisplayCols()

getDisplayCols

public int getDisplayCols()
Get the current display size (number of columns).

Returns:
number of columns currently displayed (can be higher than the number on the screen, because of incomplete pages). If no size is defined, return a number of 10.
See Also:
#setDisplaySize, getDisplayRows()

getFirstRow

public int getFirstRow()
Get the index of the first row (including) currently displayed.

Returns:
the first row (a value greater or equal to 0 but less than verticalSize().
See Also:
getLastRow(), verticalSize()

getLastRow

public int getLastRow()
Get the index of the last row (including) currently displayed.

Returns:
the first row (a value greater or equal to 0 but less than verticalSize().
See Also:
getFirstRow(), verticalSize()

getFirstCol

public int getFirstCol()
Get the index of the first column (including) currently displayed.

Returns:
the first row (a value greater or equal to 0 but less than horizontalSize().
See Also:
getLastCol(), horizontalSize()

getLastCol

public int getLastCol()
Get the index of the last column (including) currently displayed.

Returns:
the first row (a value greater or equal to 0 but less than horizontalSize().
See Also:
getFirstCol(), horizontalSize()

toHtml

public void toHtml(E4StringBufferHtml buf,
                   E4ServletImplementation_Intf servlet)
            throws java.lang.Exception
Render this object.

Specified by:
toHtml in interface E4HtmlElement_Intf
Overrides:
toHtml in class E4HtmlElementGeneral
Parameters:
servlet - the servlet context.
Throws:
java.lang.Exception

collectScripts

public void collectScripts(E4ScriptsVec vec,
                           E4ServletImplementation_Intf servlet)
Collect the scripts required.

Specified by:
collectScripts in interface E4HtmlElement_Intf
Overrides:
collectScripts in class E4HtmlElementGeneral
Parameters:
vec - collect the names of all scripts
servlet - the servlet context
See Also:
E4JavaScript

collectTranslationsForEditing

public void collectTranslationsForEditing(E4TranslationsVec v,
                                          E4ServletImplementation_Intf servlet)
Collect the scripts required.

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

collectStylesForEditing

public void collectStylesForEditing(E4StylesHash v,
                                    E4ServletImplementation_Intf servlet)
Description copied from class: E4HtmlElementGeneral
Build a list (Vector) with style definitions used so far during display of this page. Run throught all subclasses elements and collect their styles as well. Note, that a style will only be added one time. The Vector contains elements of class E4StyleUsage.

Specified by:
collectStylesForEditing in interface E4HtmlElement_Intf
Overrides:
collectStylesForEditing in class E4HtmlElementGeneral
Parameters:
v - the Vector where the styles will be collected, may not be null
servlet - the servlet context
See Also:
E4ServletImplementation_Intf.sessionCanEditStyles(), #collectStylesForEditing(e4s.html.style.E4StylesHash, STYLE_Name, boolean)

getE4InputFieldName

public static E4InputFieldName getE4InputFieldName(int row,
                                                   int col)
Get an input field name for the cell at specified row/column.

Parameters:
row - the row
col - the column
Returns:
the new created fieldname

processParams

public void processParams(E4ServletImplementation_Intf servlet)
                   throws java.lang.Exception
Deprecated. 

Throws:
java.lang.Exception
See Also:
processParams(e4s.html.E4CgiParams, e4s.servlet.E4ServletImplementation_Intf)

processParams

public void processParams(E4CgiParams params,
                          E4ServletImplementation_Intf servlet)
                   throws java.lang.Exception
Process the parameters to the internal navigation functions. It is important, that this function will be involved during the refresh of the whole grid, this is the E4Method that was defined during construction.

Parameters:
params - the CGI parameters, containing some values also to layout and branch this grid object
Throws:
java.lang.Exception
See Also:
add2body(e4s.html.BODY,e4s.servlet.E4ServletImplementation_Intf)

setActualSizeIndex

public void setActualSizeIndex(int grid_size_index)
Set the grid size. This value represents the index of the size

Parameters:
grid_size_index - The index representing the size
See Also:
#addDisplaySize(e4s.html.grid.E4GridSize), addDisplaySize(int,int)

setFirstRow

public void setFirstRow(int row)
Set the first display row. This value must be between (including) getFirstRow() and getLastRow().

Parameters:
row - the current row to be displayed.
See Also:
getFirstRow(), getLastRow(), #vertivalSize()

setFirstColumn

public void setFirstColumn(int col)
Set the first display column. This value must be between (including) getFirstCol() and getLastCol().

Parameters:
col - the current column to be displayed.
See Also:
getFirstCol(), getLastCol(), horizontalSize()

getCaption_horizontal

public E4Label_Intf getCaption_horizontal()
Get the caption for the horizontal data components.

Returns:
the horizontal caption
See Also:
setCaption_horizontal(String), setCaption_horizontal(e4s.translate.E4Label_Intf)

setCaption_horizontal

public void setCaption_horizontal(E4Label_Intf caption_horizontal)
Set the caption for the horizontal data components.

Parameters:
caption_horizontal - the caption_horizontal to set
See Also:
getCaption_horizontal(), setCaption_horizontal(String), setCaption_vertical(e4s.translate.E4Label_Intf)

setCaption_horizontal

public void setCaption_horizontal(java.lang.String caption_horizontal)
Set the caption for the horizontal data components.

Parameters:
caption_horizontal - the caption_horizontal to set
See Also:
getCaption_horizontal(), setCaption_horizontal(e4s.translate.E4Label_Intf), setCaption_vertical(String)

getCaption_vertical

public E4Label_Intf getCaption_vertical()
Get the caption for the vertical data components.

Returns:
the vertical caption
See Also:
setCaption_vertical(String), setCaption_vertical(e4s.translate.E4Label_Intf)

setCaption_vertical

public void setCaption_vertical(E4Label_Intf caption_vertical)
Set the caption for the vertical data components.

Parameters:
caption_vertical - the caption_vertical to set
See Also:
getCaption_vertical(), setCaption_vertical(String), setCaption_vertical(e4s.translate.E4Label_Intf)

setCaption_vertical

public void setCaption_vertical(java.lang.String caption_vertical)
Set the caption for the vertical data components.

Parameters:
caption_vertical - the caption_vertical to set
See Also:
getCaption_vertical(), setCaption_vertical(e4s.translate.E4Label_Intf), setCaption_vertical(String)

createScaleGaps

public static int[] createScaleGaps(int maxIdx,
                                    int treshhold,
                                    int actualIdx)
If an interval 0..maxIdx is greater than a specified treshold, then use only the first elements, the last elements, the elements around actualIdx and every 10th element. E.g. Input runs from 0..49, treshold is 0 and actual = 25 then output is something like [0,1,2,-1,10,-1,20,21,22,23,24,25,26,27,28,29,30,-1,40,-1,47,48,49].

Parameters:
maxIdx - the maximal index
treshhold - if maxIdx is less than treshhold every index is used
actualIdx - the actualIdx (or -1 if none)
Returns:
an array with values equal the scaled index or gaps marked as -1

getNavigationColor

public E4Color getNavigationColor()
Get the color for displaying the navigation items.

Returns:
the label color
See Also:
setNavigationColor(e4s.html.E4Color), getLabelColor()

setNavigationColor

public void setNavigationColor(E4Color color)
Set the color for displaying the navigation items.

Parameters:
color - the label color
See Also:
getNavigationColor(), getLabelColor()

getLabelColor

public E4Color getLabelColor()
Get the color for displaying the labels.

Returns:
the label color
See Also:
setLabelColor(e4s.html.E4Color), getNavigationColor()

setLabelColor

public void setLabelColor(E4Color color)
Set the color for displaying the labels.

Parameters:
color - the label color
See Also:
getLabelColor(), setNavigationColor(e4s.html.E4Color)

add2body

public void add2body(BODY body,
                     E4ServletImplementation_Intf servlet)
This function adds the grid element to the body and (if printing is active) calls the printer dialog.

Parameters:
body - the above body element where this grid shall be added.
See Also:
#processParams(e4s.html.E4CgiParams)

drawFirstGrid_Screen

public void drawFirstGrid_Screen(TD tdDummy)
                          throws java.lang.Exception
Here, output to the first column/row is possible. This is an empty cell. No implementation required.

Throws:
java.lang.Exception
See Also:
drawFirstGrid_Printer(e4s.html.TD)

drawFirstGrid_Printer

public void drawFirstGrid_Printer(TD tdDummy)
                           throws java.lang.Exception
Here, output to the first column/row is possible when printing. This is an empty cell. No implementation required.

Throws:
java.lang.Exception
See Also:
drawFirstGrid_Screen(e4s.html.TD), isPrinting()

drawVerticalHeaders_Screen

public abstract void drawVerticalHeaders_Screen(TR[] tr,
                                                int firstCol,
                                                int lastCol)
                                         throws java.lang.Exception
Draw a header (one or more rows) for the vertical columns. This is the upper header of the grid. Compared to drawHorizontalHeader_Screen(e4s.html.TD[], int) this covers more than one cell, so table-cells could be joined.

Parameters:
tr - one or more TR elements (number depending on the value specified on setNumHeaderRows(int))
firstCol - start from this column (including)
lastCol - end at this column (including)
Throws:
java.lang.Exception
See Also:
drawVerticalHeaders_Printer(e4s.html.TR[], int, int), getNumHeaderRows()

drawVerticalHeaders_Printer

public void drawVerticalHeaders_Printer(TR[] tr,
                                        int firstCol,
                                        int lastCol)
                                 throws java.lang.Exception
Draw a header (one or more rows) for the vertical columns when printing. By default, this makes a call to drawVerticalHeaders_Printer(e4s.html.TR[], int, int) so there is no implementation required.

Parameters:
tr - one or more TR elements (number depending on the value specified on setNumHeaderRows(int))
firstCol - start from this column (including)
lastCol - end at this column (including)
Throws:
java.lang.Exception
See Also:
drawVerticalHeaders_Screen(e4s.html.TR[], int, int), isPrinting(), getNumHeaderRows()

drawHorizontalHeader_Screen

public abstract void drawHorizontalHeader_Screen(TD[] td,
                                                 int row)
                                          throws java.lang.Exception
Draw a header (one or more columns) for the horizontal rows. This is the left header of the grid. Compared to drawVerticalHeaders_Screen(e4s.html.TR[], int, int) this covers exactly one cell.

Parameters:
td - one or more TD elements (number depending on the value specified on setNumHeaderCols(int))
row - draw header for this row
Throws:
java.lang.Exception
See Also:
drawHorizontalHeader_Printer(e4s.html.TD[], int), getNumHeaderCols()

drawHorizontalHeader_Printer

public void drawHorizontalHeader_Printer(TD[] td,
                                         int row)
                                  throws java.lang.Exception
Draw a header (one or more columns) for the horizontal rows when printing. This is the left header of the grid.

Parameters:
td - one or more TD elements (number depending on the value specified on setNumHeaderCols(int))
row - draw header for this row
Throws:
java.lang.Exception
See Also:
drawHorizontalHeader_Screen(e4s.html.TD[], int), getNumHeaderCols(), isPrinting()

drawCell_Screen

public abstract void drawCell_Screen(TD td,
                                     E4InputFieldName fieldname,
                                     int row,
                                     int col)
                              throws java.lang.Exception
Draw a cell (typically, this will be an imput field) and set the value of that cell. The name of the

Parameters:
td - the place to draw this input field
fieldname - the fieldname of that value
row - the current row greater or equals 0 and less than verticalSize()
col - the current column greater or equals 0 and less than horizontalSize()
Throws:
java.lang.Exception
See Also:
saveValue(e4s.html.input.extended.E4InputFieldName, e4s.html.E4CgiParams, int, int), drawCell_Printer(e4s.html.TD, int, int)

drawCell_Printer

public abstract void drawCell_Printer(TD td,
                                      int row,
                                      int col)
                               throws java.lang.Exception
Draw a black/white representation of the value (typically, this will be NOT an input field).

Parameters:
td - the place to draw this input field
row - the current row greater or equals 0 and less than verticalSize()
col - the current column greater or equals 0 and less than horizontalSize()
Throws:
java.lang.Exception
See Also:
drawCell_Screen(e4s.html.TD, e4s.html.input.extended.E4InputFieldName, int, int), isPrinting()

verticalSize

public abstract int verticalSize()
Get the vertical size for this E4Grid.

Returns:
the number of rows totally available.
See Also:
horizontalSize()

horizontalSize

public abstract int horizontalSize()
Get the horizontal size for this E4Grid.

Returns:
the number of columns totally available.
See Also:
verticalSize()

saveValue

public abstract boolean saveValue(E4InputFieldName fieldname,
                                  E4CgiParams params,
                                  int row,
                                  int col)
                           throws java.lang.Exception
Save the value into the database.

Parameters:
fieldname - the fieldname of that value
params - all CGI parameters, including the value associated with fieldname.
row - the current row greater or equals 0 and less than verticalSize()
col - the current column greater or equals 0 and less than horizontalSize()
Throws:
java.lang.Exception
See Also:
drawCell_Screen(e4s.html.TD, e4s.html.input.extended.E4InputFieldName, int, int)

getObjectID

public java.lang.String getObjectID()
Get the ID of the Object.

Specified by:
getObjectID in interface E4ClientObject_Intf
Specified by:
getObjectID in interface E4SessionObject_Intf

drawCell_Csv

public java.lang.String drawCell_Csv(int row,
                                     int col)
                              throws java.lang.Exception
Draw a black/white representation of the value (typically, this will be NOT an input field).

Parameters:
row - the current row greater or equals 0 and less than verticalSize()
col - the current column greater or equals 0 and less than horizontalSize()
Returns:
the content
Throws:
java.lang.Exception
See Also:
drawCell_Screen(e4s.html.TD, e4s.html.input.extended.E4InputFieldName, int, int), drawCell_Printer(e4s.html.TD, int, int)

drawFirstGrid_Csv

public java.lang.String drawFirstGrid_Csv()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

drawHorizontalHeader_Csv

public java.lang.String[] drawHorizontalHeader_Csv(int row)
                                            throws java.lang.Exception
Throws:
java.lang.Exception

drawVerticalHeaders_Csv

public java.lang.String[][] drawVerticalHeaders_Csv(int firstCol,
                                                    int lastCol)
                                             throws java.lang.Exception
Throws:
java.lang.Exception

toExcel

public java.lang.StringBuffer toExcel()
                               throws java.lang.Exception
Throws:
java.lang.Exception

toString

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

saveFinished

public void saveFinished(E4ServletImplementation_Intf servlet)
                  throws java.lang.Exception
Throws:
java.lang.Exception

createdForm

public void createdForm(FORM form)
A good place to add hidden fields to the form just beeing created

Parameters:
form - the current form

isSaving

public boolean isSaving()
Check, if the saving process with subsequent calls to saveValue(e4s.html.input.extended.E4InputFieldName, e4s.html.E4CgiParams, int, int) is in progress.

Returns:
true while saving is executed

_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