com.sas.servlet.tbeans.ipage.iform
Class IForm

com.sas.servlet.tbeans.ipage.iform.IForm
All Implemented Interfaces:
com.sas.beans.PropertyChangeSource, com.sas.lang.ObjectDataInterface, RenderableInterface, TransformationInterface, com.sas.util.WriteToPrintWriterInterface, java.io.Serializable

public class IForm

The IForm is a TransformationBean™ used to produce a form using a variety of markup languages (including WML,HDML, and HTML). This class will produce the appropriate markup language based on the requesting browser. For example, if a user accesses a JSP page containing an IForm from their cell phone, the IForm bean will produce either WML or HDML based on the type of browser the cell phone contained. If another user accesses the same JSP page using Internet Explorer, the IForm bean would produce HTML instead.

Note that the toString() method on this class calls the write method, which may have undesirable side effects. See BaseTransformation.toString() for more information. Debuggers often use toString() to show the value of a variable, and this may cause unexpected behavior while debugging

For More Information:

Visit the AppDev Studio Developer's Site to access step-by-step examples, white papers and additional usage information at http://support.sas.com/rnd/appdev/.

Examples for this class may be found on the Examples Site.

JSP custom tags provide an alternative to using the TransformationBeans™. Visit the Custom Tag Library Reference for additional information on the sas:IForm custom tag.

Note: A snapshot of the AppDev Studio Developers Site is installed on your local Web server when you install AppDev Studio. To access the site from webAF, select Help -> Developer Site .

See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_METHOD
          Default form submission method.
 
Fields inherited from class com.sas.servlet.tbeans.ipage.BaseIPage
HTML_PROLOG, WML_PROLOG
 
Constructor Summary
IForm()
          Construct a new Form
IForm(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Construct a new IForm
IForm(java.lang.String name, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Construct a new IForm
 
Method Summary
 BaseIFormElement add(BaseIFormElement element)
          Adds a BaseIFormElement to the IForm bean, such as a text entry field or radio box.
 java.lang.String getAction()
          Gets the URL which is used to post forms
 java.lang.String getActionLabel()
          Gets the label which is used to post forms
 java.lang.String getMethod()
          Gets the HTTP method to be used when sending the form contents to the server.
 void setAction(java.lang.String action)
          Sets the URL which is used to post forms via email (i.e "mailto:some.one@sas.com") or a server-side form handler (such as a servlet or JSP page) via HTTP (i.e.
 void setActionLabel(java.lang.String actionLabel)
          Sets the label which is used to post forms.
 void setMethod(java.lang.String method)
          Sets the HTTP method to be used when sending the form contents to the server.
 void writeBase(java.io.PrintWriter out)
          Writes the form base in the appropriate markup language
 void writeHiddenElements(java.io.PrintWriter out)
          Writes the hidden elements associated with this form.
 
Methods inherited from class com.sas.servlet.tbeans.ipage.BaseIPage
addOption, getBrowserType, getCacheTimeToLive, getOptionLabel, getOptionURL, getTitle, resolveNewLine, setBrowserType, setCacheTimeToLive, setId, setName, setName, setRequest, setResponse, setStyle, setStyleClass, setTitle, toString, write, writeBase, writeBase, writeFooter, writeFooter, writeFooter, writeHeader, writeHeader, writeHeader
 
Methods inherited from class com.sas.servlet.tbeans.BaseTransformation
addPropertyChangeListener, addPropertyChangeListener, cleanUpResources, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getCustomAttributes, getDescription, getId, getInputTransform, getLocale, getName, getObjectData, getObjectDataProperty, getOutputTransform, getRequest, getResponse, getTagEpilog, getTagProlog, hasListeners, isCleanUpResourcesOn, isVisible, removePropertyChangeListener, removePropertyChangeListener, setCleanUpResourcesOn, setCustomAttributes, setDescription, setInputTransform, setLocale, setLocaleDependentProperties, setObjectData, setObjectDataProperty, setOutputTransform, setTagEpilog, setTagProlog, setVisible, write, write, write
 

Field Detail

DEFAULT_METHOD

public static final java.lang.String DEFAULT_METHOD
Default form submission method.

See Also:
Constant Field Values
Constructor Detail

IForm

public IForm()
Construct a new Form


IForm

public IForm(javax.servlet.http.HttpServletRequest request,
             javax.servlet.http.HttpServletResponse response)
Construct a new IForm

Parameters:
request - The request object
response - The response object

IForm

public IForm(java.lang.String name,
             javax.servlet.http.HttpServletRequest request,
             javax.servlet.http.HttpServletResponse response)
Construct a new IForm

Parameters:
name - The name
request - The request object
response - The response object
Method Detail

writeBase

public void writeBase(java.io.PrintWriter out)
               throws java.io.IOException
Writes the form base in the appropriate markup language

Overrides:
writeBase in class BaseIPage
Parameters:
out - The output stream
Throws:
java.io.IOException - Thrown if some type of I/O error occurs

writeHiddenElements

public void writeHiddenElements(java.io.PrintWriter out)
                         throws java.io.IOException
Writes the hidden elements associated with this form. This method is called during a call to write so it does not need to be called directly.

Parameters:
out - The output stream
Throws:
java.io.IOException - Thrown if some type of I/O error occurs

setMethod

public void setMethod(java.lang.String method)
Sets the HTTP method to be used when sending the form contents to the server. Valid values are "get" and "post". The default value is "get"

Parameters:
method - The HTTP method

getMethod

public java.lang.String getMethod()
Gets the HTTP method to be used when sending the form contents to the server.

Returns:
The HTTP method

setAction

public void setAction(java.lang.String action)
Sets the URL which is used to post forms via email (i.e "mailto:some.one@sas.com") or a server-side form handler (such as a servlet or JSP page) via HTTP (i.e. "http://www.sas.com/jsp/my.jsp").

Parameters:
action - The action URL

getAction

public java.lang.String getAction()
Gets the URL which is used to post forms

Returns:
The action URL

setActionLabel

public void setActionLabel(java.lang.String actionLabel)
Sets the label which is used to post forms. This will be the last card's softkey label for phones, or the button text for HTML. The default for WML and HDML is "OK", while the default button text for HTML submission is "SUBMIT". To support a wide range of devices, this String should be a maximum of 5 characters.

Parameters:
action - The action URL

getActionLabel

public java.lang.String getActionLabel()
Gets the label which is used to post forms

Returns:
The actionLabel

add

public BaseIFormElement add(BaseIFormElement element)
Adds a BaseIFormElement to the IForm bean, such as a text entry field or radio box.

Parameters:
element - The BaseIFormElement object to be added to the IForm
Returns:
The complete element which is to be added.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.