0 Replies Latest reply: Jan 31, 2013 3:12 AM by user608535 RSS

    Getting Null while trying to printhe column value entered in advanced table

    user608535
      Hi All

      I am developing a OAF data entry form, which has advanced table region with LOV for each column.

      I have to validate the data entered in form. So initially I am trying to capture the values entered in form. I have written following code in CO.

      if(pageContext.getParameter("Save")!=null)
      {
      // OAApplicationModule am = pageContext.getApplicationModule(webBean);
      String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
      OAViewObject vo = (OAViewObject)am.findViewObject("GlobalSourcingMatrixVO1");
      int j = vo.getFetchedRowCount();
      System.out.println(String.valueOf("Fetched row count ").concat(String.valueOf(vo.getFetchedRowCount())));
      this Retuns 1
      String a=String.valueOf(vo.getCurrentRow().getAttribute("Configuration")).concat(String.valueOf(""));
      System.out.println("Value: "+a);
      This returning null
      }
      ------------------------------------------------------------------------------------------------------------------

      I tried folleowing code also

      if(pageContext.getParameter("Save")!=null)
      {
      // OAApplicationModule am = pageContext.getApplicationModule(webBean);
      String[] as = null;
      String[] vNumber = null;
      String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
      OAViewObject vo = (OAViewObject)am.findViewObject("GlobalSourcingMatrixVO1");
      int j = vo.getFetchedRowCount();
      try
      {  
      System.out.println("abouce try");

      vo.reset();
      if (vo.getFetchedRowCount() > 0)
      {  
      System.out.println(String.valueOf("Fetched row count ").concat(String.valueOf(vo.getFetchedRowCount())));
      int i = 0;
      as = new String[j];
      vNumber = new String[j];

      while (vo.hasNext())
      {  
      vo.next();

      System.out.println(String.valueOf("Inisde the do while loop").concat(String.valueOf(i)));

      vNumber[i] = String.valueOf(vo.getCurrentRow().getAttribute("Configuration")).concat(String.valueOf(""));
      as[i] = String.valueOf(vo.getCurrentRow().getAttribute("ProductGroup")).concat(String.valueOf(""));
      System.out.println("Output"+as[i] +vNumber);
      i++;
      }


      //System.out.println(String.valueOf("Fetched row count ").concat(String.valueOf(vo.getFetchedRowCount())));
      //String a=String.valueOf(vo.getCurrentRow().getAttribute("Configuration")).concat(String.valueOf(""));
      //String b=(String)vo.getCurrentRow().getAttribute("Configuration");
      //System.out.println("Value: "+a);
      //System.out.println("Value1: "+b);
      am.save(pageContext);
      }
      }catch (Exception exception)
      {  
      throw new OAException("unable to print the records",OAException.WARNING);
      }

      }

      Still the output retuning null
      abouce try

      Fetched row count 1
      Inisde the do while loop0

      Outputnullnull

      But records are saved successfully
      ---------------------------------------------------------------------------------------------------

      Can someone assist why it is printing null for column Configuration?

      Thanks in advance.

      Srini

      Edited by: user608535 on Jan 30, 2013 11:53 PM

      Edited by: user608535 on Jan 31, 2013 1:10 AM