Skip to Content
Author's profile photo Former Member

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

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      Hello David
      You have come up with a really handy and helpful utility. kudos to you.
      Kapil S Kamble
      Author's profile photo Former Member
      Former Member
      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)

      Author's profile photo Former Member
      Former Member
      Thanks, I appreciate any suggestions.
      Author's profile photo Former Member
      Former Member
      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
      Author's profile photo Former Member
      Former Member
      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;

      Author's profile photo Former Member
      Former Member
      Author's profile photo Former Member
      Former Member
      very nice tool! Makes life really easier 🙂
      Author's profile photo Lev Kulaev
      Lev Kulaev
      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?
      Author's profile photo Former Member
      Former Member

      Try this zip. It contains the OVSBuilder classes for 7.1 maybe it also works for 7.2. Unfortunately I have no 7.2 version I could check against.


      Author's profile photo Lev Kulaev
      Lev Kulaev
      Hello, David! Thank you for quick reply! Unfortunately new version has no effect. I've even placed OVSBuilder extension class in the component controller but the  error is the same: values entered into input fields in OVS screen don't take effect in query, result values are not shown in result table but passed to the main screen by applyResult.
      Author's profile photo Former Member
      Former Member

      Hmh, but no compile error occurred. Please write me an email maybe we can sort this out: david.beisert I need additional info.