cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with value selector in WD Java

harald_kuersten
Employee
Employee
0 Kudos

Hi.

I have a view with an input field which is bound to a String node in the context. In the wdDoInit() of the component controller I query a database table to fill the values for a value selector for this field. Bear with me, please:


private void fillListWithMasterData(String category, String contextAttribute) {

// category needed for select in DB, contextAttribute is the name of the attribute for which
// we are filling the value selector

  try {
    MasterDataServiceHome mdmHome = MasterDataServiceLocator.getMasterDataServiceHome();
    MasterDataService service = mdmHome.create();
    MasterDataDTO[] masterData = service.getMasterData(category); //gets the entries from the DB

    if (masterData != null && masterData.length > 0) { // contains all the expected entries
      Properties dataAsProps = new Properties();

      for (int i=0; i < masterData.length; i++) {		
        String code = masterData<i>.getCode();
        String text = masterData<i>.getText();
        if (code != null && code.length() > 0)	{	
          dataAsProps.put(code, text);	
        }
      }

      wdContext.currentContextElement().setCampaignID(null);
      this.fillPickList(contextAttribute, dataAsProps);	
    } 	    
  }
  catch (Exception ex) {
    wdComponentAPI.getMessageManager().reportException(ex.toString(), true);
  }
}

private void fillPickList(String attribute, Properties data) {
  ISimpleTypeModifiable enumType = wdThis.wdGetAPI().getContext().getModifiableTypeOf(attribute);
  IModifiableSimpleValueSet enumSet = enumType.getSVServices().getModifiableSimpleValueSet();
  enumSet.clear();

  try {
    Iterator it = data.keySet().iterator();
    while (it.hasNext()) {
      String key = (String)it.next();
      String value = data.getProperty(key);
      enumSet.put(key, value);
    }

    enumSet.sort(false, true, false);
  } catch (Exception ex) {
    String message = "Exception in fillPickList: " + ex.toString();
    wdComponentAPI.getMessageManager().reportException(message, true);
  }
}

The value selector is rendered just fine, and as to be expected it shows two columns, one for the key and one with the corresponding values.

Unfortunately I somehow can't add screenshots here, so I will try to explain the actual problem:

one returned key-value pair is

key -> CRM-BRI-1

value -> CRM-BRI-TEST

I have debugged many times to find that this pair exists as described. Now one would expect that, were I to expand the value selector and enter "BRI" in the filter area for the key column, this key-value pair would be visible for selection? Not the case. Nothing is selectable. Instead, this happens only when I enter "bri" (in lower case).

Though, as mentioned, the items are in the IModifiableSimpleValueSet as described, I have tried toUpperCase() wherever possible - to no avail.

Does anybody have an idea?

Cheers,

Harald

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Following one may be of use for you /people/david.beisert2/blog/2007/10/11/web-dynpro-tip-using-the-valuesupplier-to-have-a-valueset-and-free-text-input

Regards

Ayyapparaj

Former Member
0 Kudos

Hi Harald,

Welcome to SDN!

What you want to know is, is it possible to filter value set with Input(so called EVS - Extended Value Selector) with out case?

Standard filtering allows search only with starting characters and with case. IMO, there is no way to write your own filtering method for that purpose. I'm badly looking for this functionality.

Cheers,

~kranthi