2 Replies Latest reply: Jan 8, 2013 12:34 AM by User10539027-Oracle RSS

    How to change default value of a picklist

    931633
      Hello all,

      I have a requirement to change the default value of a seeded pick list from Supplier to Site. When I change the default value to site, another field should appear beside it. I have achieved this by extending the controller and the functionality is working. But, when the page loads, it is displaying the bank accounts assigned to Supplier even though the picklist is defaulting to Site.

      The desired functionality is to default the selected value to Site and show the other field(DISPLAY_SITE) and the page should display the bank accounts assigned to the site.

      Here is my code:

      public class XxgsByrMainCO extends ByrMainCO {
      public void processRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
      {

      super.processRequest(paramOAPageContext, paramOAWebBean);
      OAApplicationModule am;
      am = paramOAPageContext.getApplicationModule(paramOAWebBean);

      Number localNumber = SupplierUtil.getPartyId(paramOAPageContext);
      String vendorNumber = SupplierUtil.getSupplierNumber(paramOAPageContext);

      if(!vendorNumber.substring(0,1).equals("E"))
      {
                
      OAViewObject vo = (OAViewObject)am.findViewObject("ByrMainPVO");

      OARow row=(OARow) vo.getCurrentRow();
      row.setAttribute("CurrentSelection", "SITE");
      row.setAttribute("DISPLAY_SITE", Boolean.TRUE);
      }
      else
      {                           
      OAViewObject vo = (OAViewObject)am.findViewObject("ByrMainPVO");

      OARow row=(OARow) vo.getCurrentRow();
      row.setAttribute("CurrentSelection", "SUPPLIER");

      }

      }
      }

      Please advice.

      Thanks all,
      Syed

      Edited by: 928630 on Jan 3, 2013 1:55 AM