8 Replies Latest reply: Aug 17, 2012 7:58 AM by 948988 RSS

    How to add an additional column into existing table

    948988
      Hello all,
      advance "Happy Independence Day" to u all....

      i am new to OAF, my requirement is to create search table. i hav done with it, but i want to add an additional column(View) into existing table, but the condition is
      if Status(one of the column name of table) has value "completed" then View column should display value "Certificate" on the same row.
      can any one help me to do this?
      plz reply to this below mail id: khushisw@gmail.com


      thanks
        • 1. Re: How to add an additional column into existing table
          Shakher Sharma
          Hi,

          Do you want this column to be displayed dynamically or should it be displayed all the time but the only functionality required is that the value of this column is dependent on other column?

          If it should be displayed all the times then in your sql clause add one more column as given below:

          select col1,
          col2,
          .
          .
          status,
          decode(status, 'completed', 'certificate', '') new_col
          from ....


          modify your sql in view object as per suggestion given above.
          Save it.
          Then go to your table.
          Add a new column in it.
          set the value of this new column in sql ("newCol") to new column on table.
          Run your page.
          • 2. Re: How to add an additional column into existing table
            948988
            Hi,
            thanks for your reply.
            this column shold be displayed dynamically, not all the time.
            • 3. Re: How to add an additional column into existing table
              948988
              Hi,
              as u suggested i have done , but newCol is displayed as page runs, it is not displayed dynamically.
              I want to display “Certificate” button only in front of the column Status which contains value “Completed”.
              but it is displaying in front of all rows.
              so can u suggest me to get the required??
              • 4. Re: How to add an additional column into existing table
                919822
                Hi,

                Use SWITCHER concepts here. Refer to update page tutorial given in Jdeveloper.

                Thanks,
                Venkat.

                Edited by: 916819 on Aug 16, 2012 2:37 AM
                • 5. Re: How to add an additional column into existing table
                  948988
                  Hi
                  as per my requirement,
                  i hav added Switcher region(ViewSwitcher) to the table, in that i hav created one button(Certificate).
                  and added this query to VO-
                  decode(nvl(to_char(Status), 'Completed'), 'N','ViewDisabled',
                  'ViewEnabled') AS VIEW_SWITCHER

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

                  OAApplicationModule am = pageContext.getApplicationModule(webBean);
                  am.invokeMethod("initializeSimpleVO4PageLoad");
                  OATableBean table = (OATableBean)webBean;
                  table.prepareForRendering(pageContext);
                  DataObjectList columnFormats = table.getColumnFormats();
                  DictionaryData columnFormat = null;
                  int childIndex = pageContext.findChildIndex(table, "ViewSwitcher");
                  columnFormat =(DictionaryData)columnFormats.getItem(childIndex);
                  columnFormat.put(COLUMN_DATA_FORMAT_KEY, ICON_BUTTON_FORMAT);
                  }
                  but i got below run time error:oracle.apps.fnd.framework.OAException: java.lang.ClassCastException
                  at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:891)
                  at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:603)
                  at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
                  at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136)
                  at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
                  at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
                  at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
                  at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
                  at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
                  at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
                  at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
                  at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
                  at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
                  at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
                  at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
                  at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2336)
                  at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1735)
                  at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509)
                  at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430)
                  at OA.jspService(OA.jsp:33)
                  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.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
                  at com.evermind.server.http.GetParametersRequestDispatcher.forward(GetParametersRequestDispatcher.java:189)
                  at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:199)
                  at OA.jspService(OA.jsp:38)
                  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 Enrollment.oracle.apps.po.hello.server.webui.EmptyTableCO.processRequest(EmptyTableCO.java:51)
                  at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:587)
                  at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
                  at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136)
                  at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
                  at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
                  at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
                  at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
                  at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
                  at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
                  at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
                  at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
                  at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
                  at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
                  at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
                  at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2336)
                  at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1735)
                  at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509)
                  at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430)
                  at OA.jspService(OA.jsp:33)
                  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.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
                  at com.evermind.server.http.GetParametersRequestDispatcher.forward(GetParametersRequestDispatcher.java:189)
                  at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:199)
                  at OA.jspService(OA.jsp:38)
                  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 Enrollment.oracle.apps.po.hello.server.webui.EmptyTableCO.processRequest(EmptyTableCO.java:51)
                  at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:587)
                  at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
                  at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136)
                  at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
                  at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
                  at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
                  at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
                  at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
                  at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
                  at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
                  at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
                  at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
                  at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
                  at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
                  at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2336)
                  at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1735)
                  at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509)
                  at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430)
                  at OA.jspService(OA.jsp:33)
                  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.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
                  at com.evermind.server.http.GetParametersRequestDispatcher.forward(GetParametersRequestDispatcher.java:189)
                  at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:199)
                  at OA.jspService(OA.jsp:38)
                  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)
                  • 6. Re: How to add an additional column into existing table
                    948988
                    error is resolved but "view" column is blank, it should display button.
                    and i want to display all the records of from database once i run, can u help me to do this?
                    • 7. Re: How to add an additional column into existing table
                      919822
                      Hi,

                      You said, "View" column is balnk; But you need a button as "Certificate" then try changing the item stype of your image defined for switcher.

                      But what should happen when I click on this Button ?

                      Thanks,
                      Venkat.
                      • 8. Re: How to add an additional column into existing table
                        948988
                        Hi venkat,

                        below i hav written my requirement........
                        based on requirement i hav dine this....


                        plz read it
                        plz let me knw why i am not getting wat i required?
                        and i want to display all the records of columns EMP_ID,EMP_AME,COURSE_NAME,STATUS, ENROLLMENT_DATE,COMPLETION_DATE,
                        from database once i run, can u help me to do this?

                        i want to add an additional column(View) into existing table, but the condition is
                        if Status(one of the column name of table) has value "completed" then View column should display value "CertificateButton"
                        so based on my requirement i hav added Switcher region, and one button to the existing table.
                        and added this query in VO-select EMP_ID,EMP_AME,COURSE_NAME,STATUS, ENROLLMENT_DATE,COMPLETION_DATE,

                        decode(nvl(to_char(STATUS), 'Completed'), 'Y','CertificateEnabled') AS VIEW_SWITCHER from emp_dummy

                        CertificateEnabled-item button Id
                        VIEW_SWITCHER-Id of switcher region
                        i hope u got my requirement..

                        i want to display all the records of columns EMP_ID,EMP_AME,COURSE_NAME,STATUS, ENROLLMENT_DATE,COMPLETION_DATE,
                        from database, so i hav written this below code:



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

                        OAApplicationModule am = pageContext.getApplicationModule(webBean);
                        am.invokeMethod("initializeSimpleVO4PageLoad");
                        /* OATableBean table = (OATableBean)webBean;*/
                        OATableBean table = (OATableBean)webBean.findChildRecursive("resultTable");
                        table.prepareForRendering(pageContext);
                        DataObjectList columnFormats = table.getColumnFormats();
                        DictionaryData columnFormat = null;
                        int childIndex = pageContext.findChildIndex(table, "ViewSwitcher");
                        columnFormat =(DictionaryData)columnFormats.getItem(childIndex);
                        columnFormat.put(COLUMN_DATA_FORMAT_KEY, ICON_BUTTON_FORMAT);


                        }



                        processFormRequest:
                        public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
                        {
                        super.processFormRequest(pageContext, webBean);
                        OAApplicationModule am1 = pageContext.getApplicationModule(webBean) ;

                        am1.invokeMethod("saveDataToSimpleTable") ;

                        if("Status1".equals(pageContext.getParameter(EVENT_PARAM))){
                        am1.invokeMethod("statusHandle");
                        }



                        AM:

                        public class EnrollmentAMImpl extends OAApplicationModuleImpl
                        {

                        public void initializeSimpleVO4PageLoad()
                        {

                        OAViewObject vo = (OAViewObject)getCourseEnrollmentVO1();
                        if (!vo.isPreparedForExecution())
                        {
                        vo.executeQuery();


                        vo.next();
                        }

                        Row row = vo.createRow();
                        vo.insertRow(row);
                        vo.next();
                        row.setNewRowState(Row.STATUS_INITIALIZED);
                        }
                        }


                        please help me.........

                        Edited by: 945985 on Aug 17, 2012 5:57 AM