
// Copyright (c) 1999, 2000 Oracle Corporation
package oracle.jbo.html.jsp.datatags;

import oracle.jbo.html.jsp.datatags.*;
import javax.servlet.jsp.tagext.*;
import oracle.jdeveloper.html.*;
import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;
import javax.servlet.*;
import oracle.jbo.*;

/**
 * A Class class.
 * <P>
 * @author Juan Oropeza
 */
public class InputTextAreaTag extends InputTagBase
{
  int nRows = 0;

  /**
   * Constructor
   */
  public InputTextAreaTag()
  {
  }

  public void setRows(String sRows) throws JspException
  {
    try
    {
      nRows = Integer.parseInt(sRows);
    }
    catch(Exception ex)
    {
      throw new JspException(ex.getMessage());
    }
  }


  

  public HTMLFieldRenderer getFieldRenderer()
   {
      return new TextArea();
   }

   /**
     * Process the start tag for this instance.
     *
     * The doStartTag() method assumes that all setter methods have been
     * invoked before.
     *
     * When this method is invoked, the body has not yet been invoked.
     *
     * @returns EVAL_BODY_INCLUDE if the tag wants to process body, SKIP_BODY if it
     * does ont want to process it.
     */
   public int doStartTag() throws JspException
   {
         try
         {
               internalInitialize();

               if(nCols > 0)
                rndObj.setDisplayWidth(nCols);
                
               if(nRows > 0)
                rndObj.setDisplayHeight(nRows);
                
               String sOutput = rndObj.renderToString(ctx, rs, row , sDataItem);

               pageContext.getOut().print(sOutput);
         }
         catch(Exception ex)
         {
            throw new JspException(ex.getMessage());
         }
         return Tag.SKIP_BODY;
   }
}

