1 Reply Latest reply: May 8, 2012 10:09 AM by Timo Hahn RSS

    Make default Radio Button Selection

    arrumugam
      hi ,

      I have to two radio button on the OAF page :

      1)X
      2)Y

      "X" radio button is selected by default after click on "Create" button of previous page.

      when the radio button X is selected , a table is displayed

      when the radio button "Y" is selected ,it renders "Search based" page on the same OAF page by partial page renedering.

      My Requirement is to Display directly result of "Y" (search based page) after click on "Create" button of previous page by avoding click on X or Y.

      I have attempted the following


      1) Checked value for X is ALLPSBTN and
      Checked value for Y is SPECIFICPSBTN

      Set the "Initial Value" Property of X to the "SPECIFICPSBTN" --didn't work

      2) for X -- Row Layout: NewPSTableRow
      for Y -- Row Layout: (PSSearchRow)

      I set rendered SPEL property of X (${oa.ProductServicePVO.DISPLAY_SPECIFICPS}) same to Y.----didn't work


      3) In Controller it include follwoing code in "ProcessRequest":

      OAMessageRadioButtonBean oamessageradiobuttonbean = (OAMessageRadioButtonBean)oawebbean.findChildRecursive("PSModeOne");--for x
      if(oamessageradiobuttonbean != null)
      {
      oamessageradiobuttonbean.setName("viewModeRadioGroup");
      oamessageradiobuttonbean.setValue("ALLPSBTN");
      }
      OAMessageRadioButtonBean oamessageradiobuttonbean1 = (OAMessageRadioButtonBean)oawebbean.findChildRecursive("PSModeTwo");--for Y
      if(oamessageradiobuttonbean1 != null)
      {
      oamessageradiobuttonbean1.setName("viewModeRadioGroup");
      oamessageradiobuttonbean1.setValue("SPECIFICPSBTN");
      }
      oaapplicationmodule.invokeMethod("initializeMainPPR");
      OAWebBean oawebbean1 = oawebbean.findChildRecursive("ViewModeRow");


      and in "Process from Request"

      String s = oapagecontext.getParameter("event");
      if("ViewSubCat".equals(s) || "GoToParent".equals(s))
      {
      oapagecontext.setForwardURLToCurrentPage(null, true, "S", (byte)0);
      return;
      }
      if("select".equals(s))
      {
      String s1 = oapagecontext.getParameter("viewModeRadioGroup");
      Serializable aserializable[] = {
      s1
      };
      oracle.jbo.ViewObject viewobject = oaapplicationmodule.findViewObject("PSSearchResultsVO");
      oaapplicationmodule.invokeMethod("handleMainPPR", aserializable);
      return;
      }


      the code of is InitializeMainPPR is
      public void initializeMainPPR()
      {
      OAViewObjectImpl oaviewobjectimpl = (OAViewObjectImpl)findViewObject("ProductServicePVO");
      if(oaviewobjectimpl != null)
      {
      Object obj = null;
      if(oaviewobjectimpl.getFetchedRowCount() == 0)
      {
      oaviewobjectimpl.setMaxFetchSize(0);
      oaviewobjectimpl.insertRow(oaviewobjectimpl.createRow());
      Row row = oaviewobjectimpl.first();
      row.setAttribute("RowKey", new Number(1));
      row.setAttribute("DISPLAY_ALLPS", Boolean.TRUE);
      row.setAttribute("DISPLAY_SPECIFICPS", Boolean.FALSE);
      }
      }
      }

      and for handleMainPPR is

      public void handleMainPPR(String s)
      {
      OAViewObjectImpl oaviewobjectimpl = (OAViewObjectImpl)findViewObject("ProductServicePVO");
      if(oaviewobjectimpl != null && oaviewobjectimpl.isPreparedForExecution())
      {
      Row row = oaviewobjectimpl.first();
      if(s.equals("ALLPSBTN"))
      {
      row.setAttribute("DISPLAY_ALLPS", Boolean.TRUE);
      row.setAttribute("DISPLAY_SPECIFICPS", Boolean.FALSE);
      } else
      if(s.equals("SPECIFICPSBTN"))
      {
      row.setAttribute("DISPLAY_ALLPS", Boolean.FALSE);
      row.setAttribute("DISPLAY_SPECIFICPS", Boolean.TRUE);
      }
      }
      }


      I had done the Controller extension and written follwing code in process request.
      super.processRequest(oapagecontext, oawebbean);
      OAApplicationModule oaapplicationmodule = oapagecontext.getApplicationModule(oawebbean);
      oracle.jbo.ViewObject viewobject = oaapplicationmodule.findViewObject("ProductServicePVO");
      oapagecontext.writeDiagnostics(oapagecontext,"Event 1",4);
      Row row = viewobject.first();
      oapagecontext.writeDiagnostics(oapagecontext," Event 2",4);
      row.setAttribute("DISPLAY_ALLPS", Boolean.FALSE);
      oapagecontext.writeDiagnostics(oapagecontext,"Event 3",4);
      row.setAttribute("DISPLAY_SPECIFICPS", Boolean.TRUE);
      oapagecontext.writeDiagnostics(oapagecontext," Event 4",4);----but it didn't work

      Can you Please help me on this how can I achieve this requirement .


      Thansk & Regards,
      Arun

      Edited by: 932789 on May 8, 2012 7:25 AM