Tuesday, 21 February 2017

TextItem and Button Sample

/*===========================================================================+
 |   Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA    |
 |                         All rights reserved.                              |
 +===========================================================================+
 |  HISTORY                                                                  |
 +===========================================================================*/
package ItemStyles.oracle.apps.fnd.webui;

import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;

/**
 * Controller for ...
 */
public class ItemStylesCO extends OAControllerImpl
{
  public static final String RCS_ID="$Header$";
  public static final boolean RCS_ID_RECORDED =
        VersionInfo.recordClassVersion(RCS_ID, "%packagename%");

  /**
   * Layout and page setup logic for a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processRequest(pageContext, webBean);
  }

  /**
   * Procedure to handle form submissions for form elements in
   * a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);

      //To click the button-Lokanadham
    if(pageContext.getParameter("clickBtn") !=null)
 
    {
 
    OAMessageTextInputBean nameBean = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("nameID'");
    String nameStr = (String)nameBean.getValue (pageContext);
 
      //To validate the Item either null or empty -Lokanadham
    if(nameStr !=null && !"".equals(nameStr))
 
    {
 
        //To Disply message message after entering the value--Lokanadham
    OAException welcomeMsg = new OAException ("Welcome to OAF"+nameStr,OAException.INFORMATION);
    throw welcomeMsg;
 
    }
 
 
    else
    {
 
    OAException erroMsg = new OAException ("Pleae Enter Valid User Name");
 
    throw erroMsg;
    }
  }

  }

}