cancel
Showing results for 
Search instead for 
Did you mean: 

DropDownByKey

Former Member
0 Kudos

Is it possible to insert a blank value while creating a dropdown from a static Simple type?

Accepted Solutions (1)

Accepted Solutions (1)

pravesh_verma
Active Contributor
0 Kudos

Hi Bhavana,

1) Add one more entry of blank value (ie: " ") as the 1st element of the static type.

2) Create a attribute in the view context of the dictionary datatype (ie: simple type in which you have value), let say attribute name is Text.

3) In the code set the blank value to this, using this code:

wdContext.currentContextElement().setText(" ");

I hope this should solve your problem.

Regards

Pravesh

PS: Please consider rewarding points if helpful or solved.

Former Member
0 Kudos

I tried doing bUt it does not help

vijayakhanna_raman
Active Contributor
0 Kudos

Hi bhavana,

Have u created the attribute aaa.

Then follow the steps and write the code in the init method.

hope this helps.

Regards,

Vijay

Former Member
0 Kudos

Hi Pravesh

Yes it solved the problem and ven if i donot set the value by code,it works.Thanks

pravesh_verma
Active Contributor
0 Kudos

Hi Bhavana,

Consider rewarding points for helpful answer. If it helped you then you can reward points for that!!

Regards

Pravesh

Answers (2)

Answers (2)

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

Blank value will not be there and cant be inserted in case of DD by key.

Only in index

but if u want then write the code like this.

ISimpleTypeModifiable myType=wdThis.wdGetAPI().getContext().getModifiableTypeOf("aaa");

IModifiableSimpleValueSet val=myType.getSVServices().getModifiableSimpleValueSet();

val.put("","");

val.put("B","2");

val.put("C","3");

val.put("D","4");

Regards

Vijay

Message was edited by: Vijayakhanna Raman

former_member182372
Active Contributor
0 Kudos

Hi Bhavana,

But AFAIK and as I can see in refernce manual DropDownByKey always has a blank item.

Best regards, Maksim Rashchynski.