on 07-28-2006 4:30 AM
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?
Don't remove the mapping relation, but follow the mapping chain to the mapping origin attribute and modify the type there.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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;
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>).
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.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.