cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding dynamic creation of events

Former Member
0 Kudos

I hv created tables, context, and d buttons dynamically.......

each table has got its own button n context..... but event is 1ly 1........

wen i lick on a button of particular table i want operations to be performed on tat particular table, for tat i need to tel d EVENT tat,

which table( i.e. which context)...

hw to pass d dynamically created context names to events????/

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

You can do one thing since there are three buttons you can make 3 different methods for those buttons like onClickofButton1(), onClickofButton2(),onClickofButton3(). Now what you need to do is call the event from these method by giving the parameter for event a value like for first button give the value 1 in the event similarly 2 and 3 for second and third. Now when you will writing the code for event you can put an if condition to give different logic for different buttons/table.

Regards,

Vivek

Private_Member_52584
Participant
0 Kudos

Hi,

You can map table with related context node element and write the table related code in the button which you have created.

Example code:

public void onActionOnUpload(com.sap.tc.webdynpro................)

{

IPrivate<ViewName>.I<node>element tab;

for(int i=0;i<=3;i++)

{

tab=wdcontext.create<;node>element();

tab.set<;attribute name>("value1");

tab.set<;attribute name>("value2");

"

"

"

"

wdcontext.node<;element>().addElement(tab);

}