|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjaxcent.JaxcentPage
JaxcentPage is the base class from which all Jaxcent URL handlers need to be derived. In cases where no particular handler is needed (when using auto-session-management and when no data verification is needed), this class can be specified directly as the handler. This class provides over-ridable methods to process operations like load and unload. It also provides various common utility methods, such as showing JavaScript alert (dialog box) messages.
Constructor Summary | |
JaxcentPage()
Default constructor. |
Method Summary | |
boolean |
checkElementExists(SearchType searchType,
java.lang.String searchString,
int searchIndex)
Check if an element exists, without attempting to assign it to an object. |
void |
deleteCookie(java.lang.String cookieName)
Delete cookie. |
void |
deleteSelectOption(java.lang.String id)
Delete a SELECT OPTION referenced by an ID. |
void |
deleteTableCell(java.lang.String id)
Delete a table cell (TD) referenced by an ID. |
void |
deleteTableRow(java.lang.String id)
Delete a table row (TR) referenced by an ID. |
java.lang.String |
evalJavaScriptCode(java.lang.String code,
boolean argsAsArray,
java.lang.Object[] args)
same as execJavaScriptCode, but waits for the result of the evaluation and returns it. |
void |
execJavaScriptCode(java.lang.String code,
boolean argsAsArray,
java.lang.Object[] args)
Call JavaScript, do not wait for results. |
java.util.Map |
getAllFormData()
Retrieve all form data on page. |
java.util.Map |
getAllSessionData(boolean getFromCurrentPage)
Get all data from session so far. |
java.lang.Object |
getAppContext()
This method will return the application server's or Jaxcent connector's application context. |
java.lang.String |
getCookie(java.lang.String cookieName)
Get cookie value. |
java.util.Map |
getCookies()
Get cookies from page as name->value pairs. |
java.lang.String |
getCurrentPath()
Get the path of the URL that is being processed. |
java.lang.Object |
getHttpSession()
If "UseSession" or "AutoSessionData" have been configured as true in the configuration file for this page, this method will return the HTTP session object from the application server or Jaxcent connector. |
java.util.Locale |
getLocale()
Get the remote locale if specified in HTTP Accept-Language header. |
java.util.Locale[] |
getLocales()
Get a list of remote locales if specified in HTTP Accept-Language header. |
java.lang.String |
getRemoteAddr()
Get the client IP address. |
java.awt.Dimension |
getScreenSize()
Get screen dimensions |
java.lang.String |
getStatusText()
Get status text. |
java.awt.Dimension |
getWindowSize()
Get window dimensions |
void |
goBack()
Navigate back. |
void |
goForward()
Navigate forward. |
void |
navigate(java.lang.String url)
Navigate to a given URL. |
protected void |
onFinalFormData(java.util.Map formData)
Override to receive form data during page unloading. |
protected void |
onJavaScriptRequest(java.lang.String cmd,
java.lang.String[] args)
Override to process data from JavaScript methods sent by calling the "JaxcentServerRequest( args... |
protected void |
onLoad()
Override to handle page loading. |
protected void |
onUnload()
Override to handle page unloading. |
void |
setBatchUpdates(boolean batchUpdates)
Used to hold updates without sending them out to the client. |
void |
setCookie(java.lang.String cookieString)
Add cookie to page. |
void |
setCookie(java.lang.String name,
java.lang.String value,
java.util.Date expires,
java.lang.String domain,
java.lang.String path,
boolean isSecure)
Add cookie to page. |
void |
setStatusText(java.lang.String text)
Set status text. |
boolean |
showConfirmDialog(java.lang.String message)
Show JavaScript confirm dialog box to the user. |
java.lang.String |
showInputDialog(java.lang.String prompt,
java.lang.String defaultResult)
Show JavaScript prompt dialog box to the user. |
void |
showMessageDialog(java.lang.String message)
Show JavaScript alert dialog box to the user. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JaxcentPage()
Method Detail |
public java.lang.Object getHttpSession() throws Jaxception
If running with a standard Java servlet-container/application-server, the object returned is of type javax.servlet.http.HttpSession, and can be cast to that type.
If running with a direct Jaxcent connector for IIS/Apache, the object returned is of type jaxcentConnector.JaxcentSession.
Jaxception
public java.lang.Object getAppContext() throws Jaxception
If running with a standard Java servlet-container/application-server, the object returned is of type javax.servlet.ServletContext, and can be cast to that type.
If running with a direct Jaxcent connector for IIS/Apache, the object returned is of type jaxcentConnector.JaxcentAppContext.
Jaxception
protected void onLoad()
protected void onFinalFormData(java.util.Map formData)
public java.util.Map getAllFormData() throws Jaxception
Jaxception
protected void onUnload()
public java.util.Map getAllSessionData(boolean getFromCurrentPage) throws Jaxception
Jaxception
public void navigate(java.lang.String url) throws Jaxception
Jaxception
public void goBack() throws Jaxception
Jaxception
public void goForward() throws Jaxception
Jaxception
public void execJavaScriptCode(java.lang.String code, boolean argsAsArray, java.lang.Object[] args) throws Jaxception
The arguments array can contain Strings, Integers, Doubles, Strings, Boolean, Integers, Jaxcent HTML Elements, or it can be null. If the argument array is not null, the "code" is just a JavaScript function name, and must not contain the parentheses character. In this case, the characters "( )" containing any arguments are appended to the "code". The array specifies the list of parameters. If the argument array is null, the "code" is evaluated as is, as an expression. To call a function with no args, use the form execJavaScriptCode( "myFunction()", null, false );
If the "argsAsArray" argument is true, the JavaScript function will be called with a single argument, which will be an array. Otherwise, the "args" array will be used as a list of arguments.
Jaxception
public java.lang.String evalJavaScriptCode(java.lang.String code, boolean argsAsArray, java.lang.Object[] args) throws Jaxception
Jaxception
protected void onJavaScriptRequest(java.lang.String cmd, java.lang.String[] args)
The JavaScript call is asynchronous and does not wait for server response -- if it is required to process a server response in JavaScript, define a function in JavaScript and call that function via execJavaScriptCode or evalJavaScriptCode, from your override of this method.
If JaxcentServerRequest was called at the client with no arguments, this method is called with null args. If JaxcentServerRequest was called with 1 arg, this method is passed that arg as "cmd", the "args" is null. Otherwise, "cmd" is the first arg passed to JaxcentServerRequest, and "args" contains the rest of the args.
public void setStatusText(java.lang.String text) throws Jaxception
Jaxception
public java.lang.String getStatusText() throws Jaxception
Jaxception
public java.awt.Dimension getScreenSize() throws Jaxception
Jaxception
public java.awt.Dimension getWindowSize() throws Jaxception
Jaxception
public java.lang.String getCurrentPath()
public java.lang.String getRemoteAddr()
public java.util.Locale getLocale()
public java.util.Locale[] getLocales()
public void showMessageDialog(java.lang.String message)
public boolean showConfirmDialog(java.lang.String message) throws Jaxception
Jaxception
public java.lang.String showInputDialog(java.lang.String prompt, java.lang.String defaultResult) throws Jaxception
Jaxception
public java.util.Map getCookies() throws Jaxception
Jaxception
public java.lang.String getCookie(java.lang.String cookieName) throws Jaxception
Jaxception
public void setCookie(java.lang.String cookieString)
public void setCookie(java.lang.String name, java.lang.String value, java.util.Date expires, java.lang.String domain, java.lang.String path, boolean isSecure) throws Jaxception
Jaxception
public void deleteCookie(java.lang.String cookieName)
public void deleteTableRow(java.lang.String id)
public void deleteTableCell(java.lang.String id)
public void deleteSelectOption(java.lang.String id)
public boolean checkElementExists(SearchType searchType, java.lang.String searchString, int searchIndex) throws Jaxception
Jaxception
public void setBatchUpdates(boolean batchUpdates)
If batch-updates has been set to true, no further data will be sent to the client until batch-updates is reset to false! This should be done in a try-finally clause.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |