
To assign an action to a UI element, you must create the action in the SAP NetWeaver Developer Studio, bind it to the UI element, and manually implement the event handler in the controller of the corresponding view.
The Web Dynpro generator automatically creates the event handler. If you assigned the name Save to the action, the corresponding event handler is onActionSave (see graphic below).
/** declared event handler */
public voidonActionOnClear()
{
//@@begin onActionOnClear(ServerEvent)
wdContext.currentNodeSearchElement().setEmployee_Id("");
wdContext.currentNodeSearchElement().setFstname_M("");
wdContext.currentNodeSearchElement().setLastname_M("");
wdContext.currentNodeSearchElement().setOrgtxt_Lg("");
wdContext.currentNodeSearchElement().setRoom_No("");
//@@end
}
/** declared event handler */
public voidonActionOnSearch()
{
//@@begin onActionOnSearch(ServerEvent)
wdThis.NavToResults();
//@@end
}
/** declared event handler */
public void onActionSave()
{
//@@begin onActionSave(ServerEvent)
//@@end
}
//@@end
}You have defined an action at design time and bound it to a UI element.