cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the TableRowCreator

Former Member
0 Kudos

Hi friends

I'm trying to use the TableRowCreator but without any success.

Can you please show me the basic steps or any other helpfull link.

Thanks a-lot

Shai

Accepted Solutions (1)

Accepted Solutions (1)

former_member200477
Participant
0 Kudos

Hi

Please see the Link. It might be helpful.

http://help.sap.com/saphelp_nw73/helpdata/en/47/013d23968321bde10000000a114a6b/content.htm

Thank you

Navya

Former Member
0 Kudos

Thanks Navya

The point I didn't understand is what to do in the eventHandler.

Does anyone have a code example?

ErvinSzolke
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

here you go:

I created a table context:

Then I created a Table UI for it. I also added a RowCreator

I initialized the table this way:

public void wdDoInit()

  {

    //@@begin wdDoInit()

   IPrivateRCCompView.IT1Element tab;

    

     for (int i =0;i<10;i++) { 

      tab = wdContext.nodeT1().createT1Element(); 

       tab.setA1("text"+i); 

      wdContext.nodeT1().addElement(tab); 

     } 

    //@@end

  }

Then I added this code to the Event (I called it simply "create") of the RowCreator:

  public void onActionCreate(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

  {

    //@@begin onActionCreate(ServerEvent)

   IPrivateRCCompView.IT1Element tab;

   tab = wdContext.nodeT1().createT1Element(); 

      tab.setA1("text"+wdContext.nodeT1().size()); 

      wdContext.nodeT1().addElement(tab); 

   wdComponentAPI.getMessageManager().reportSuccess("elem added");

    //@@end

  }

It works this way in runtime:

After invoking the app:

Once I click on the last line the following happens:

I hope this helps.

Regards,

Ervin

Former Member
0 Kudos

Thanks

I thought there is more to it

it's the same as having a button wih a plus sign in it next to the table that adds a new empty row when clicking it (only that the button solution is more user friendly ).

ErvinSzolke
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

I am sure there are scenarios where this can be used, for instance when there are many many columns with inputfields of which many can be prefilled once this rowcreator button has been pushed and the rest of the inputfields inside the table can be filled manually. Not sure this is the best example, but I am sure there are other situations when one can make a good use of this feature.

Regards,

Ervin

Answers (0)