7 Replies Latest reply on Jul 16, 2009 5:00 AM by Abdul Wahid

    Dynamic PopList

    user618218
      Hi

      I have a requirement to create a dynamic poplist based on the customer assigned to the quote selected in the LOV.

      How can I create the list and pass the customer id from the quote selected in LOV?

      Thank you
        • 1. Re: Dynamic PopList
          Gauravv
          Hi,

          Instead of creating the Poplist dynamically....you can create the poplist at design time only and can hide it intially and then progrmatically can render it true(*using SPEL*) as the value is returned from the LOV.

          Now you need to grab the Customer ID from the quote selected in the LOV and then render the Picklist.

          When the lov returns value "lovUpdate" event is fired which you can grab in processformrequest
          //now to grab the value selected in LOV you need to capture the customer id...
          //create a textinput for customer id and set rendered false and and set the View Attribute and create an lov map so that when lov returns customer id gets stored in it.

          String event = pageContext.getParameter("event");
          if("lovUpdate".equals(event))
          {
          //Now grab the current value of customer id.
          OAViewObject BillVO = (OAViewObject)ap.findViewObject("testVO1");
          Row row = (Row)VO.getcurrentRow();
          int customerid = (int)row.getAttribute("CustomerId");
          //Now you got the Customer id and then you can pass that in the picklist and then render it true

          }
          • 2. Re: Dynamic PopList
            user618218
            Hi i tried it but I get this error message

            Exception Details.

            oracle.apps.fnd.framework.OAException: java.lang.ClassCastException
                 at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:891)
                 at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1145)
                 at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1408)
                 at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2662)
                 at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1665)
                 at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:502)
                 at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:423)
                 at OA.jspService(OA.jsp:40)
                 at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
                 at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
                 at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
                 at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
                 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
                 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
                 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
                 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
                 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
                 at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
                 at java.lang.Thread.run(Thread.java:534)
            ## Detail 0 ##
            java.lang.ClassCastException
                 at forsythe.oracle.apps.forx.b2bquote.webui.B2BQuoteProcessCO.processFormRequest(B2BQuoteProcessCO.java:107)
                 at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:804)
                 at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
                 at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1156)
                 at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
                 at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1000)
                 at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:966)
                 at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:821)
                 at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
                 at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
                 at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1000)
                 at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:966)
                 at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:821)
                 at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
                 at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
                 at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2658)
                 at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1665)
                 at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:502)
                 at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:423)
                 at OA.jspService(OA.jsp:40)
                 at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
                 at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
                 at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
                 at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
                 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
                 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
                 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
                 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
                 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
                 at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
                 at java.lang.Thread.run(Thread.java:534)
            java.lang.ClassCastException
                 at forsythe.oracle.apps.forx.b2bquote.webui.B2BQuoteProcessCO.processFormRequest(B2BQuoteProcessCO.java:107)
                 at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:804)
                 at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
                 at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1156)
                 at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
                 at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1000)
                 at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:966)
                 at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:821)
                 at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
                 at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
                 at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1000)
                 at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:966)
                 at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:821)
                 at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
                 at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
                 at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2658)
                 at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1665)
                 at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:502)
                 at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:423)
                 at OA.jspService(OA.jsp:40)
                 at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
                 at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
                 at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
                 at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
                 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
                 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
                 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
                 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
                 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
                 at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
                 at java.lang.Thread.run(Thread.java:534)
            • 3. Re: Dynamic PopList
              Gauravv
              hi,

              Can you please paste the code here....

              Thanks,
              Gaurav
              • 4. Re: Dynamic PopList
                555256
                The error clearly says java.lang.ClassCastException at B2BQuoteProcessCO.java:107. Please check u might be incorrectly casting the class in the code on this line.
                --Mukul                                                                                                                                                                                                                                                                                                                                                                                           
                • 5. Re: Dynamic PopList
                  user618218
                  hi this is my code

                  public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
                  {
                  super.processFormRequest(pageContext, webBean);

                  OAApplicationModule am = pageContext.getApplicationModule(webBean);

                  // default values when quote to send and expire is selected from the LOV
                  String event = pageContext.getParameter("event");
                  if("lovUpdate".equals(event))
                  {
                  // then grab the View Object and set the Default effective date to be set.
                  OAViewObject VO = (OAViewObject)am.findViewObject("B2BQuoteProcessLogVO1");
                  Row row = (Row)VO.getCurrentRow();
                  String quoteToSend = (String)VO.getCurrentRow().getAttribute("TransmitQuotationName");
                  String quoteToExpire = (String)VO.getCurrentRow().getAttribute("ExpireQuotationName");
                  if (quoteToSend != null)
                  {
                  row.setAttribute("TransmitEffectiveDate",am.getOADBTransaction().getCurrentDBDate());

                  String transmitQuoteId = (String)VO.getCurrentRow().getAttribute("TransmitQuoteId");
                  Serializable[] param = {transmitQuoteId};
                  am.invokeMethod("initQuoteCategory", param);
                  }


                  and in the AMImpl

                  public void initQuoteCategory(String quoteId)
                  {
                  // get Quote Headers
                  B2BQuoteCategoryVOImpl vo = getB2BQuoteCategoryVO1();
                  if (vo == null)
                  {
                  MessageToken[] tokens = { new MessageToken("OBJECT_NAME", "B2BQuoteCategoryVO1") };
                  throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", tokens);
                  }

                  vo.setWhereClause(null); // Always reset
                  vo.setWhereClauseParams(null); // Always reset

                  if (quoteId == null)
                  {
                  vo.setWhereClause("1 = 2");
                  }
                  else
                  {
                  Number quote_id = null;

                  try
                  {
                  quote_id = new Number(quoteId);
                  }
                  catch(Exception e) {}

                  vo.setWhereClause("quote_id = :1");
                  vo.setWhereClauseParam(0, quote_id);

                  }
                  vo.executeQuery();
                  // vo.initQuery(quoteId);
                  } // end initDetails()


                  thank you
                  • 6. Re: Dynamic PopList
                    Gauravv
                    Hi,

                    Replace

                    String quoteToSend = (String)VO.getCurrentRow().getAttribute("TransmitQuotationName");
                    String quoteToExpire = (String)VO.getCurrentRow().getAttribute("ExpireQuotationName");
                    String transmitQuoteId = (String)VO.getCurrentRow().getAttribute("TransmitQuoteId");

                    with


                    String quoteToSend = (String)row.getAttribute("TransmitQuotationName");
                    String quoteToExpire = (String)row.getAttribute("ExpireQuotationName");
                    String transmitQuoteId = (String)row.getAttribute("TransmitQuoteId").toString();

                    Thanks,
                    Gaurav
                    • 7. Re: Dynamic PopList
                      Abdul Wahid
                      Hi,

                      Please check if any of the row.getAttribute("ExpireQuotationName") of the three is returning null.
                      If yes, you should handle nulls.

                      Abudl Wahid