cancel
Showing results for 
Search instead for 
Did you mean: 

Filling Complex Model

Former Member
0 Kudos

Hi There,

I have a problem with the Model-handling in WD. I have

a deep Model generated from a Web Service with a lot of Subnodes like the follwing example:

WebService (root node)

WebService - Booking (card: 0...1)

WebService - Booking - pointOfSale (card: 0...1)

WebService - Booking - travelers (card: 0...n)

and a lot of Attributes in every node. These

nodes are the INPUT-parameters for the web service.

I initialize the Model with the follwing Code:

WebService req = new WebService()

wdContext.nodeWebService.bind(req);

How do i have to fill these nodes with data? I tried to

map InputFields with the model attributes, but the

model does not store the data /the input fields are in "readOnly"-Modus and grey. Even if I try to fill the

Context-Model "manual" (e.g. nodeTravelers.addTravelerElement(...)) the values does not reach the web service.

Where can i find a example for handling complex model structures ?

Thanks a lot...

Claus

Accepted Solutions (0)

Answers (1)

Answers (1)

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hallo Claus,

look at Perhaps you can find and answer there.

Greetings, Bertram

Former Member
0 Kudos

Hi Betram,

thank you for your tip. I tried it the following way

in the Init-Method of the View:

//Create Model

ComplexType_pointOfSale pos = new ComplexType_pointOfSale();

pos.setAgencyKey("12345");

ComplexType_Booking booking = new ComplexType_Booking();

booking.setPointOfSale(pos);

//Binding the model to context

WebService req = new WebService();

wdContext.nodeWebService.bind(req);

A InputField is mapped to the AgencyKey-Attribut,

but is empty after i startet the application.

Any idea ?

Thanks a lot for your answer,

Claus

Former Member
0 Kudos

Hi Claus,

looking at the code snippet i guess, that you "overwrite" any request parameters (and/or complex types) with the final

WebService req = new WebService();
wdContext.nodeWebService.bind(req);

This might discard any changes you've done before binding the new (and therefore empty) web service node. Please try it in reverse order, e.g. create a WebService element, bind/add it to the corresponding node, create elements for the sub-nodes, fill them and finally execute() the model object to send the request to the web service.

Hope that helps.

Regards

Stefan

Former Member
0 Kudos

Hi Stefan,

I forgot a line in my Code:

WebService req = new WebService();

req.setBooking(booking);

wdContext.nodeWebService.bind(req);

So that did not work. But i try it as you described.

Regards,

Claus