cancel
Showing results for 
Search instead for 
Did you mean: 

Attaching OVS to model attribute.

Former Member
0 Kudos

Hi,

Can I attach OVS to a model attribute in the view controller? I tried to do it but at runtime I got the error 'must not modify the datatype of a mapped attribute'. Any suggestions...Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Kapil,

Create non-model calculated attribute, wich getter/setter merely delegates call to original one. If you do not using structure binding, then you may create it in desired model node, otherwise create a subnode (non-model, cardinality=1..1, selection=1..1, initializeLeadSelection=true, singleton=false[actually, it depends]). Then you can apply OVS extension to this attribute.

VS

Former Member
0 Kudos

Hi Valery,

Thanks for your suggestion. I will try out your solution shortly.

So, basically does that mean we cannot attach OVS to model attributes in view context?

Former Member
0 Kudos

Kapil,

It seems to be so. Neither to model attribute, nor to mapped attribute (when mapping of context controllers used).

VS

Former Member
0 Kudos

Hi Valery,

I tried OVS with a non Model attribute and it worked fine.

Can you please explain what do you mean by delegation in your statement 'Create non-model calculated attribute, wich getter/setter merely <b>delegates</b> call to original one'.

I have to attach OVS to a table column. This table is attached through controller to the model for its data.

Former Member
0 Kudos

Say you have model node MyNode and model attribute MyAttr. Next you are creating read-write calculated attribute MyCalculus under the same node. WD generates 2 method for this attribute: getter to read value and setter to write value.

So under deleagtion I mean the following:

inside getMyNodeMyCalculus write:

return element.getMyAttr();

inside setMyNodeMyCalculus write:

element.setMyAttr(value);

So in fact you are just proxing original attribute. But your calculated attribute has no metadata / type-data mapping (to model or other controller). Therefore you may use OVS for this calculated attribute.

VS

Former Member
0 Kudos

Hi Valery,

Thanks so much for your explanation. As per your suggestion, I was able to attach the OVS help to the table fields by using a calculated attribute. However, as soon as I click on the icon to initiate the OVS help it gives me a NullPointerException as below. I am trying to resolve it, but if you could throw any pointers on how to resolve it, it would be great.

java.lang.NullPointerException

at com.sap.tc.webdynpro.progmodel.valuehelp.NodeCMIModelClassWrapper.<init>(NodeCMIModelClassWrapper.java:46)

at com.sap.tc.webdynpro.progmodel.valuehelp.NodeSingletonCMIModelClassWrapper.<init>(NodeSingletonCMIModelClassWrapper.java:35)

Former Member
0 Kudos

I was able to resolve the NullPointerException error.

Another issue : the model attribute is delegated to the calculated attribute but how can I display multiple model attribute values as a single calculated attribute in my table view. The value node is also 1:1.

Thanks Valery!

PS : I was able to resolve this by refering to the parent element.

Message was edited by: kapil sharma

Former Member
0 Kudos

Search SDN articles, there was an excelent article by Bertram Ganz regarding calculated attributes with EVS, most of the features could be applied to OVS as well.

VS

Former Member
0 Kudos

Hi Guys,

i have also the same NullPointerException in a Webdynrpo App using a RFC Model.

Actually, i'm not a expert in this technology

@Kalpi

So, what you mean by reffering to parent element?

Can you give me an example?

Actually i fight with this problem until three days, and i've no solution.

I hope someone can help me! I became totally desperate.

Thanks

Best Regards,

Chris

Message was edited by: Christian Kleinschroth

Message was edited by: Christian Kleinschroth

Answers (0)