1 Reply Latest reply: Jun 17, 2013 12:41 AM by 909811 RSS

    DetailsPageGlueCO Extension Issue

    909811

      Hi ,

      Anyone have successfully extended the DetailsPageGlueCO in iExpense?

       

      There are various thread running about this CO.

       

      Here is my problem

       

      When i extend the DetailsPageGlueCO, i am getting a null pointer exception Just calling super.processrequest

       

      When i suppress this null pointer exception, i am able to achieve my requirements.

       

      But when i Itemize the expense line and click on add another item in the itemized line, it adds 2 items.

       

      This is not related to my customization, as soon as extend the class the itemize functionality started misbehaving..

       

      Have anyone successfully extended DetailsPageGlueCO. Kindly share your experience

        • 1. Re: DetailsPageGlueCO Extension Issue
          909811

          package bvpap.oracle.apps.ap.oie.entry.lines.webui;

           

           

          import oracle.apps.ap.oie.entry.lines.webui.DetailsPageGlueCO;

          import oracle.apps.fnd.framework.OAApplicationModule;

          import oracle.apps.fnd.framework.OAException;

          import oracle.apps.fnd.framework.webui.OAPageContext;

          import oracle.apps.fnd.framework.webui.OAWebBeanConstants;

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

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

          import oracle.apps.fnd.framework.webui.beans.message.OAMessageDateFieldBean;

          import oracle.apps.fnd.framework.OAViewObject;

          import oracle.apps.fnd.framework.server.OAViewRowImpl;

          import java.util.Vector;

          import java.sql.SQLException;

          import oracle.apps.fnd.framework.server.OADBTransaction;

          import oracle.jbo.domain.Number;

          import java.sql.CallableStatement;

           

          public class bvpapDetailsPageGlueCO108  extends DetailsPageGlueCO

          {

           

              public bvpapDetailsPageGlueCO108()

              {

              }

           

              public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)

              {

                  StringBuffer lmessage = new StringBuffer();

                  try

                  {

                  super.processRequest(oapagecontext, oawebbean);

                  }

                  catch(Exception e)

                  {

                      lmessage.append(e.toString());

                  }

                  String sCallingModule = oapagecontext.getParameter("SDP_CALLING_MODULE");

                  String sUpdateMode = oapagecontext.getParameter("SDP_UPDATE_MODE");

                  boolean readOnlyMode = "RO".equals(sUpdateMode);

                  OAApplicationModule oaapplicationmodule = oapagecontext.getApplicationModule(oawebbean);

                  if (!readOnlyMode)

                  {

                      if("CASH_MR".equals(sCallingModule)) // Cash & Others Details

                      {

                          if(oaapplicationmodule != null)

                          {

                              OAMessageDateFieldBean startdatebean = (OAMessageDateFieldBean)oawebbean.findChildRecursive("StartDate");

                              if (startdatebean !=null )

                              {

                                  startdatebean.setReadOnly(false); // Enable the Start Date Field

                              }

                          }

                            // Descriptive Flex Field Changes Start -- Cash Side - Set the Company Paid DFF as Required.

                            // The approach is changed due to stale data / persistent data issue faced during defaulting the values.

                            // Descriptive Flex Field Changes Start -- Credit Side - Hide the Fields//

                            try

                            {

                                String sitemizedlinenumber = null;

                                String linenumber = null;

                                Vector expensetypevector = (Vector)oaapplicationmodule.invokeMethod("getExpenseTypesVector");

                                Vector vector1 = (Vector)expensetypevector.elementAt(0);

                                Boolean isitemizedline = (Boolean)oaapplicationmodule.invokeMethod("IsItemizedLine");

                                Number exptypelinenumber = (Number)oaapplicationmodule.invokeMethod("getExpTypeForLine");

                                if (exptypelinenumber != null)

                                {   

                                    if(isitemizedline.booleanValue())

                                    {

                                        sitemizedlinenumber = exptypelinenumber.toString();

                                        lmessage.append("sitemizedlinenumber: " + sitemizedlinenumber + " " );

                                    }

                                    else

                                    {

                                        linenumber = exptypelinenumber.toString();

                                        lmessage.append("linenumber: " + linenumber + " " );

                                    }

                                    boolean breakflag = false;

                                    for(int k = 0; k < vector1.size(); k++)

                                    {

                                        String s3 = vector1.elementAt(k).toString();

                                        if (s3.equals(linenumber))

                                        {

                                            String dffbeanname = (new StringBuilder()).append("DFF_").append(s3).toString();

                                            setFlexBeanRequired(oawebbean,dffbeanname);

                                            breakflag = true;

                                        }

                                        if(Boolean.TRUE.equals(isitemizedline))  // Itemized Line

                                        {

                                            if(!s3.equals(sitemizedlinenumber))

                                                 continue;

                                            String childdffbeanname = (new StringBuilder()).append("ChildDFF_").append(s3).toString();

                                            setFlexBeanRequired(oawebbean,childdffbeanname);

                                            break;

                                        } // !s3.equals(sitemizedlinenumber)

                                        if (breakflag)

                                            break;

                                    } // for

                                }    // exptypelinenumber != null

                            }

                            catch(Exception exception)

                            {

                                lmessage.append(exception.toString());

                            }

                      } //CASH_MR  

                      if("CC_MR".equals(sCallingModule)) //Credit Card Details

                      {

                          lmessage.append("CC_MR");

                          OAViewObject expenselineviewobject = (OAViewObject)oaapplicationmodule.findViewObject("ExpenseReportLinesVO");

                          OAViewRowImpl expenselinevorowimpl = (OAViewRowImpl) expenselineviewobject.getCurrentRow();

                          String retval = new String(expenselinevorowimpl.getAttribute("CCTrxLocation").toString());

                  // set Location.

                  expenselinevorowimpl.setAttribute("Location",retval);

                          // Descriptive Flex Field Changes Start -- Credit Side - Hide the Fields//

                          try

                          {

                              String sitemizedlinenumber = null;

                              String linenumber = null;

                              Vector expensetypevector = (Vector)oaapplicationmodule.invokeMethod("getExpenseTypesVector");

                              Vector vector1 = (Vector)expensetypevector.elementAt(0);

                              Boolean isitemizedline = (Boolean)oaapplicationmodule.invokeMethod("IsItemizedLine");

                              Number exptypelinenumber = (Number)oaapplicationmodule.invokeMethod("getExpTypeForLine");

                              if (exptypelinenumber != null)

                              {   

                                  if(isitemizedline.booleanValue())

                                  {

                                      sitemizedlinenumber = exptypelinenumber.toString();

                                      lmessage.append("sitemizedlinenumber: " + sitemizedlinenumber + " " );

                                  }

                                  else

                                  {

                                      linenumber = exptypelinenumber.toString();

                                      lmessage.append("linenumber: " + linenumber + " " );

                                  }

                                  boolean breakflag = false;

                                  for(int k = 0; k < vector1.size(); k++)

                                  {

                                      String s3 = vector1.elementAt(k).toString();

                                      if (s3.equals(linenumber))

                                      {

                                          String dffbeanname = (new StringBuilder()).append("DFF_").append(s3).toString();

                                          hideFlexBean(oawebbean,dffbeanname);

                                          breakflag = true;

                                      }

                                      if(Boolean.TRUE.equals(isitemizedline))  // Itemized Line

                                      {

                                          if(!s3.equals(sitemizedlinenumber))

                                               continue;

                                          String childdffbeanname = (new StringBuilder()).append("ChildDFF_").append(s3).toString();

                                          hideFlexBean(oawebbean,childdffbeanname);

                                          break;

                                      } // !s3.equals(sitemizedlinenumber)

                                      if (breakflag)

                                          break;

                                  } // for

                              }    // exptypelinenumber != null

                          }

                          catch(Exception exception)

                          {

                              lmessage.append(exception.toString());

                          }

                      } // CC_MR

                  }//!readOnlyMode     

                  throw new OAException(lmessage.toString(),OAException.INFORMATION );

              } // processRequest

               public void hideFlexBean(OAWebBean oawebbean, String dffbeanname)

               {

                   OADescriptiveFlexBean dffBean = (OADescriptiveFlexBean)oawebbean.findIndexedChildRecursive(dffbeanname);

                   if (dffBean != null)

                   {

                   dffBean.setAttributeValue(RENDERED_ATTR,false);

                   }

               } // hideFlexBean

                public void setFlexBeanRequired(OAWebBean oawebbean, String dffbeanname)

                {

                    OADescriptiveFlexBean dffBean = (OADescriptiveFlexBean)oawebbean.findIndexedChildRecursive(dffbeanname);

                    if (dffBean != null)

                    {

                    dffBean.setAttributeValue(RENDERED_ATTR,false);

                    OAWebBean dffbeans6a=dffBean.findChildRecursive(dffbeanname+"5");

                    if (dffbeans6a != null)

                        dffbeans6a.setRequired(OAWebBeanConstants.REQUIRED_YES);      

                    }

                } // setFlexBeanRequired   

          }