cancel
Showing results for 
Search instead for 
Did you mean: 

Car Rental Web Service WebDynpro Example

Former Member
0 Kudos

I implemented this. When I run the application the fields are read only. I checked the context mapping everything looks ok. Any help is highly appreciated.

Regards

Mike

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member751941
Active Contributor
0 Kudos

Hi Michael,

Have you created any element ? . If you fields are under Node (0..n or 0..1)

then you have to initialize your node in side "public void wdDoInit()" Method.

For 0..n node use code inside wdDoInit.

wdContext.node<node_name>().addElement(wdContext.create<node_name>Element());

For 0..1 node use code inside wdDoInit.

wdContext.node<node_name>().bind(wdContext.create<node_name>Element());

Other wise you can change the node cardinality to 1..1 or 1..n

Make sure readOnly property of the attribute that is bound your view is false.

And you have taken the InputFiled instead of TextView.

http://help.sap.com/saphelp_nw70/helpdata/en/6e/ae0e422dfcdc2ce10000000a1550b0/frameset.htm

Regards,

Mithu

Former Member
0 Kudos

There is a root node Request_SaveBooking that has a cardinality 1..n. The cardinality can be changed. Underneath Request_SaveBooking I have Response and SaveBooking and each of these have a cardinality of 0..1.

The following code is automatically generated by the tool in wdDoInit():

CarRentalModel model = new CarRentalModel();

wdContext.nodeRequest_SaveBooking().bind(new Request_SaveBooking(model));

Do I have to create SaveBooking and Response? I was thinking if the singleton property for Response and SaveBooking are set to false they should be instantiated as per the parent node Request_SaveBooking.

Also let me know the piece of code to create child elements.

Regards

Mike

former_member751941
Active Contributor
0 Kudos

Hi Michael,

Check this threads

Regards,

Mithu.

Former Member
0 Kudos

The following line does not compile:

SaveBooking saveBooking = new SaveBooking(model);

SaveBooking is the node below Request_SaveBooking. It does not recognize SaveBooking type.

In the document WDJ: Adaptive Web Service Model – Controller Coding Explained they have similar code.

Regards

Mike