cancel
Showing results for 
Search instead for 
Did you mean: 

Error using EVS drop down

Murali_Shanmu
Active Contributor
0 Kudos

Hi

I am trying to bring the search help values for field religion on my screen. I am using EVS. I have a context attribute ca_konfe on the component controller which will be populated with values from the model. Now I have mapped this value attribute to a value attribute on a view named ctx_konfe. This context is binded to a drop down by key control. Now in am able to get the numerical value of religion on the view during debug. Now in the init(), I used this code:

IWDAttributeInfo attributeInforeligion =

wdContext.getNodeInfo().getAttribute(IPrivatePersonalDetail_EmpPrComponentView.IContextElement.ctx_konfe);

ISimpleTypeModifiable religion = attributeInforeligion.getModifiableSimpleType();

IModifiableSimpleValueSet valueSetreligion= religion.getSVServices().getModifiableSimpleValueSet();

int religionn= wdContext.nodeT_Religion().size();

for(int i=0;i<religionn;i++)

{

valueSetreligion.put(wdContext.nodeT_Religion().getElementAt(i).getAttributeAsText("Konfe"),wdContext.nodeT_Religion().getElementAt(i).getAttributeAsText("Ktext"));

}

Here T_Religion is a Table with the Key, Value pairs.

When I run the code , I gethis error:

com.sap.tc.webdynpro.progmodel.context.ContextException: MappedAttributeInfo(Details.ctx_konfe): must not modify the datatype of a mapped attribute

Regards,

Murali.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Muralidaran,

Synopsis: you have create node in component controller, then created mapped node in view controller and try to modify attribute of mapped node in view controller.

Solution: move your code from view controller to component controller where original node is declared (do not forget to modify names i.e. IPrivatePersonalDetail_EmpPrComponentView.*)

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Murali_Shanmu
Active Contributor
0 Kudos

Hi

I solved it by having my value attribute as just STRING. It solved the issue. Thanks.

Murali.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

If the key of your religion table is numerical, then probably

getAttributeAsText("Konfe")

won't work.

Create an Integer as key object instead.

Good luck, Roelof