cancel
Showing results for 
Search instead for 
Did you mean: 

Edit a DropDownByIndex field in a Table

Former Member
0 Kudos

Hi,

i use a DDBI in a Table. How can i make this field editable?


	 String[] ddbi = new String [] { "value1", "value2" };
	  
	  List lDdbiList = new ArrayList();
	  
	  for (int i =  0; i < ddbi.length; i++) {

		  IDDBIElement ddbiElem = wdContext.createDDBIElement();
		  ddbiElem.setText(ddbi<i>);
		  lDdbiList.add(ddbiElem);
	  }	  
	  
	  wdContext.nodeDDBIr().bind(lDdbiList);
	  
	  wdContext.nodeDDBI().setLeadSelection(-1);		

regards,

Sid

Accepted Solutions (1)

Accepted Solutions (1)

Qualiture
Active Contributor
0 Kudos

What do you mean by 'editable'?

Are you not able to select a value from the dropdown, or do you want to manually enter text in the field, in addition to the already available selections?

Former Member
0 Kudos

Hi,

yes i want to enter manually a text into the DDBI field in addition to the already available selections.

I try it also with this code, but it doesn't work.

NodeProperties:

collection cardinality: 0..n

initialize leadselection: true

selection cardinality: 1..n

singleton: true

Typed Acces required: true



		IDDBI_SeriennummerElement ele = null;			
		ele = wdContext.createDDBI_SeriennummerElement();
		ele.setText("Field 1");
		wdContext.nodeDDBI_Seriennummer().addElement(ele);

regards,

Sid

Qualiture
Active Contributor
0 Kudos

Hi,

I don't think there is a way of achieving this when using a DropDownByIndex (or -Key) UI element...

If you're on NW 7.02 or above, I would go with a simple InputField instead and set the 'suggestValues' accordingly (Your NWDS will actually have a code snippet which will iplement this for you)

This way, your inputfield looks like a dropdown UI element, and behaves like a suggestion or auto-complete when entering text

Best,

Robin

Former Member
0 Kudos

Hi Robin,

i will try it with the 'suggetValue' but what do you mean with "Your NWDS will actually have a code snippet which will iplement this for you" where can i get the code snippet within NWDS?

regards,

Sid

Qualiture
Active Contributor
0 Kudos

If you're using NWDS 7.1 or above, it will have a view called 'Snippets'. Under 'Web Dynpro UI Snippets', there is an item 'Configurable Dropdown' which is what I was referring to

Hope this explains

Robin

Answers (2)

Answers (2)

former_member185879
Active Contributor
0 Kudos

Hello Sid,

Is there any specific reason you are going to DDBI? You can try DDBK in table, Because if you DDBI in table, then the values of 1st element will be copied to other elements also if you select. But DDBK will avoid this, we dont want do anything extra like get the current value and pass it if we use DDBK.

try and reply.

Regards

Nizamudeen SM

Former Member
0 Kudos

Hi,

Did you chk the cardinality ?

Set it to 1:n

Regards,

Vijay.

Former Member
0 Kudos

Hi Vijay,

i set the cardinality to 1:n but cannot edit the DropDownByIndex UI.

my code


		String ddbi = wdThis.wdGetAPI().getTextAccessor().getText("comp1");
		
		List lDdbiList = new ArrayList();
		  
		IDDBI_SeriennummerElement ddbiElem = wdContext.createDDBI_SeriennummerElement();
		ddbiElem.setText(ddbi);

		lDdbiList.add(ddbiElem);
  		  
		wdContext.nodeDDBI_Seriennummer().bind(lDdbiList);

Do you have an idea?

Best regards,

Sid

Former Member
0 Kudos

Hi Sid,

Can you try this way ?

IPrivate<view>.I<Contextnode>Element ele = null;
for(int i=0;i<<Contextnode>.size();i++)
{
ele = wdContext.create<Contextnode>Element();
ele.set<attribute>(<list value>);
wdContext.node<Contextnode>.addElement(ele);
}

I guess the last line should have addElement(ddbiElem)

Regards,

Vijay.

Former Member
0 Kudos

Hi Sid,

Can you try this way ?

IPrivate<view>.I<Contextnode>Element ele = null;
for(int i=0;i<<Contextnode>.size();i++)
{
ele = wdContext.create<Contextnode>Element();
ele.set<attribute>(<list value>);
wdContext.node<Contextnode>.addElement(ele);
}

I guess the last line should have addElement(ddbiElem)

Regards,

Vijay.