3 Replies Latest reply: Apr 6, 2012 5:20 AM by Abhijit Dutta RSS

    row insertion problem

    917633
      Hi Team,
      I want to show a table in UI wherein headernames and data are dynamic. I have a requirement like i will have one resultset wherein one of the rows i will have table headers and in some other rows i have data for the columnheaders. So from ApplicationModule impl class i used one method and prepared resultset...then i had taken 2 lists one for adding headernames and data in another List. Next i had created one viewObject not based on any entities....in the same method in Appl Mod impl class i had written below code for inserting the data to VO

      ViewObject vo = this.getSampleViewObj1();
      Row last = vo.last ();
      NameValuePairs nvps = new NameValuePairs ();
           if (vo != null){
      vo.addDynamicAttribute(headerlist.get(i).toString().replace(" ", ""));
      }
           for(int z=0;z<headerlist.size();z++){
      nvps.setAttribute (headerlist.get(z).toString(), ColumnList.get(z));
      vo.insertRow (vo.createAndInitRow (nvps));
      }
           getTransaction ().commit ();

      With this i am able to get the headernames in UI but i was getting empty data for the columns....even tried adding hardcoded values like nvps.setAttribute (headerlist.get(z).toString(), "10"); Still i am getting empty data with headernames showing up...So please suggest if i missed anything.

      Thanks in Advance for your Help....