cancel
Showing results for 
Search instead for 
Did you mean: 

Clearing selection in DropDown by Key

Former Member
0 Kudos

Hi

I have an UI DropDown by Key bound to a SVS.

How can i clear the selected value. i.e. making it blank again.

Properties of the node are as follows:

Carinality: 1....n

Lead Selection: True

Selection: 0...n

Singleton: True

Posts earlier on the similar issue are of no help to me.

and I can not use DropDown by Index.

Value chosen in DropDown form one of the criterion for search / input in RFC.

So i can not use -1 as one more enumeration.

Please help.

Regards

Vineet Vikram

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

vineet,

Just set corresponding attribute to null -- attribute to which DropDownByKey.SelectedKey is bound.

wdContext.current<NodeName>Element().set<AttributeName>(null);

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

Dear Valery

I think some gap is left in explaining the problem.

The problem is not getting the drop down blank.

It is about clearing the selection.

Once the user selects a value from the DropDown, then he can not clear it.

He has to choose one of the values in the dropdown.

I want to give the provision in which the user will be able to do away with the drop down even if once he used it i.e. passing no value from the dropdown.

I hope i have stated my problem quite clearly this time.

Waiting for your response.

Vineet Vikram

Former Member
0 Kudos

Vineet,

To get an empty entry, set the Cardinality of the node bound to DropDown to 0:N and to keep an entry always selected, set the Selection-Cardinality to 1:1.

Bala.

Former Member
0 Kudos

Hi Vineet,

In your code for populating values in DDBK

IWDMessageManager mgr = wdComponentAPI.getMessageManager();

IWDAttributeInfo atrInfo = wdContext.node<Your Node>().getNodeInfo().getAttribute("attribute mapped to selectedKey property");

IModifiableSimpleValueSet ValueSet = atrInfo.getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();

// add a default value to valueSet

ValueSet.put("Default","Select a value");

int Nodesize = wdContext.node<your node>().size();

for(int i = 0; i < wdContext.node<Your node>().size();i++)

{

// code for populating values in value set

}

After the user has chosen a value from DDBK and invoked some action,

in the view implementaion of UI before returning to the view again add this

line of code

wdContext.current<node>Element().set<attribute mapped to selectedKey property>("Default");

This will set the DDBK value to default every time the action is completed.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello ,

I am on EP7.0 ERP05 NW04s and trying to modify the ESS Banks Detail screen in which I want the Payment Method Dropdown to list only Direct Deposit and Payroll Check and leave the rest....how can I filter these values.?

Any help would be highly appreciated.

Former Member
0 Kudos

Hi Vineet,

Please correct me if my understanding of the problem.You have a dropdownbyKey

now you want the selection of the dropdown to get cleared i.e set to some default value that you can filter.

If this is your problem then I would suggest the following solution to it:

I think you must be aware of the fact that the key of the value selected gets stored in the attribute if u aware with the binding of the key of this dropdown.You can certainly write an action that will do this for you.All you need is to set the attribute to the default key and dropdown will automatically have the changes reflected at runtime.

Regards

Amit