on 12-27-2005 9:34 AM
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
}
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this:
IPeopleElement newPerson = (IPeopleElement) wdContext.nodePeople().createPeopleElement();
Good luck,
Roelof
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.