com.sas.servlet.beans.html
Class Text

java.lang.Object
  |
  +--com.sas.Component
        |
        +--com.sas.servlet.beans.BaseTransformation
              |
              +--com.sas.servlet.beans.BaseInput
                    |
                    +--com.sas.servlet.beans.BaseText
                          |
                          +--com.sas.servlet.beans.html.Text

public class Text
extends BaseText

Transformation bean definition for creating an HTML text entry field. This is a single line text field.

Problem: Create a document using JSP that contains a text input field.

Solution: Write a Java scriptlet in a JSP page that uses the Text Transformation Bean to create the HTML element.

JSP Page:

 <html>
 <body>
 
 <p> This example shows a simple text field generated by the Text Transformation Bean. </p>
 <FORM>
 <%
    // Create a new text object
    com.sas.servlet.beans.TextInterface text = 
       new com.sas.servlet.beans.html.Text(); 

text.setName("stuff"); text.setSize(20); text.setMaximumLength(30); text.setText("foo bar"); text.write(out); %> </FORM> </body> </html>

HTML output:

 <html>
 <body>
 
 <p> This example shows a simple text field generated by the Text Transformation Bean. </p>
 <FORM>
 <INPUT TYPE=text NAME="stuff" VALUE="foo bar" MAXLENGTH=30 SIZE=20>
 </FORM>
 </body>
 </html>
 

Live element:

See Also:
Serialized Form

Constructor Summary
Text()
          Constructs a new Text Transformation Bean
Text(String name)
          Constructs a new Text Transformation Bean
Text(String name, String value)
          Constructs a new Text Transformation Bean
Text(String name, String value, int size)
          Constructs a new Text Transformation Bean
Text(String name, String value, int size, int len)
          Constructs a new Text Transformation Bean
 
Method Summary
 void write(PrintWriter out)
          Writes the transformed representation of the object
 
Methods inherited from class com.sas.servlet.beans.BaseInput
getMaximumLength, getSize, getText, setMaximumLength, setSize, setText
 
Methods inherited from class com.sas.servlet.beans.BaseTransformation
getCustomAttributes, getDescription, getName, getParent, getRequest, getResponse, setCustomAttributes, setDescription, setName, setParent, setRequest, setResponse, toString, write, write, write
 
Methods inherited from class com.sas.Component
addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachModel, attachView, beansIsDesignTime, beansSetDesignTime, clone, clone, detachModel, detachView, dumpComponent, firePropertyChange, firePropertyChange, fireVetoableChange, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getExtendedBeanInfo, getLinkInfo, getModelInterface, getRequiredInterfaces, getResources, getStringResource, getViewInterfaceSupportInfo, initialize, initializeComponent, isDesignTime, isLinked, propertyChange, queryLinks, queryLinks, refresh, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setComponentDescription, setComponentSupportInfo, setDefaultValues, setLinkInfo, setModelInterface, setRequiredInterfaces, setViewInterfaceSupportInfo, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, validateObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Text

public Text()
Constructs a new Text Transformation Bean

Text

public Text(String name)
Constructs a new Text Transformation Bean
Parameters:
name - The text field name

Text

public Text(String name,
            String value)
Constructs a new Text Transformation Bean
Parameters:
name - The text field name
value - The initial text value

Text

public Text(String name,
            String value,
            int size)
Constructs a new Text Transformation Bean
Parameters:
name - The text field name
value - The initial text value
size - The visible size of the text field

Text

public Text(String name,
            String value,
            int size,
            int len)
Constructs a new Text Transformation Bean
Parameters:
name - The text field name
value - The initial text value
size - The visible size of the text field
len - The maximum input length
Method Detail

write

public void write(PrintWriter out)
           throws IOException
Writes the transformed representation of the object
Parameters:
out - The output stream
Overrides:
write in class BaseTransformation


Version: 1.2.20000317.001 Formatted: 2000/07/06 15:57:33PM