Thursday 13 December 2012

How to use Custom CSS

//In Controller PR
           
                import oracle.cabo.style.CSSStyle;

                 CSSStyle customCss = new CSSStyle();
                 customUnCss.setProperty("text-transform","uppercase");
                 customUnCss.setProperty("color", "    #ee0000");//# -red
                 OAMessageStyledTextBean styledTextBean =(OAMessageStyledTextBean)webBean.findIndexedChildRecursive("POCommentsItem");
                 if(styledTextBean!=null)
                 {
                  styledTextBean.setInlineStyle(customUnCss);
                 }

Tuesday 11 December 2012

Prepared Statement - Controller

    //In Controller
   
    import java.sql.Connection; 
    import java.sql.PreparedStatement;

                                     
 Connection conn = pageContext.getApplicationModule(webBean).getOADBTransaction().getJdbcConnection(); 
 String Query = " UPDATE tpc_pklist_roll_details_temp SET interface_id = :1 WHERE roll_line_id=:2"; 
 PreparedStatement stmt = conn.prepareStatement(Query); 
  stmt.setString(1, pseqno);
  stmt.setString(2, rolllineid);
  stmt.executeUpdate();
  conn.commit();

Code for Clearing Check Box Programatically.

for(OAViewRowImpl row = (OAViewRowImpl)vo.first(); row != null; row = (OAViewRowImpl)vo.next())
 {
              if(row.getAttribute("Selectflag")!=null)
                  {
                   row.setAttribute("Selectflag","N");
                   }
   }

Wednesday 5 December 2012

JBO-25009: Cannot create an object of type:oracle.jbo.domain.Date with value:

In Controller

java.sql.Date ashipdate;

//In PFR
 String ActualShipDate = pageContext.getParameter("ActualShippedDate");
  OADBTransaction txn = am.getOADBTransaction();
    if(ActualShipDate!=null)
         {
           java.sql.Date javaSqlDate = txn.getOANLSServices().stringToDate(ActualShipDate);
           ashipdate = javaSqlDate;
         }

Tuesday 4 December 2012

Hello World In OAF:Controller Code

/**
 * Controller for ...
 */
public class HelloWorldCO 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);
    if(pageContext.getParameter("GoBtn")!=null)
      {
       String userContent = pageContext.getParameter("HelloItem");
       String message ="Hello,"+userContent+"!";
       throw new OAException(message,OAException.INFORMATION);
      }
  }

}