cancel
Showing results for 
Search instead for 
Did you mean: 

Firing the custom event dynamically

Former Member
0 Kudos

Hi All,

is it possible to fire the cutomevent IWDCustomEvent dynamically.Basically i have 2 buttons with their actions, on clicking buttonA it does some logicA and when somecondition is met it should also do buttonB Action without userinteraction on buttonB

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

{

//@@begin onActionAddPlan(ServerEvent)

wdComponentAPI.getMessageManager().reportSuccess("button 1 clicked:");

if(conitionismet)

{

it should dynamically call the onActionButtonB, for this how can i pass IWDCustomEvent instance

}

//@@end

}

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

{

//@@begin onActionAddPlan(ServerEvent)

wdComponentAPI.getMessageManager().reportSuccess("buttonaction);

//@@end

}

i cannot put the same LogicB inside the condition of if(conitionismet) of onActionButtonA.

So is it possible for fire an event onaction of a button dynamically without user interaction.

Thanks,

pkv

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can just execute your function inside the "IF" clause:


public void onActionButtonA(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionAddPlan(ServerEvent)
wdComponentAPI.getMessageManager().reportSuccess("button 1 clicked:");

if(conitionismet) {
onActionButtonB(wdEvent);
}

//@@end
} 

public void onActionButtonB(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionAddPlan(ServerEvent)
wdComponentAPI.getMessageManager().reportSuccess("buttonaction);


//@@end
}