Skip to Content
Author's profile photo Former Member

Web Dynpro Tip: Using the ValueSupplier to have a ValueSet and free text input

Here is a short tip on the IWDValueSupplier and what it can be used for.


Web Dynpro input fields are very powerfull. When you bind a Context Attribute of type date the input field will show a small button to show a calendar. If the datatype of the attribute has a valueset assigned you will have the F4 help that enables you to choose values from list.


The validation works automatically. That means depending on the datatype and its meta data (textservice, valueservice) the input of the field is validated. Example if it is a date field only dates are allowed and if it has a Valueset (called enumeration in the java dictionary) only values are allowed that are contained in the valueset.  

The Problem

You want to offer the user a list of predefined values BUT also allow him to enter a value that is NOT in the valueset. The problem is whenever you execute a validating action in that view, Web Dynpro will mark that field in red and tell you that this value is not contained in the list of values. So how can you provide the user with a valuehelp without limiting the entry of free text?

The Solution

 The solution is that you either change all action to “not validating” which I find a very ugly solution. The better solution is to implement a IWDValueSupplier yourself, where  you can control the Valueset and the check method (contains(obj)) and override them to your needs.


Here is an example of a ValueSet that allows you to enter free text:


The second step is to bind this ValueSupplier to a specific attribute in the Context.


This ValueSupplier can of course be enhanced. For example you can implement a ValueSupplier that fills its values depending on another value in the Context or you can do a lazy loading value supplier that loads the valueset ondemand from the database. There you can implement filter functionality yourself etc. 


I came across this solution together with Reto Badertscher of Holcim AG. Thanks also to Bertram Ganz and Valery Silaev for their many Weblogs, inspiration and hints in the forum.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      Hi David:

      Your blog is very nice and informative, even when I'm not into WebDynpro for Java -;) But...Second box of code is kinda short...Could you make it bigger??? It would be easy for others to read it -:)



      Author's profile photo Former Member
      Former Member
      Thanks for the hint. You suggestion is implemented 🙂
      Author's profile photo Former Member
      Former Member
      I really like this hack!

      Standard EVS accept the key only with exact case. I have been looking for a clean way  to accept direct input without case.
      public boolean contains(Object aKey) {
           Set keys = values.keySet();
           for (Iterator iter = keys.iterator(); iter.hasNext();) {
                String key =  (String);
                     if(key.equalsIgnoreCase((String)aKey)) {
                          return true;
                      return false;