cancel
Showing results for 
Search instead for 
Did you mean: 

to clear EVS entry on close

Former Member
0 Kudos

Hello Alll

how can i set the value of an EVS as blank

thanks

kaushik

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Sumit

the scenario is :

i have an EVS , well populated now if i enter something in EVS manually "test" and this does not exist in the valueset and now if i try to save the data , it says "Character string "test" does not exist in the set of allowed values"

and now at this point i want that on saving anything that was typed in teh EVS gets cleared and data gets saved.

any code hint would be very helpful

thanks

kaushik

Former Member
0 Kudos

Hi Kaushik,

First Create a variable svs2 of type IModifiableSimpleValueSet globally. Let ur local valueset variable be svs1.

After populating the values in ur local valueset variable(ie. in svs1), assign that varibale to svs2. Also make the submit action as <b>nonvalidating</b> by checking the property of action. Then at the time of submission, do the following.

String key=wdContext.currentContextElement().get<EVSattribute>();

if(svs1.containsKey(key))

{

//NO problem

}

else

{

wdContext.currentContextElement().set<EVSattribute>(null);

}

Hope this will be helpful

Regards

Fahad Hamsa

Former Member
0 Kudos

Hi ,

1. You need to add the entered value..

For onEnter event of the input field, create a non -validating action..

inside the event handler.. u can write..

String val = wdContext.currentContextElement().getDropdownVal();
IWDAttributeInfo info = wdContext.getNodeInfo().getAttribute("dropdownVal");
IModifiableSimpleValueSet svs =   info.getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
svs.put(val,val);

2. To set null , in the same event handler section..

add a line..

wdContext.currentContextElement().setDropdownVal("");

Regards

Bharathwaj

Message was edited by:

Bharathwaj

Former Member
0 Kudos

Hi Kaushik,

Just clear the value set associated with EVS.

regards

Sumit