cancel
Showing results for 
Search instead for 
Did you mean: 

DropDownByIndex

Former Member
0 Kudos
	String[] letters = new String []
	{"A", "B", "C", "D"};
   // Create context elements for the node "X"
<b>   List nodeElements = new ArrayList();</b>	for (int i =  0; i <letters.length; ++i)
	{
	   IPrivateFirst_View.IXElement xElement = wdContext.createXElement();
	   xElement.setY(letters<i>);
	   nodeElements.add(xElement);
	}
   // Bind node element list to the node
	wdContext.nodeX().bind(nodeElements);
   // Set node’s lead selection which determines the selected item
	wdContext.nodeX().setLeadSelection(1);

This is the code I have written for the dropdown box.

But I am getting and error for the line "List nodeElements = new ArrayList();</b> for (int i = 0; i <letters.length; ++i)" saying

"List can not be resolved or is not a type,

Arraylist cannot be resolved or is not a type"

Please help me with this.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Supriya,

Just right click on List and say source-->organize imports and select jawa.util.List and the error would be solved.

Regards,

Murtuza

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks a lot to you guys<b>.:)</b>

Greg_Austin
Active Participant
0 Kudos

Organize your imports with CtrlShiftO and the needed imports will be added for you.

Former Member
0 Kudos

Could you explain the process to me.I am a complete newbie to Java Webdynpro Austin.

Greg_Austin
Active Participant
0 Kudos

This is a Java thing that is not specific to Web Dynpro. The error is saying that the compiler doesn't know what an ArrayList and List are. You have to tell it where these classes are defined. Since these are standard Java classes just organizing your imports will add the line

import java.util.List

to your code to tell the compiler where it can find the definition for List. Organizing imports is a feature of eclipse that NWDS is built upon. Just push CtrlShiftO or right click on your code go to the Source menu and choose Organize Imports.