com.sas.servlet.beans.html
Class Hidden

java.lang.Object
  |
  +--com.sas.Component
        |
        +--com.sas.servlet.beans.BaseTransformation
              |
              +--com.sas.servlet.beans.BaseHidden
                    |
                    +--com.sas.servlet.beans.html.Hidden

public class Hidden
extends BaseHidden

Transformation bean definition for creating hidden HTML input fields. Hidden fields should not be rendered on the client and provide a means for servers to store state information with a form. This will be passed back to the server when the form is submitted. This is a workaround for the statelessness of HTTP.

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

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

JSP Page:

 <html>
 <body>
 
 <p> This example shows a simple hidden field generated by the Hidden Transformation Bean. </p>
 <%
    // Create a new Hidden object 
    com.sas.servlet.beans.HiddenInterface hidden = 
        new com.sas.servlet.beans.html.Hidden(); 
 
hidden.setName("hidden1"); hidden.setText("My Hidden Value"); hidden.write(out); %> </body> </html>

HTML output:

 <html>
 <body>
 
 <p> This example shows a simple hidden field generated by the Hidden Transformation Bean. </p>
 <INPUT TYPE=hidden NAME="hidden1" VALUE="My Hidden Value">
 </body>
 </html>
 

See Also:
Serialized Form

Constructor Summary
Hidden()
          Constructs a new Hidden Transformation Bean
Hidden(String name, String value)
          Constructs a new Hidden Transformation Bean
 
Method Summary
 void write(PrintWriter out)
          Writes the transformed representation of the object
 
Methods inherited from class com.sas.servlet.beans.BaseHidden
getText, 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

Hidden

public Hidden()
Constructs a new Hidden Transformation Bean

Hidden

public Hidden(String name,
              String value)
Constructs a new Hidden Transformation Bean
Parameters:
name - The hidden field name
value - The hidden field value
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