cancel
Showing results for 
Search instead for 
Did you mean: 

Auto fire button/event Web Dynpro Java

Former Member
0 Kudos

Hello,

I want to fire a button automatically when we enter in a view, we are implementing the code in the "if(firsttime)" method.

The button id is "CostAssigment" and the event is || public final static String EVENT_COSTASSIGNMENT = "sap.xss.tra.event.costassignment" || and it fires the following action:

-


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

{

//@@begin onActionCostAssignment(ServerEvent)

LOGGER.traceEnter("onActionCostAssignment");

wdThis.wdGetFcTraUtilsInterface().viewValidation(wdControllerAPI).validate(true);

wdComponentController.raiseFPMEvent(TravelConstants.EVENT_COSTASSIGNMENT);

wdThis.wdGetAPI().requestFocus(wdContext.currentDetailsDataElement(),wdContext.nodeDetailsData().getNodeInfo().getAttribute(IDetailsDataElement.EDITOR));

LOGGER.traceExit("onActionCostAssignment");

//@@end

}

-


We have used the following code in other view where we wanted make the same (auto fire button) and runs OK but in this view this solution don't run:

-


wdThis.wdGetVcTreReceiptsTableController().raiseFPMEvent(TravelConstants.EVENT_COSTASSIGNMENT);

-


How can fire automatically the button and event or run the inside source code?

Best Regards and thanks in advance.

Pablo.

Accepted Solutions (1)

Accepted Solutions (1)

former_member197348
Active Contributor
0 Kudos

Hi Pablo,

If we want to fire any method or event automatically, we should use in wdDoInit() if it is a default view (i.e. Start view)

or use in onPlugFrom<Xview>() if it is navigated from Xview;

regards,

Siva

Former Member
0 Kudos

Hi Siva,

You are right, in the wdDoInit() method all runs Ok.

Many thanks.

Pablo.

Answers (0)