on 06-11-2008 8:54 AM
hi
how to use valuseset with dropdowns and can u explain use of value set.
thanks
kishore
IWDAttributeInfo attinfo=wdContext.getNodeInfo().getAttribute("name of yr value attribute");
ISimpleTypeModifiable STTDFromCity=attinfo.getModifiableSimpleType();
IModifiableSimpleValueSet valuesetFCity=STTDFromCity.getSVServices().getModifiableSimpleValueSet();
STTDFromCity.setFieldLabel("City Code");
for(int k=0;k<wdContext.nodeItab_Loc().size();k++)
{
valuesetFCity.put(wdContext.nodeItab_Loc().getItab_LocElementAt(k).getLocid(),wdContext.nodeItab_Loc().getItab_LocElementAt(k).getName());
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
bhh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Valueset is used when we want to convert a simple variable of
buiit in type(String) to simple type at Run time.
Say u have created a context ctx_String of string type and u
want to convert it into simpletype At runtime(This we generally
do when we are not sure of values that would come into
simpletype and will be decided at runtime.)
Use the following code .
IWDAttributeInfo attr_a_Schemas = wdContext.getContext().getRootNodeInfo().getAttribute("ctx_String");
ISimpleTypeModifiable isim_a_schemas = attr_a_Schemas.getModifiableSimpleType();
IModifiableSimpleValueSet isval_a_schemas = isim_a_schemas.getSVServices().getModifiableSimpleValueSet();
isval_a_schemas.clear();
for(int i = 0; i < someLength; i++)// some length equals to ur no of values that u would like to add to this simple type
{
isval_a_schemas.put("KEY"+i,"DESCRIPTION");//here key and description can be replaces by ur value.
}
In order to use it in dropdown u can bind this context
ctx_string to dropdownbykey.
In order to get the selected value u can use
wdContext.currentContextElement().getCtx_String();
Regards
Surender Dahiya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Following is the code
ISimpleTypeModifiable modifiable = wdContext.getNodeInfo().getAttribute("Your Attribute").getModifiableSimpleType();
modifiable.hasSVService()
ISimpleValueServices simpleValueServices = modifiable.getSVServices();
IModifiableSimpleValueSet simpleValueSet = simpleValueServices.getModifiableSimpleValueSet();
for(int x=0; x<10;x++)
{
simpleValueSet.put(String.valueOf(x), String.valueOf(x));
}
This is needed only in case of Dropdownbykey.
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.