Wednesday 8 August 2018

Display Current Date on OAF Page


Do Controller Extension and use below working code snippet in controller.

In Controller processRequest

// Show Current date on Page

        OAMessageDateFieldBean currentdate = // no need to specify a data type
            // always specify name
            (OAMessageDateFieldBean)createWebBean(pageContext,
                                                  OAWebBeanConstants.MESSAGE_DATE_FIELD_BEAN,
                                                  null, "datefield");
        currentdate.setReadOnly(true);
        pageLayoutBean.addIndexedChild(currentdate);




        OAApplicationModule am = pageContext.getApplicationModule(webBean);
        SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        String dateString =
            am.getOADBTransaction().getCurrentDBDate().toString();


        java.sql.Date sqlDate = null;


        try {
            sqlDate = new Date(f.parse(dateString).getTime());
            System.out.println("What is sqlDate value ********** " + sqlDate);
        } catch (ParseException e) {
            e.getMessage();


        }
        OAMessageDateFieldBean dateField =
            (OAMessageDateFieldBean)webBean.findIndexedChildRecursive("datefield");
        if (dateField != null) {
            dateField.setValue(pageContext, sqlDate);
            System.out.println("I am checking dateField  not null ********* " + dateField );
        }

Wednesday 13 September 2017

How To Call HTML in E business Suite




import oracle.apps.fnd.framework.webui.beans.OAHTMLWebBean;

public void processRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
  }
 
    OAPageLayoutBean localOAPageLayoutBean = paramOAPageContext.getPageLayoutBean();
   
    OAHTMLWebBean pdfElement =(OAHTMLWebBean)createWebBean(paramOAPageContext, HTML_WEB_BEAN, null, "EMBED");
    //use IFRAME or EMBED
          pdfElement.setHTMLAttributeValue("src","/OA_HTML/XxEBSAlert.jsp?");
    //pdfBlob
    // p_output
    pdfElement.setHTMLAttributeValue("width", "450");
    pdfElement.setHTMLAttributeValue("height", "450");
    if (localOAPageLayoutBean!=null)
    {
      localOAPageLayoutBean.addIndexedChild(pdfElement);
    }

Issue Running the OAF Page in Jdeveloper

Jdev version: 10.1.3.3.0

I have issue while running the OAF page in my local system. i am working through Client VPN and getting below error. i have tried all
possible workrounds as mentioned in previous forums.

1.
Add timeout parameter in ide.property File - Gave 100
2. Using using of Default Local IP in TOOL> Preferences > Embedded OC4j
3. Assigning your IP in Specific Host option in TOOL> Preferences > Embedded OC4j -  Gave machine ip address
4. Checking correct version of the Jdev
4. Deleting the transaction.state File from "C:\Jdev9i\jdevhome\jdev\system9.0.3.5.1453\oc4jconfig\log" location and restart the jdev again. - Emptied the system folder
5. no spaces in path where Jdev is installed.
6. Setting up the Env variable i.e. Jdev home in local system in My computer >properties >Advanced - JDEV_USER_HOME

I'm unable to find the below in Jdev.

Right click on .jpr in your Jdeveloper, go to project settings>
Configurations> Development> Runner
Under "Java Options" field delete parameters which has CACHE in it's name. They are
DFND_JDBC_STMT_CACHE_SIZE=200 DCACHENODBINIT=true




Solution:


Check Embeded OC4J Port is opened or not for your Machine IP.
if not please check with network Admin.



















IE Browser Issue How to remove the 'x' symbol .




how to remove the 'x' symbol .
it will come only IE browser not come in Chrome and firefox.most of the user using IE only



Solution:

Please fallow below steps your issue will be resolve.

1. Create one style.css file with below content

input[type=text]::-ms-clear {
    display: none;
    }


2. Go To Internet Options > General tab > Accessability button > "Format documents using my style sheet" and browse .css file and click ok.


check below screen shot as well.







Sunday 7 June 2015

Add FireAction on button Programmatically

      
import oracle.cabo.ui.action.FireAction;
import oracle.cabo.ui.action.FirePartialAction;
import oracle.apps.fnd.framework.webui.beans.nav.OAButtonBean;

In Controller PR
--------------------


OAButtonBean btn =(OAButtonBean)webBean.findChildRecursive("xxpdf");
  if(btn!=null)
      {
           
        FireAction firePartialAction = new FirePartialAction("notifyBtn");
        btn.setAttributeValue(PRIMARY_CLIENT_ACTION_ATTR,firePartialAction);
        btn.setText("View PDF");
          
      }


  Thanks,
   Dilip
            

Pass Parameter from one Page to another page on Button Event

package hs.oracle.apps.pos.changeorder.webui;

import com.sun.java.util.collections.HashMap;

import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OARow;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.nav.OAButtonBean;
import oracle.apps.pos.changeorder.webui.ViewPOControlsCO;
import oracle.cabo.ui.action.FireAction;
import oracle.cabo.ui.action.FirePartialAction;

import oracle.jbo.Row;

public class XXViewPOControlsCO extends ViewPOControlsCO
{
  public XXViewPOControlsCO()
  {
  }

  public void processRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processRequest(pageContext, webBean);
           OAApplicationModule am =(OAApplicationModule)pageContext.getRootApplicationModule();
           if(am!=null)
            {
            OAViewObject vo = (OAViewObject)am.findViewObject("PosViewHeadersVO");
            if(vo!=null)
            {
             Row row = (OARow)vo.getCurrentRow();
            }
   
      OAButtonBean btn =(OAButtonBean)webBean.findChildRecursive("xxpdf");
            if(btn!=null)
            {
             FireAction firePartialAction = new FirePartialAction("notifyBtn");
             btn.setAttributeValue(PRIMARY_CLIENT_ACTION_ATTR,firePartialAction);
              btn.setText("View PDF");
            }
         

     
       }
         
  }
 


  public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);
    String str1 =pageContext.getParameter("event");
      OAApplicationModule am =(OAApplicationModule)pageContext.getRootApplicationModule();
      if(am!=null)
       {
       OAViewObject vo = (OAViewObject)am.findViewObject("PosViewHeadersVO");
       if(vo!=null)
       {
        Row row = (OARow)vo.getCurrentRow();
           pageContext.writeDiagnostics(this,"This is PFR POHEADERID:"+row.getAttribute("PO_HEADER_ID"),1);
       }
   
      OAButtonBean btn =(OAButtonBean)webBean.findChildRecursive("xxpdf");
   
    if("notifyBtn".equals(str1))
    {  
        pageContext.setForwardURL("OA.jsp?OAFunc=PO_ORDER&poMode=viewOnly&poCallingModule=notification&poHideUpdate=Y&retainAM=Y&addBreadCrumb=Y&poHeaderId="+vo.getCurrentRow().getAttribute("PO_HEADER_ID"),
        null,
        OAWebBeanConstants.KEEP_MENU_CONTEXT,
        null,
        null,
        true,//retain AM
        OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
        OAWebBeanConstants.IGNORE_MESSAGES);
    }
  }
}}




Thanks,
Dilip