10 Replies Latest reply: Jun 16, 2013 3:52 AM by 1010810 RSS

    Add a new column in search table SERIAL_NUMBER that remains 1-10 everytime

    1010810
      Hi All,
      I need to add a column SERIAL_NUMBER to search table and what i want is that it should display 1-10 on every page.I press Next and it should again show Sr No. 1-10.
      For this i added a transient variable to the SearchVO and the CO code for Table region is as follows :-
      public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
      {
      super.processFormRequest(pageContext, webBean);
      SearchAMImpl am= (SearchAMImpl)pageContext.getApplicationModule(webBean);
      SearchVoExImpl vo=(SearchVoExImpl)am.getSearchVoEx();
      SearchVoExRowImpl searchRow=(SearchVoExRowImpl)vo.first();
      searchRow.setSerial(new Integer(1));
      while(vo.hasNext())
      {
      if(searchRow.getSerial().intValue()==11)
      searchRow.setSerial(new Integer(1));

      int i=searchRow.getSerial().intValue();
      Integer p=new Integer(i+1);
      searchRow=(SearchVoExRowImpl)vo.next();
      searchRow.setSerial(p);
      }
      }

      The problem i am facing with this is when i sort the result table using any column the Serial Number gets disappeared.
      And also when i press Go button for searching it shows me the end results first.
      Please help me out.