|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sssw.shr.page.AgpTag
Base class that, together with its inherited class AgpControlBase, provides a convenient base implementation for serialization and HTML generation.
AgpControlBase
, Serialized FormField Summary | |
static int |
UNIT_PERCENT
|
static int |
UNIT_PIXEL
|
Constructor Summary | |
AgpTag()
|
Method Summary | |
boolean |
getBoolProperty(String name)
Returns the boolean value of the specified property. |
boolean |
getEnableHTMLGeneration()
Returns whether HTML generation is enabled. |
int[] |
getIntArrayProperty(String name)
Returns an int array property which has been stored as int using the delimiter ','. |
int |
getIntProperty(String name)
Returns the integer value of the specified property. |
int |
getIntPropertyUnit(String name)
Returns the int property unit. |
Object |
getProperty(String prop)
Returns the value of the HTML tag set through a call to the setProperty() method. |
String[] |
getStringArrayProperty(String name)
Returns a string array property which has been stored as a string using the delimiter ','. |
void |
invalidateHTML()
Invalidate. |
void |
removeProperty(String prop)
Removes a tag property. |
void |
setEnableHTMLGeneration(boolean enable)
Specifies whether HTML generation is enabled. |
void |
setIntProperty(String prop,
int value,
int unit)
Sets an integer property. |
boolean |
setProperty(String prop,
Object value)
Sets the value of an attribute associated with an HTML tag. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Methods implemented from interface com.sssw.shr.page.AgiJavaScriptEnhanced |
generateFunction,
generateRepaintScript,
generateScriptInitializers,
getFunctionNameForMethod,
getFunctionNames,
getMethodNames,
getScriptObjectName,
isHTMLRepaintPending,
isJavaScriptRepaintPending |
Methods implemented from interface com.sssw.shr.page.AgiPageControl |
generateHTML,
getPrefix,
notifyPageLoaded,
notifyPageRequestBegin,
notifyPageRequestEnd,
notifyPostValue,
notifyPostValues |
Methods implemented from interface java.io.Externalizable |
readExternal,
writeExternal |
Field Detail |
public static final int UNIT_PIXEL
public static final int UNIT_PERCENT
Constructor Detail |
public AgpTag()
Method Detail |
public Object getProperty(String prop)
setProperty()
method.
Returns null if no value is set.prop
- a string representing the HTML tag.String ml = (String) Field1.getProperty("MAXLENGTH");
AgpTag.setProperty(String prop, Object value)
public boolean getBoolProperty(String name)
name
- a string representing the name.public int getIntProperty(String name)
name
- a string representing the name.AgpTag.getIntArrayProperty(String name)
public int getIntPropertyUnit(String name)
name
- a string representing the name.public String[] getStringArrayProperty(String name)
name
- a string representing the name.public int[] getIntArrayProperty(String name)
name
- a string representing the name.AgpTag.getIntProperty(String name)
public boolean setProperty(String prop, Object value)
prop
- a string representing the HTML attribute.value
- an object representing the HTML attribute's value.
SilverStream does no error checking for the values that you set.
Whatever value you set will show up as-is in the HTML stream.
If the browser does not know how to render the property and value that you set,
it is ignored. If you set a nonexistent HTML tag property (for example,
Field1.setProperty("MYPROPERTY", "123");
) the property appears in the
HTML, but the browser ignores it. The getProperty
method will
return a value for an invalid property even though the property does not exist.
If you do not set a value, then getProperty()
returns null.
The following statement sets the initial value of a text field control.
In the resulting HTML, the VALUE attribute of the <INPUT> tag is set to "John Smith".
Field1.setProperty("VALUE", "John Smith");
The following code fragment defines the tabbing order for several text field controls on a form. In the resulting HTML, the TABINDEX attribute of each generated <INPUT> tag is set to a number indicating its order in the tab sequence.
firstname.setProperty("TABINDEX", "2"); lastname.setProperty("TABINDEX", "1"); employeeid.setProperty("TABINDEX", "3");The following example shows code that could be used in the rowGenerateBegin event for an HTML data view. This code alternates row colors in the view by modifying the value of the BGCOLOR attribute for each <TR> tag in the resulting HTML table.
AgpTag trTag = (AgpTag) evt.getArgument(); if (m_green) trTag.setProperty("BGCOLOR", "#F0FFF0"); // green else trTag.setProperty("BGCOLOR", "#FFFFFF"); // white // Invert the boolean variable for the next row. m_green = !m_green;
AgpTag.getProperty(String prop)
public void setIntProperty(String prop, int value, int unit)
prop
- a string representing the property.value
- an int representing the value.unit
- an int representing the unit.
The possible values are:
AgpTag.getIntProperty(String name)
,
AgpTag.getIntPropertyUnit(String name)
public void removeProperty(String prop)
prop
- a string representing the property
to be removed.public void invalidateHTML()
public boolean getEnableHTMLGeneration()
AgpTag.setEnableHTMLGeneration(boolean enable)
public void setEnableHTMLGeneration(boolean enable)
enable
- true
if HTML
generation should be enabled, otherwise false
.AgpTag.getEnableHTMLGeneration()
|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |