jaxcent
Class JaxcentObject

java.lang.Object
  extended byjaxcent.JaxcentObject
Direct Known Subclasses:
JaxcentHtmlElement

public class JaxcentObject
extends java.lang.Object

This is the base class for Jaxcent objects. Normally there is no need to use this class directly.


Constructor Summary
protected JaxcentObject(JaxcentPage page, SearchType searchType, java.lang.String str)
          Search for object on page by specified search type and search string.
protected JaxcentObject(JaxcentPage page, SearchType searchType, java.lang.String str, int index)
          Search for object on page by specified search type and search string, and search index.
protected JaxcentObject(JaxcentPage page, SearchType searchType, java.lang.String tag, java.lang.String text)
          Create new object on page using the specified tag.
protected JaxcentObject(JaxcentPage page, SearchType searchType, java.lang.String tag, java.lang.String[] attributes, java.lang.String[] values)
          Create new object on page using the specified attributes and values.
protected JaxcentObject(JaxcentPage page, SearchType searchType, java.lang.String tag, java.lang.String text, java.lang.String[] attributes, java.lang.String[] values)
          Create new object on page using the specified attributes and values and text.
protected JaxcentObject(JaxcentPage page, java.lang.String id)
          Search for object on page by specified ID
 
Method Summary
 void addJavaScriptVerification(java.lang.String event, java.lang.String verifier, java.lang.Object[] args)
          Add JavaScript verification code on a handler.
 java.lang.String getId()
          Retrieve any ID property.
 java.lang.String getProperty(java.lang.String propName)
          Get the value of a a property.
 void setId(java.lang.String id)
          Set ID property.
 void setProperty(java.lang.String propName, boolean value)
          Set a property to the specified boolean value.
 void setProperty(java.lang.String propName, java.awt.Color value)
          Set a property to the specified java.awt.Color value.
 void setProperty(java.lang.String propName, int value)
          Set a property to the specified int value.
 void setProperty(java.lang.String propName, java.lang.String value)
          Set a property to the specified value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JaxcentObject

protected JaxcentObject(JaxcentPage page,
                        java.lang.String id)
Search for object on page by specified ID


JaxcentObject

protected JaxcentObject(JaxcentPage page,
                        SearchType searchType,
                        java.lang.String str)
Search for object on page by specified search type and search string. If the search returns multiple objects, use the first one. searchType can be createNew, in which case the string parameter is the tag instead. The surrounding less than and greater than characters must not be a part of the tag.


JaxcentObject

protected JaxcentObject(JaxcentPage page,
                        SearchType searchType,
                        java.lang.String str,
                        int index)
Search for object on page by specified search type and search string, and search index. The search is expected to return multiple results. The search index is 0-based, and specifies the index in the multiple results. This constructor is not for use with createNew.


JaxcentObject

protected JaxcentObject(JaxcentPage page,
                        SearchType searchType,
                        java.lang.String tag,
                        java.lang.String text)
                 throws Jaxception
Create new object on page using the specified tag. Search type must be createNew. If text is non null, the new element is populated with that text.


JaxcentObject

protected JaxcentObject(JaxcentPage page,
                        SearchType searchType,
                        java.lang.String tag,
                        java.lang.String[] attributes,
                        java.lang.String[] values)
                 throws Jaxception
Create new object on page using the specified attributes and values. Search type must be createNew. Attributes and values arrays must have the same length.


JaxcentObject

protected JaxcentObject(JaxcentPage page,
                        SearchType searchType,
                        java.lang.String tag,
                        java.lang.String text,
                        java.lang.String[] attributes,
                        java.lang.String[] values)
                 throws Jaxception
Create new object on page using the specified attributes and values and text. Search type must be createNew. Attributes and values arrays must have the same length.

Method Detail

getProperty

public java.lang.String getProperty(java.lang.String propName)
                             throws Jaxception
Get the value of a a property.

Throws:
Jaxception

setProperty

public void setProperty(java.lang.String propName,
                        java.lang.String value)
                 throws Jaxception
Set a property to the specified value.

Throws:
Jaxception

setProperty

public void setProperty(java.lang.String propName,
                        int value)
                 throws Jaxception
Set a property to the specified int value.

Throws:
Jaxception

setProperty

public void setProperty(java.lang.String propName,
                        boolean value)
                 throws Jaxception
Set a property to the specified boolean value.

Throws:
Jaxception

setId

public void setId(java.lang.String id)
           throws Jaxception
Set ID property.

Throws:
Jaxception

getId

public java.lang.String getId()
                       throws Jaxception
Retrieve any ID property.

Throws:
Jaxception

setProperty

public void setProperty(java.lang.String propName,
                        java.awt.Color value)
                 throws Jaxception
Set a property to the specified java.awt.Color value.

Throws:
Jaxception

addJavaScriptVerification

public void addJavaScriptVerification(java.lang.String event,
                                      java.lang.String verifier,
                                      java.lang.Object[] args)
                               throws Jaxception
Add JavaScript verification code on a handler. If the event is being over-ridden, the verification code is called first. If it does not return a value of true, or if it fails, the Java event handler is not called.

This method can be used to reduct client-server trips by doing some of the verification on the client side before calling the event handler.

The arguments array can contain Strings, Integers, Doubles, Strings, Boolean, other Jaxcent HTML Elements (or "this"), or can be null. If the argument array is not null, the "verifier" must not contain the parentheses character. The characters "( )" containing any arguments are appended to the "verifier". The array specifies the list of parameters. If the argument array is null, the "verifier" is evaluated as is, as an expression. To call a function with no args, use the form addJavaScriptVerification( "click", "myCheckFunction()", null );

Throws:
Jaxception