Show TOC Start of Content Area

Background documentation Action Types  Locate the document in its SAP Library structure

Web Dynpro provides two action types for the description of actions.

Validating Actions

The event handler of a validating action is only called after all user data entered is validated, the validated data is passed to the context, and the data entered is also valid.

The event handler of a validating action assumes that:

·        The data saved in the context is valid

·        The data saved in the context matches the data entered by the user

·        Using the event handler of a validating action, the system can:

·        Trigger navigation links by calling an outbound plug

·        Use the data saved in the context for other processes. If they are bound to a UI element, they are visible to the user.

·        Call a Web Dynpro Message Manager to display error messages or throw exceptions that originate from a WDNonFatalRuntimeException.

Example of a Validating Action

The source code of a typical event handler of a validating action:

/** declared validating event handler */

   public void onActionSave(IWDCustomEvent wdEvent )

   {

     //@@begin onActionSave(ServerEvent)

     this.getSomeOtherContoller.Save();

     this.wdThis.wdFirePlugAddresseSaved();

     //@@end

   }  

Non-Validating Actions

The event handler of a non-validating action is called before the user data entered is validated and the validated data is passed to the context.

Note

The event handler of a non-validating action is also called if the invalid data was already entered. This ensures that the event handler of a non-validating action is called without checking whether the user entries are valid.

The event handler of a non-validating action must be capable of processing invalid data saved in the context. To check the validity of the context data, the IWDComponent interface provides the getValidationCheck() method. The method returns an instance of IWDValidationCheck.

The IWDValidationCheck interface makes available methods, with which you can check the validity of the context data.

The event handler of a non-validating action can both write the values to the context and read values from the context.

Use

Non-validating actions are used when the user quits an application, for example, because otherwise the user remains in the application if the entries are invalid. In addition, you can use it to reset the entries in all fields of a view at runtime.

Determining a Non-Validating Action

To define an action as a non-validating action, you must select the checkbox “Without validation” when creating the action and save this setting.

This graphic is explained in the accompanying text

Example of a Non-Validating Action

The source text of a typical event handler of a non-validating action resets the control context of a view and could be written as follows:

public onActionClear(IWDCustomEvent wdEvent )

   {

     //@@begin onActionClear(ServerEvent)

     //Initialize this view’s context

     this.InitializeContext();   

     //@@end

   }

Note

The application developer must implement the InitializeContext method on the same level as the Web Dynpro component.

  

  

 

End of Content Area