on 09-10-2007 2:35 PM
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 nodes 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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot to you guys<b>.:)</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Organize your imports with CtrlShiftO and the needed imports will be added for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.