Skip to Content

Web Dynpro: the OVSBuilder utility or OVS Re-Reloaded

h2. Motivation  The Web Dynpro Object Value Selector is a generic API to add a Search Help to an input field.imageIn contrast to the Extended Value Selector you can define the fields that provide Search input and the result structure yourself. From the input and output structure a search popup is dynamically created. In my opinion it is feasible for simple searches that are a more complex than just searching a key out of a valueset. The biggest problem is that you have very little control over the layout of the search popup why I think it should not be overused. Nevertheless for simple searches it really serves the purpose. There are plenty examples and tutorials on how to program an OVS. I just always found the API too tedious to be usefull. That is why I collected some pieces and advices from other tutorials and blogs and made up a very small helper library that makes creating OVS searches much easier. h2. The basics The OVS search needs a definition of an search input  and search result structure.image
You must be Logged on to comment or reply to a post.
  • However, I have some suggestions to your post:
    1. Make addProperty method of both InputInfo and ResultInfo to return InputInfo/ResultInfo itself. This is very common pattern for builders (see java.lang.StringBuffer for example) and allows to chain invocations:
      .addProperty("id","Customer ID",Integer.class)
      .addProperty("lastName","Last Name",String.class)
      .addProperty("firstName","First Name",String.class)
    2. Probably it’s a good idea to add generic applyResult implementation, at least in custom subclass:
    public class public class CustomerOVSBuilder extends BaseOVSBuilder {
      private String nodeAttrName, modelAttrName;

      public CustomerOVSBuilder() {this(null, null);}

      public CustomerOVSBuilder(String nodeAttrName, String modelAttrName) {
        this.nodeAttrName = nodeAttrName;
        this.modelAttrName = modelAttrName;

      public void applyResult(
        IWDNodeElement inputElement,
        ICMIGenericModelClass resultBean) {

        if (null == nodeAttrName || null == modelAttrName)
          throw new IllegalStateException(“Both nodeAttrName and modelAttrName must be defined via constructor or applyResult method must be overridden”);

        inputElement.setAttributeValue(      nodeAttrName,resultBean.getAttributeValue(modelAttrName)

  • Hello David.
    I was trying out your OVS Builder sans hard coded MyDummyDAO. I m stuck.
    I have a web service which gives me data and I want to apply this OVS on one of the attributes.
    So, wanted to know how can your OVS builder be implemented to consume data from back-end ?
    I hope the scenario described me is clear. If not, please reply.
    Thanks and Regards
    Kapil S Kamble
    • Hi Kapil,

      actually it works just the same, as with the DAO.
      Given you have a similar WS ( I am just too lazy now to create one so this is hypothetical).

      public Collection search(ICMIGenericModelClass inputBean) {
      String lastName = (String)inputBean.getAttributeValue("lastName");
      Request_GetCustomers req = new Request_GetCustomers();
      SearchInput inp = new SearchInput();
      return req.getResponse().getResult();

           return dao.findCustomers(id,lastName,firstName,gender,money);

      * The Collection returned by search is iterated and for each element in the Collection
      * this method is called that enables you to convert your Object from the query to
      * a generic CMI Bean that the OVS expects.
      public void transformResult(Object resultObject, ICMIGenericModelClass resultBean) {
           Customer c = (Customer)resultObject;

  • Hello David!
    This is a really fantastic tool! It working fine in 7.0 (former nw2004s). But we have a problem in 7.2. We migrated our components from 7.0 to 7.2 and now OVS working strange - OVS doesn't take into account input values and doesn't show result values but apply result is working. How we can esolve this error?