cancel
Showing results for 
Search instead for 
Did you mean: 

Default value for Simple Value

Former Member
0 Kudos

Hi All,

I have created a simple type (Quantity) and given the Enumeration as

Value Desc

-


1 1

2 2

3 3

4 4

5 5

I have displayed this in a DropDownByKey in the View.

However, I want the value 1 to be the default or selected value.

Please let me know how to do this.

Regards

Nikhil Bansal

Accepted Solutions (1)

Accepted Solutions (1)

sid_sunny
Contributor
0 Kudos

Hi Nikhil,

Try this:

wdContext.currentContextElement().set<value attribute name>("1");

Regards

Sid

Former Member
0 Kudos

Cheers Sid.

Nikhil

Answers (2)

Answers (2)

Former Member
0 Kudos

hi.

wdContext.currentContextElement.set<varname>(0);

This might helps you.

Thanks,

Lohi.

former_member189631
Active Contributor
0 Kudos

Hi Nikhil,

Make sure that your enumeration 0th element value is starts for 1 1s.

Could you please give the code? I think you have to do some modifications on the code.

Regards,

Ram.

Former Member
0 Kudos

Hi,

try this:

wdContext.nodeName().setLeadSelection(0); //if you want the first element

wdContext.nodeLookupTabelle().setLeadSelection(-1); //if you want no element

Hope this help,

Vito

Former Member
0 Kudos

Hi Ram,

Thanks for the reply.

Yes the 0th element in Enumeration is 1 1.

Can you plz tell me which code should I give you. I mean code from which component.

Regards

Nikhil Bansal

former_member189631
Active Contributor
0 Kudos

Nikhil,

Please send me the code for populating the data into Dropdown.

Regards,

Ram.

Former Member
0 Kudos

hi,

U defined ur simple type and there u assigned the values as u mentioned.

And defined one variable in the context of ur view and type is getting from the simpletype and bind with DDK UI element then u will get the all values in ur output.

1,2,3,4,5.

Now in the init method of view simple add the following code.

Wdcontext.currentContextElement().set<varName>(0);

it should helps u.

Thanks,

Lohi.