cancel
Showing results for 
Search instead for 
Did you mean: 

simple doubt - showing error

Former Member
0 Kudos

Hai..

I am beginner in Web-Dynpro and still learning. This coding is an example in PDF ..(related to context nodes)

My coding luk like this:-

public void wdDoInit() {

..//@@begin wdDoInit()

// Get a reference to the SalesOrders node

..ISalesOrdersNode soNode = wdContext.nodeSalesOrders();

..// Create a new element for node SalesOrders

ISalesOrdersElement newSoEl =

soNode.createSalesOrdersElement();

..//Use the attribute mutator methods to set the values

newSoEl.setDescription("Printer supplies");

newSoEl.setOrderNo(1000);

newSoEl.setSalesDate(new Date(System.currentTimeMillis()));

newSoEl.setSalesRep("Harry Hawk");

..//.Append the new element to the node's collection

soNode.addElement(newSoEl);

..//@@end.

when I am deploying and running an application..it is showing an error that

"ISalesOrderNode is not resolved or is not a type".

How should I declare this ISalesOrderNode ???

Should I import any package or something.?

Please guide me in detail for this.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Hari,

1> If you are getting error at build time then press cntrl + shift + O, or right click and organize imports.

You also have to add the required jar files in the java build path. Both in libraries tab as well as Order & Export tab.

2> If you are getting the error at run time, then you require to deploy the jar files to server. For this you require to import the jar files to lib folder in the package explore.

Try it,

Yomesh

Former Member
0 Kudos

Hi Hari,

Close and Open your project..

Do a rebuild Project after that . This should solve your problem.

If it doesnot work delete the gen_wdp and the bin folders manually and do a Reload+Rebuild.

Please reward appropriate points.

Bala

Former Member
0 Kudos

hi

try giving the below code.

public void wdDoInit() {

..//@@begin wdDoInit()

// Get a reference to the SalesOrders node

<b>IPrivate<view name> .ISalesOrdersNode soNode = wdContext.nodeSalesOrders();</b>

..// Create a new element for node SalesOrders

<b>IPrivate<view name> .ISalesOrdersElement newSoEl =

soNode.createSalesOrdersElement();</b>..//Use the attribute mutator methods to set the values

newSoEl.setDescription("Printer supplies");

newSoEl.setOrderNo(1000);

newSoEl.setSalesDate(new Date(System.currentTimeMillis()));

newSoEl.setSalesRep("Harry Hawk");

..//.Append the new element to the node's collection

soNode.addElement(newSoEl);

..//@@end.

Regards,

Rathna

Former Member
0 Kudos

Hai Yomesh,

I am getting error at buildtime.

where should i rightclick to get organize imports??

I pressed ctrlshifto ...In that there are two imports. Should i select all imports in that box..

How can I know which import should be done.??

As u said...to ad jar files in the java build path. Both in libraires tab as well as Order and export tab.

How to add these files ???

Also plz tell me why should I add these files to run my application.

Thanks..Your help definitely appreciated.

Former Member
0 Kudos

HI,

you have to right click on the code and click organize imports options. If it is giving two options ,select according to your package of component , or you can import both options also it will not matter.

Sorry you dont require to add any jar files in build path in your case , that is required only if you are using some api's like jaxb or jaxp or any other classes you want to use which are not a part of project , mistakenly i mentioned that earlier.

You try to organize imports and even if it doesn't work try closing and opening your project.

Yomesh.

Answers (0)