cancel
Showing results for 
Search instead for 
Did you mean: 

mapping errors!

Former Member
0 Kudos

have have a context (one node and it' value element)in a compenent controller,and i mapping it to the view,then bind it to the UI. but i need to put values(key ,value) to the context.

in my view implementation:

<b>IPrivateDealSearchView.ISsSellCoElement newEle1 =

wdContext.createSsSellCoElement();

ISimpleTypeModifiable myType1 =wdThis.wdGetAPI().getContext().getModifiableTypeOf("ssSellCo.sellCo");

IModifiableSimpleValueSet values1 =myType1.getSVServices().getModifiableSimpleValueSet();

for (int j = 0; j < listCompany.size(); j++) {

Company compDTO = (Company) listCompany.get(j);

values1.put(

(String) compDTO.getCompanyname(),

(String) compDTO.getCompanyalias());

}

wdContext.nodeSsSellCo().addElement(newEle1);</b>

report exception:

<i><u>com.sap.tc.webdynpro.progmodel.context.ContextException: MappedAttributeInfo(DealSearchView.ssSellCo.sellCo): must not modify the datatype of a mapped attribute</u></i>

but i delete the relation between component and view,it run ok,in fact.i need create the relation between them.

how to solved it?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Don't remove the mapping relation, but follow the mapping chain to the mapping origin attribute and modify the type there.

Armin

Former Member
0 Kudos

HI,

Try like this change attrubute inside custom controller instead of view. Do your code inside custom controller. Because you can't change the mapped attribute.

Kind Regards,

S.Saravanan.

Former Member
0 Kudos

hi,Saravanan S

i donne as u said.that's ok!

but something's up..

in my view there is a action. its function is for setting lead-selection .it invokes one method in its custome controller to clear up(all bind to inputfield).

e.g.:

<b>wdContext.currentSplitSearchElement().setContract("");

wdContext.currentSplitSearchElement().setContractSeq("");</b>

although it set clear lead-selection correctly,UI(inputfield) was set unable for its <i>enable</i> attribute;

Former Member
0 Kudos

sorry, copy wrong.

it should be:

<u> <b> wdContext.nodeSsByeCo().setLeadSelection(-1);

wdContext.nodeSsSellCo().setLeadSelection(-1);</b></u>

Former Member
0 Kudos

What means "UI(inputfield) was set unable for its enable attribute"?

Armin

Former Member
0 Kudos

Hi,

Can you explain details?. Inside action what you want to do?.

Kind Regards,

S.Saravanan.

Former Member
0 Kudos

hi,Saravanan S

sorry for poor expression!

e.g.:

in my custom controller,i have a node attribute (ssSellCo)and a value attribute of it(sellCo). and i mapping it to the view,then i bind it to the TEXT attribute of inputField .

<i><b>i have two methold in custome controller.</b></i>

<u>aMethod():</u>

<i>IPrivateDealSearchView.ISsSellCoElement newEle1 =

wdContext.createSsSellCoElement();

ISimpleTypeModifiable myType1 =wdThis.wdGetAPI().getContext().getModifiableTypeOf("ssSellCo.sellCo");

IModifiableSimpleValueSet values1 =myType1.getSVServices().getModifiableSimpleValueSet();

for (int j = 0; j < listCompany.size(); j++) {

Company compDTO = (Company) listCompany.get(j);

values1.put(

(String) compDTO.getCompanyname(),

(String) compDTO.getCompanyalias());

}

wdContext.nodeSsSellCo().addElement(newEle1);</i>

<u>bMethod()(it's for the search condition,so i have to realize the clear function for the default leadseletion ):</u>

<i>wdContext.nodeSsByeCo().setLeadSelection(-1); </i>

i invoke the custome method in my view' implementation:

<i>wdThis.wdGetDealViewerCompController().aMethod()/;</i>( or ....b.Methold())

something' up when i invoke bMethold.it look likes the field haven't be activated

(<i>maybe for:

1.inputfield ' enbale attribute be set to disable ;

2.haven't bind any node to it ;

3.bind a non-value ssSellCo node to it (<b>problem for this</b>)</i>).

Former Member
0 Kudos

Hi,

You are adding Element like that:

wdContext.nodeSsSellCo().addElement(newEle1); Before that (Inside Loop)you didn't add values1 into newEle1. You get Companyname,Companyalias and add into values1, after you have to add values1 into newEle1. Finally add newEle1 into nodel. Also check node cardinality.

Kind Regards,

S.Saravanan.