www.element4solution.com

e4s.html.ajax
Interface E4AjaxData_Intf

All Known Implementing Classes:
E4AjaxTable

public interface E4AjaxData_Intf

Interface for retrieving data using the E4Ajax mechanism. Create a e4s.html.AjaxElement and add it to your HTML document (or nested elements). The e4s.html.AjaxElement will contain all necessary scripting and is inheritaded by a DIV element having an ID for identification. It also contains a refresh timeout, but no data. Data instead is provided by this interface which will be "called" by a client-side java script (timer) via the module implementation E4ModuleAjaxDispacher with the ID as parameter. Because it is certain unclear, when data will be required, it will be collected in an E4AjaxDataRepository controlled by the E4ModuleAjaxDispacher module and stored as session object. See: http://www.w3.org/TR/XMLHttpRequest/

Example_Ajax_A.java

Example_Ajax_FORM.java

Example_Ajax_Timer.java

See Also:
e4s.html.AjaxElement, E4AjaxDataRepository, E4ModuleAjaxDispacher, E4AjaxVec

Method Summary
 void collectScripts(E4ScriptsVec vec, E4ServletImplementation_Intf servlet)
          Collect the E4JavaScript required to display this element and all it's sub components.
 void collectStylesForEditing(E4StylesHash h, E4ServletImplementation_Intf servlet)
          Collect the styles (e4s.html.css.CLASS_Name) for style editing.
 void collectTranslationsForEditing(E4TranslationsVec vec, E4ServletImplementation_Intf servlet)
          Collect the translations (E4Label_Intf) for translation editing.
 java.lang.String getDivId()
          This is the ID assoziated with the DIV element that holds the E4Ajax content and which is used as key within the E4AjaxDataRepository.
 int getTrace()
          Enable trace of ajax output.
 boolean removeRemarksInHtml()
           
 boolean runWithoutLogin()
           
 void setAjaxElement(E4AjaxElementGeneral element)
           
 void toHtml(E4StringBufferHtml buf, E4CgiParams params, E4ServletImplementation_Intf servlet, boolean initialLoad)
          Use provided classes e.g.
 boolean validate(E4CgiParams params, E4ServletImplementation_Intf servlet)
           
 

Method Detail

getDivId

java.lang.String getDivId()
This is the ID assoziated with the DIV element that holds the E4Ajax content and which is used as key within the E4AjaxDataRepository. This key must be unique within one user session. You also can use getClass().getName() as ID if each data class is unique and will represent a value unique within the session.

Returns:
the ID

toHtml

void toHtml(E4StringBufferHtml buf,
            E4CgiParams params,
            E4ServletImplementation_Intf servlet,
            boolean initialLoad)
            throws java.lang.Exception
Use provided classes e.g. e4s.html.ajax.aTABLE for building the HTML output. E4Ajax output is more tricky rather than normal HTML output as the browser's DOM (document object model) is involved directly. This is the reason, why the "normal" classes like TABLE shall not be used here.

Parameters:
buf - the buffer collecting all the output stuff (rendering results).
params - the parameters filled into the form, if applicable, or null.
servlet - the servlet's context, useful for e.g. determining the user or application object in the need of database requests.
initial - true when the element is drawn initially on the web page (no ajax request occured so far. See e4s.html.AjaxElement#setShowOnLoad(boolean). This is because you might to need a distinction if parameters are passed or not so far.
Throws:
java.lang.Exception
See Also:
e4s.html.ajax.aTABLE#toHtml, e4s.html.ajax.aA#toHtml, e4s.html.ajax.aB#toHtml, e4s.html.ajax.aI#toHtml, e4s.html.ajax.aFONT#toHtml

collectScripts

void collectScripts(E4ScriptsVec vec,
                    E4ServletImplementation_Intf servlet)
Collect the E4JavaScript required to display this element and all it's sub components.

Parameters:
vec - the script vector
servlet - the servlet's context

collectTranslationsForEditing

void collectTranslationsForEditing(E4TranslationsVec vec,
                                   E4ServletImplementation_Intf servlet)
Collect the translations (E4Label_Intf) for translation editing.

Parameters:
vec - the translations vector
servlet - the servlet's context

collectStylesForEditing

void collectStylesForEditing(E4StylesHash h,
                             E4ServletImplementation_Intf servlet)
Collect the styles (e4s.html.css.CLASS_Name) for style editing.

Parameters:
h - the styles collection
servlet - the servlet's context

setAjaxElement

void setAjaxElement(E4AjaxElementGeneral element)

getTrace

int getTrace()
Enable trace of ajax output. Use in development environments only. This will be time and storage intensive operation, as every ajax request is written to a temporary directory E4Client.getTemporaryDirectoryAbs(). This is a particular setting for a single Ajax element, there is also a more global setting E4ModuleImplementation.setAjaxTrace(boolean).

Returns:
+1 if you want to force a trace, -1 if you want to deny a trace and 0 if trace shall depend on global settings E4ModuleImplementation.setAjaxTrace(boolean)
See Also:
E4ModuleImplementation.setAjaxTrace(boolean)

validate

boolean validate(E4CgiParams params,
                 E4ServletImplementation_Intf servlet)
                 throws java.lang.Exception
Throws:
java.lang.Exception

runWithoutLogin

boolean runWithoutLogin()

removeRemarksInHtml

boolean removeRemarksInHtml()

www.element4solution.com