cancel
Showing results for 
Search instead for 
Did you mean: 

Context-Model binding

Former Member
0 Kudos
55

Hi experts,

I am having some trouble with the binding between my controller context and the model objects. My context model nodes are the following (imported from a Web Service):

Context

--KES (Model Node)

-


Request (Model Node, singleton, selection 0..1)

-


Metadata (Model Node, singleton, selection 0..1)

-


creator (Model attribute)

In wdDoInit() of the controller, I initialize my model objects as follows:


Request_KeywordEnhancerWSViDocument_generateMetadataComSapMltKesKESRequest req 	 =
new Request_KeywordEnhancerWSViDocument_generateMetadataComSapMltKesKESRequest();
    
wdContext.nodeKES().bind(req);
	
ComplexType_KESRequest request  = new ComplexType_KESRequest();
ComplexType_DCMetadata metadata = new ComplexType_DCMetadata();
request.setMetadata(metadata);
req.setRequest(request);

Furthermore, I have bound the Request model node to my view controller. Setting model attributes for the Request node is no problem, but I cannot access those in the Metadata node. This only works if I add an element to the node collection or explicitly bind my metadata object to the model node. Then, however, the relation between the Request and Metadata model objects is broken and I cannot properly execute the Web Service.

I've been stuck on this matter for hours now and have tried just about everything. I'd appreciate it if someone could give me a hint. Is this a matter validating/invalidating the context node?

Any help would be greatly appreciated! Thanks!

Cheers,

Tim

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

...and

3. Verify that supplying relation role is set for nodes Request and Metadata.

VS

Former Member
0 Kudos

Hi Valery,

thanks for the fast response.

Unfortunately, your suggestions did not have any effect. Even with first creating the object graph and having both nodes as singleton, the Metadata node isn't properly set up.

The supplying relation roles are set to "request" and "metadata", respectively.

Tim

Former Member
0 Kudos

Tim,

Try to do one of below:

1. Make request & metadata nodes non-singleton.

2. First construct object graph (req->request->metadata) then bind req.

VS