cancel
Showing results for 
Search instead for 
Did you mean: 

Doubt on Drop Down box by key

Former Member
0 Kudos

Hi All,

My requirement is to fill a dropdown with values in accordance to the selected value of another drop down...

My code is as follows..

private void fillTaxTypes(){

IModifiableSimpleValueSet dropTTValueSet;

IWDAttributeInfo addressAttributeInfo = wdContext.getNodeInfo().getAttribute("vaTaxType");

wdComponentAPI.getMessageManager().reportWarning("check here");

dropTTValueSet = addressAttributeInfo.getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();

//wdComponentAPI.getMessageManager().reportWarning("check there");

int nodeSize = wdContext.nodeCONTRACCOUNTLIST_new().size();

dropTTValueSet.clear();

dropTTValueSet.put("0","Select");

for(int i=0;i<nodeSize;i++){

dropTTValueSet.put(wdContext.nodeCONTRACCOUNTLIST_new().getElementAt(i).getAttributeAsText("cONT_ACCT"),wdContext.nodeCONTRACCOUNTLIST_new().getElementAt(i).getAttributeAsText("cONT_ACCT"));

}

I am calling the method in an action.(event handler)

But I am getting an error...

Kindly suggest me...

Regards

DK

Accepted Solutions (1)

Accepted Solutions (1)

sridhar_k2
Active Contributor
0 Kudos

DK,

I guess your problem is with the Variable Type.

Use your view local context variable in the below code.


IWDAttributeInfo addressAttributeInfo = wdContext.getNodeInfo().getAttribute("vaTaxType");

(Or) get the Custom controller / Component Controller context attribute info like this.


IWDAttributeInfo iAttInfo = wdThis.wdGetWelcomeComponentController().wdGetContext().getNodeInfo().getAttribute("vaTaxType");

Hopefully, your problem might have solved.

Regards,

Sridhar

Answers (2)

Answers (2)

sridhar_k2
Active Contributor
0 Kudos

Hi,

Whats the Error?

Regards,

SK

Former Member
0 Kudos

Hi Sridhar,

The erroe is as follows..

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

Kindly suggest me..

Looking forward to you

Regards

DK

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Dipendra,

See this thread Same problem:

Regards, Suresh KB

Former Member
0 Kudos

Hi,

Can you let me know the error you got?

And also is the <b>nodeCONTRACCOUNTLIST_new</b> getting data from a backend?

Regards,

Santhosh