cancel
Showing results for 
Search instead for 
Did you mean: 

using dropdownbykey

Former Member
0 Kudos

Hello Friends,

I am using Dropdownbykey (for selecting Claim Types like Hostel etc) to allow user to select a value from it. I ahve attached it to a simple type dictionary object

Now, I want to get the value selected by user in my code. I have written code in onSelect method :

*wdContext.currentExpense_inputElement().getClaimtype(); *

but its returning a null, whatsoever user selects.

I think I am missing something. Can you please guide me in the right way

regards

Vidit

Accepted Solutions (1)

Accepted Solutions (1)

former_member197348
Active Contributor
0 Kudos

Hi Vidit,

What is the cardinality of Expense_input ? Check whether the current Expense_input element exists. Or simply a context attribute (Claimtype) under Root Context node of type dictionary object and write code in onSelect method :

wdContext.currentContextElement().getClaimtype();

Regards,

Siva

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks for helping me !!

nikhil_bose
Active Contributor
0 Kudos

if you are getting the Enumeration values in DDByKey, your code is just fine at


wdContext.currentNode2Element().getClaimtype();

look at other lines given in OnAction()

nikhil

Former Member
0 Kudos

Hi

you have to bind the selected key property to the simpletype attribute.

you may be missed to give the values in Enumeration of simple Dictionarytype.

check onceagain.

Try the following code.

Colour-->node

colr-->attribute of Colour

Clrvalue-->attribute of context.

onSelect(...){

String clr = wdContext.nodeColour().currentColourElement().getColr();

wdContext.currentContextElement().setClrvalue(clr);

}

Regards

sowmya.

Former Member
0 Kudos

Hi Sowmya,

I had done the same thing. I created a simple type in dictionary and supplied the values for enumeration and attached it to the selectedkey property of dropdownbykey.

My context sructure is

root Node

|- Node 1

-


|- Node2

-


|-ClaimType ( selectedkey property bind to simpletype enumeration ClaimType)

Now in the onSelect method, I call the following code.

wdContext.nodeNode2.currentNode2Element().getClaimtype();

but its returning a Null value only

Regards,

Vidit

Edited by: Vidit on Jul 31, 2008 4:43 AM

Former Member
0 Kudos

Hi Vidit,

Please check the cordinality of that node. the code u writen in the onSelect is perfectly correct. check which line u got the null value in onSelect method.

Former Member
0 Kudos

hi

once you check for cardinality of node1 and node2 ,Selection cardinality and check the singleton property also.

if cardinality set to 0:1,it may be one of the reason for getting null values.

Regards

sowmya

Former Member
0 Kudos

I am able to fill the context attribute "Claimtype" through code, so cardinality and singleton is OK i guess.

if possible, can you send me a working code on this for refrence purpose.

regads

Vidit

Former Member
0 Kudos

Hi Vidit,

check whether u hav initialized the value node of context for particular drop down or not ..into Doinit() method..

if u dint do it initialize the value node n check cardinality of it..

Regards,

Khushboo

Former Member
0 Kudos

hi

i already send the working code.

check my above post,there i clearly mentiontioned everything.

you have to set cardinality of node to 1..n..

Regards

sowmya.

Former Member
0 Kudos

How did you bind the "selectedKey" property?

Armin