on 05-23-2007 7:11 AM
Hi Experts,
I have a requirement in my application where I need to use EVS with Input Field. Whenever the values available for the Input Field context I am getting EVS. If values are not loaded in to the context, I do not get EVS.
Then I need a feature where i can enter the value for this Input Field manually, when I done that EVS is generating error messge as "String xxxx does not match the enumeration".
Can any body suggest me how to use EVS where I can also enter value in Input Field manually.
Here is the code in my application...
******************
<pre><b>
IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute("Country");
ISimpleTypeModifiable countryType = attributeInfo.getModifiableSimpleType();
countryType.setFieldLabel("Country");
IModifiableSimpleValueSet valueSet = countryType.getSVServices().getModifiableSimpleValueSet();
for (int i = 0; i < 40; i++)
{
valueSet.put("Key_"i,"Country "i);
}
wdContext.currentContextElement().setCountry("Key_0");</b></pre>
******************
Thanks in Advance,
Murthy.
Hi
1st of all remove this code of line so that u can enter the data manually..
wdContext.currentContextElement().setCountry("Key_0");
n yes wenevr u enter invalid key in the Country field, u will get that message, the enumeration must match.
Do reward points if helpful!
Thanks
Puneet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Puneet,
I want a feature to enter value manually whenever the EVS is not generated. Here in my case EVS is not generated, then I am entering values for those Input Field , then EVS generating this Error.
The context attribute is a string for which we are changing to ISimple modify Type for EVS, is there a chance where we can make that attribute as normal string, and hence we can enter data manually.
Regards,
Murthy.
Hi,
You need to add the entered value..This would not be possible in a "validating action"
For onEnter event of the input field, create a non -validating action..(a checkbox is available in the wizard , where you can specify this)
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);
Regards
Bharathwaj
Hi Narasimha,
U need to do this:
Create onEnter event of the input field, create a non -validating action..
Write this code in event handler
String val = wdContext.currentContextElement().getEVSVal();
IWDAttributeInfo info = wdContext.getNodeInfo().getAttribute("evsVal");
IModifiableSimpleValueSet svs = info.getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
svs.put(val,val);
regards
Sumit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ans1) you get this error <b>"String xxxx does not match the enumeration".</b> reason is probably you are not entering a valid text in the EVS. if you enter something which is there in the key then you won't get this error.
<b>Ans2)</b> As you said <b>If values are not loaded in to the context, I do not get EVS</b> but yeah you get this error on entering some text in the input field. <b>The context attribute is a string for which we are changing to ISimple modify Type for EVS,</b> which means although you are not poppulating your context and EVS is not coming but the you are still running the code to modify simple type. which is wrong.
you need a condition which should first check if context is populated or not. if it is not populated do not modify the simple type else do it.
if (wdContext.nodeTest().size() == 0)
{
return ""; [or do whatever you wanna do]
}
else
{
wdContext.nodeTest().getNodeInfo().getAttribute("abc_title").getModifiableSimpleType().setFieldLabel("This is your header");
IModifiableSimpleValueSet valueset = wdContext.nodeTest().getNodeInfo().getAttribute("abc_title").getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
valueset.clear();
String abc_title;
String abc_desc;
for (int i=0; i<wdContext.nodeTest().size(); i++)
{
abc_title = wdContext.nodeTest().getTestElementAt(i).getAttributeAsText("abc_title");
abc_desc = wdContext.nodeTest().getTestElementAt(i).getAttributeAsText("abc_desc")
valueset.put(abc_title, abc_desc);
}
}
{
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here's the code sample for doing that:
IWDAttributeInfo attInfo = wdContext.getChildNode("Name",//initalize the lead Selection or give 0 for default).getAttribute("Name of the attribute");
IModifiableSimpleValueSet valSet = wdContext.getNodeInfo().getAttribute("name").getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
// Key over here can be chosen by you and val can be accessed by seleceted value in the input field attribute.
valset.put(key,val);
// Now get the attribute to which the inputfield is bound and enter set it to the key you have given above.
Regards
Amit
Reward points as per the Merit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Murthy,
Look here you must try to understand the purpose of EVS which is to enable you to select a certain value enumerated.Still if you require the mentioned functionality you'll require to add the the key value by accessing the valueSet of the attribute you have binded this EVS and set the current attribute to the selected key for persistence.
Regards
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.