cancel
Showing results for 
Search instead for 
Did you mean: 

How to call server event in DO INIT method of view

Former Member
0 Kudos

Folks,

I have declared a server event in the view and when I am trying to call that event in DO INIT method of view , it is not firing the event .

<i><b>

public void wdDoInit()

{

//@@begin wdDoInit()

// set icon file names

wdContext.currentContextElement().setIconLeftArrow("topLvlScrollerLeft.gif");

wdContext.currentContextElement().setIconRightArrow("topLvlScrollerRight.gif");

// hide display when errors during startup

if(wdContext.currentContextElement().getErrorDuringInit())

{

wdThis.wdFirePlugOutEmpty();

};

wdThis.wdGetDaylyChangeModeAction();</b></i>

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You are not calling the event handler method. Try this:

//This returns an IWDAction - doesn't call it.
//wdThis.wdGetDaylyChangeModeAction(); 

//Call it like this
onActionDaylyChangeMode(null);

Regards,

Satyajit.

Former Member
0 Kudos

I think that way you get the action but you are not firing the event. To do this you can make a method in the controller called for example fireXXXAction() and in that method fire the event with wdThis.firexxxx().

Now you just have to call this method from the view in which you want to fire the controller event.

Message was edited by:

Eduardo Cabezas López

Former Member
0 Kudos

I have created a action event

<i><b> public void onActionDaylyChangeMode(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionDaylyChangeMode(ServerEvent)

wdThis.wdGetVcCatRecordEntryInterfaceController().blcEvent(VcCatRecordEntry.ACTION_CHANGE_MODE);

wdContext.currentContextElement().setSelectedTab("TabCatRecordEntryDay");

wdContext.currentContextElement().setTemp("Changed Tab");

//@@end

}</b></i>