Show TOC

Providing Search Result Value Lists (OVS)Locate this document in the navigation structure

Use

You can embed input help that provides a user interface (UI) for searching values in the SAP R/3 backend or Adaptive Web Services or Enterprise JavaBeans. This input help is referred to as Object Value Selector (OVS). Unlike the SVS and EVS, the OVS is not entirely based on a declarative approach. To embed this input help in your Web Dynpro application, you have to implement some lines of code in a corresponding OVS custom controller. In return, the Web Dynpro runtime automatically renders a generic OVS helper UI. By default, it consists of the following parts:

  • button next to those UI elements, that you define as OVS enabled

    The user starts the OVS help UI for the input field by clicking this button.

  • dialog box containing

    • input fields for defining search criteria

    • button to start the search query

    • table that contains the search result

You can modify this default helper UI or embed your own dialog implementation.

More information: Modifying Helper UI

An OVS helper context is used to store the OVS search input and output data. The attributes in these context nodes determine which input fields and which table columns are displayed in the OVS helper UI.

OVS Context Notification Listener

The OVS uses a listener implementation of the interface IWDOVSContextNotificationListener . This listener implements three hook methods, which act as event handlers and are called at three separate points in time:

  • when the user chooses the OVS helper button for a field ( applyInputValues() )

    You copy application context data to the OVS search query context

  • when the user triggers the search query ( onQuery() )

    You copy search results to the helper context node and thus fill the search result table

  • when the user selects a row in the search result table ( applyResult() )

    You copy the selected query context to the application context.

Prerequisites
Procedure

Preparing the Helper Context

  1. Create a custom controller.

    More information: Adding Custom Controllers

  2. In the custom controller context, create a model node referring to the imported model. Declare the following context elements:

    • Model node supplying the helper input fields for defining search criteria (OVS input node)

      All the input fields that the user needs to determine the search query, are automatically generated according to the attributes in this model node. The cardinality of the node should be either 0..1 or 1..1.

    • Subnode of the OVS input node for the helper search result table (OVS output node)

      This model node contains all attributes that make up the columns of the search result table. The cardinality of the node should be either 0..n or 1..n.

    More information: Binding Context to the Model

  3. In the wdDoInit () hook method of the custom controller, create a reference to the input model node. To do so, create a model object and bind the OVS input node to this object using the bind() method.

Implementing Listener Interface

  1. In the @@ begin others storage area of the custom controller implementation, create an inner class that implements the interface IWDOVSContextNotificationListener .

  2. Implement the event handler methods applyInputValues() , onQuery() and applyResult() of the interface.

  3. Instanciate the listener.

Providing Buttons for Calling the Helper UI

The button for calling the OVS helper UI automatically appears next to those input fields, whose context attributes are defined as OVS startup attributes.

  1. In the custom controller, create and implement the following methods:

    • two methods that return the OVS input and the OVS output node

    • method that returns the IWDOVSContextNotificationListener instance

  2. To define OVS startup attributes, in the wdDoInit() hook method of the view controller, add the OVS extension to the appropriate context attributes of the view context.