cancel
Showing results for 
Search instead for 
Did you mean: 

DropDownbyKey Emty Space in middle of values

Former Member
0 Kudos

Hi Friends,

I am populating values using DropDownByKey using RFC FM. every things works fine but in the middle of values it's giving an empty space. I found some answers in the forum changing the cardinality from 0..1 or 1..1 should fix this issue. but I need any empty sapce as first value in the dropdownbykey bot not in middle.

Example: Say i am populating 3 values like : London, Dublin, Frankfurt

but my dropdown displying as follows: London, Dublin, < empty Space>, Frankfurt

Here the empty Space suppose to be the first value in the DropDownByKey but in between.

I want to display like here: < empty Space>, London, Dublin, Frankfurt

I am this code:


IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute(IPrivateCountryView.IContextElement.COUNTRY);
	ISimpleTypeModifiable valuesType = attributeInfo.getModifiableSimpleType();

	valuesType.setFieldLabel("Country Name");
	IModifiableSimpleValueSet valuesSet = valuesType.getSVServices().getModifiableSimpleValueSet();
	int countryNodeSize = wdContext.nodeCountry_Help().size();
	valuesSet.put("", "");
	for (int i = 0; i < countryNodeSize; i++)
	{		 
		valuesSet.put("" + wdContext.nodeCountry_Help().getCountry_HelpElementAt(i).getLow(), "" + wdContext.nodeCountry_Help().getCountry_HelpElementAt(i).getText());
	} 
	



 

Thanks in advance.

Peter.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If you already have the drop-down list texts in context node elements you could just use a DropDownByIndex UI element and bind the "texts" property to attribute "Country_Help.text". To get an empty entry, set the selection cardinality of node "Country_Help" to 0:1.

Armin

Answers (4)

Answers (4)

Former Member
0 Kudos

Armin,

Many thanks, this is resolved.

Thanks.

Peter.

Former Member
0 Kudos

Nikhil,

Thanks for your reply.

When I add the code which you sent me is duplicating the top value and still the empty sapce in middle of the values.

I am not able to get rid of that empty sapce some how. If the empty space is on top in the DropDownByKey values that is fine for me but it's creating in middle of it.

Thanks

Peer.

Former Member
0 Kudos

Prajakta,

Thanks fpr quick reply.

Values are coming fine from the backend, Every thing works perfect expcet the empy sapce in between, How to get rid of that empty space?

Peter

nikhil_bose
Active Contributor
0 Kudos

please try this code


IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute(IPrivateCountryView.IContextElement.COUNTRY);
	ISimpleTypeModifiable valuesType = attributeInfo.getModifiableSimpleType();
 
	valuesType.setFieldLabel("Country Name");
	IModifiableSimpleValueSet valuesSet = valuesType.getSVServices().getModifiableSimpleValueSet();
	int countryNodeSize = wdContext.nodeCountry_Help().size();

	for (int i = 0; i < countryNodeSize; i++)
	{	
	     if (i ==0) valuesSet.put("", "");	 
             else { 
		valuesSet.put("" + wdContext.nodeCountry_Help().getCountry_HelpElementAt(i).getLow(), "" + wdContext.nodeCountry_Help().getCountry_HelpElementAt(i).getText());
             }// if (i==0)
	} 

nikhil

Former Member
0 Kudos

Hi,

First check that whether the values coming from backend are proper or not.Values in backend need to be separated by semicolon and not a comma.

Then for the dropdown nodes set cardinality as 0:N and selection cardinality as 0:1.

Thanks,

Prajakta