cancel
Showing results for 
Search instead for 
Did you mean: 

syntax error

Former Member
0 Kudos

Hai please check the below code.......

It is showing an error "Type Mismatch" at newPerson.

Can any one solve this problem??

public void onActionGO(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionGO(ServerEvent)

//Create a new People Element

IPeopleElement newPerson = wdContext.nodePeople().createPeopleElement();

//Get a reference to the Context node Person

IPersonElement person = wdContext.nodePerson().currentPersonElement();

//Use mutator methods to set the Values

newPerson.setFIRST_NAME(person.getFIRST_NAME());

newPerson.setLAST_NAME(person.getLAST_NAME());

newPerson.setDATE_BEGIN(person.getDATE_BEGIN());

newPerson.setDATE_END(person.getDATE_END());

//Add People Element instance to Context node

wdContext.nodePeople().addElement(newPerson);

wdThis.wdGetGOAction();

//@@end

}

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Hari Krishna,

Try this.

<u>If your code is in the view controller then</u>

IPrivate<viewName>.IPeopleElement newPerson =
 wdContext.nodePeople().createPeopleElement();

<u>If your code is in the custom/component controller then</u>

IPublic<custom/componentControllerName>.IPeopleElement newPerson = 
wdContext.nodePeople().createPeopleElement();

Please reward appropriate points.

Bala

Former Member
0 Kudos

Hi..Thanks BalaKrishna. It worked.

I ll give full points to u.

As I am new to Web-Dynpro...

Can u hav gud materials or Codings in Web-dynpro. Can plz send me to hariabap2005@yahoo.co.in

Thanx a lot.

Waiting for your Mail.

Former Member
0 Kudos

The best materials on programming Web Dynpro are right here in SDN, there are tutorials, Web logs, articles, help documents, e-learning presentations etc, and there is the SAP help portal at help.sap.com.

There are also some good books around, my favourite on is "Inside Web Dynpro for Java" by Chris Whealy.

Armin

Answers (2)

Answers (2)

Former Member
0 Kudos

Remove the import for IPeopleElement, type CTRL-SHIFT-O (Organize imports), in the list appearing, select the IPrivate<ViewName>.IPeopleElement because your code is in the view controller.

Armin

Former Member
0 Kudos

Hi,

Try this:

IPeopleElement newPerson = (IPeopleElement) wdContext.nodePeople().createPeopleElement();

Good luck,

Roelof

Former Member
0 Kudos

Hai..

No...still not working.