cancel
Showing results for 
Search instead for 
Did you mean: 

EVS for Model Attribute

MauricioMiao
Contributor
0 Kudos

Hello all,

I need to create a EVS for a model attribute, below is the line in my code where the problem is, by now I am doing a simple example before do the real code, so I am using Flight Model:

IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute(IPrivateFlightBookingView.IBooking_DataElement.AIRLINEID);

the getAttribute only return something when I pass a Value Attribute, if I ask for a Model Attribute it returns NULL.

So how can I access SVServices for this kind of node?

In case there is no solution I will be forced to do a workaround creating a Value Attribute to enable EVS and passing the value of this attribute to the model attribute before call model execute.

Regards,

Mauricio

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Do you have a model node in the component/custom controller which has been model-bound to the model & the model node in the view context-mapped to the node in the controller ?

If yes, can you pls try this - instead of getting the attributeinfo from the view context, get it from the controller context and get the svservices and attach the values to the model element in the controller.

Thanks,

Renjith.

Answers (1)

Answers (1)

Former Member
0 Kudos

Mauricio,

Just check names in your line of code:

First, you say:

wdContext.getNodeInfo()

Ok, now you have node info of IPrivateFlightBookingView.IContextNode.

Then you ask this object:

.getAttribute
(
  IPrivateFlightBookingView.<b>IBooking_DataElement</b>.AIRLINEID
);

I.e. you are asking for attribute of <b>different</b> node. And it correctly responds with null 'cause it has no clue what is AIRLINEID, AIRLINEID is declared within different node.

Try this instead:


wdContext.nodeBooking_Data().getNodeInfo().getAttribute
(
  IPrivateFlightBookingView.IBooking_DataElement.AIRLINEID
);

VS

MauricioMiao
Contributor
0 Kudos

Hi all,

Thansk for all help.

Valery, I have tried your suggestion before I post the thread but in this case we get an Exception "must not modify the datatype of a mapped attribute", but thanks anyway.

Renjith, your idea worked fine for me, it solved my problem, I have not thought about it, thanks!

Regards,

Mauricio