cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically adding a row to the table

Former Member
0 Kudos

Hello Everybody,

Can anybody suggest, how to add a row dynamically into the table, which is getting data from model node. We have a table getting populated from model node binded. In that table it will show different entries, after end of certain type of entries, we have to add a row Total which shows the addition of certain column values. And again the table has to move on with the next activity types and again after the end of certain activity type values, again we have to add all those similar activites and add a row to the table. My question is how to add a row to the table dynamically and that too this total whatever we are calculating, iam capturing into another value node. So, we have to show this value node as a row in between the table rows..

Thanks & Regards,

Ravi

Edited by: ravi shankar on Mar 29, 2009 7:56 AM

Accepted Solutions (1)

Accepted Solutions (1)

yogesh_galphade
Contributor
0 Kudos

Hi

You can assign one context parameter to the Table property rows, then in code you can check for the current no. of rows and also you can perform the desired operations.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi ravi,

write the following bold line code after excute method of rfc.

Assume Bapi_flight_Getlist Rfc.Here ur table populated model node Flight_List.



public void executeBapi_Flight_Getlist_Input( )
  {
    //@@begin executeBapi_Flight_Getlist_Input()
    //$$begin Service Controller(-649999560)
    IWDMessageManager manager = wdComponentAPI.getMessageManager();
    try
    {
      wdContext.currentBapi_Flight_Getlist_InputElement().modelObject().execute();
      wdContext.nodeOutput().invalidate();
    }
    catch(WDDynamicRFCExecuteException e)
    {
      manager.reportException(e.getMessage(), false);
    }
    //$$end

// *add new row in the table*

   	for(int i=0;i<wdContext.nodeFlight_List().size();i++)
{

 if(i==(wdContext.nodeFlight_List().size()-1))***
          {
IPublicFlightModelCust.IFlight_ListElement ctele1 = wdContext.createCtx_vn_usageElement();
*ctele1.set(take any column name)("Total");
                  wdContext.nodeCtx_vn_usage().addElement(ctele1);
                }
}    //@@end }  

Edited by: Abhilasha Dahare on Mar 30, 2009 1:18 PM

Edited by: Abhilasha Dahare on Mar 30, 2009 1:18 PM

Edited by: Abhilasha Dahare on Mar 30, 2009 1:20 PM

Former Member
0 Kudos

Hi Ravi,

you will create one context value attribute as tablesize in view/componentcontroller.

tablesize --TYPE must Be integer instead of using String.

tablesize attribute is binding into VisibleRowCount property of table.

// out put model size

int size=wdcontext.node<model>.size()

wdContext.currentContextElement().setTablesize(size);

thanks

jati