on 08-19-2014 4:54 PM
Hi Experts,
I created the RadiobuttonbyKey UI element and i have set it to the SimpleType which has two values.Say Ex:
Simple Type : 1 bus
2 train
My Requirement is onActionxxxx i have to display only one raiobutton in the Group and onActionyyyy i have to show both the radiobuttons in the group.
Can anyone please help me how to achieve this..............
Regards,
Mahesh
you can manipulate the simple type. in action 1, just put one value to the simple type, in other case, put two value in the simple type.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is an example of what you have to do:
// Access interface ISimpleTypeModifiable for modifying the attribute's datatype
IWDAttributeInfo attributeInfo =
wdContext.getNodeInfo().getAttribute(IPrivateMain.IContextElement.COUNTRY);
ISimpleTypeModifiable countryType = attributeInfo.getModifiableSimpleType();
// Set field label and populate valueset
countryType.setFieldLabel("Country");
IModifiableSimpleValueSet valueSet =
countryType.getSVServices().getModifiableSimpleValueSet();
for (int i = 0; i < 40; i++){
valueSet.put("Key_"+i,"Country "+i);
}
// initialize context value attribute 'Country'
wdContext.currentContextElement().setCountry("Key_0");
Hope this helps.
Regards
Tobias
hi mahesh ,
you can create an attribute in the context , and do svs coding for that in action xxx and actionyyy like shown below .
onactionxxx
{
IWDAttributeInfo radioTypeKeyInfo = wdContext.nodeRadioButton().getNodeInfo().getAttribute(IPublicAxisUtilsComp.IRadionButtonElement.RADIO_BUTTN_ATTR);
ISimpleTypeModifiable radioKeySimpleTypeModifiable = radioTypeKeyInfo.getModifiableSimpleType();
IModifiableSimpleValueSet radioKeyvalueset = radioKeySimpleTypeModifiable.getSVServices().getModifiableSimpleValueSet();
radioKeyvalueset.clear();
radionkeyvalueset.put("1","Train");
}
onActionyyyy
{
IWDAttributeInfo radioTypeKeyInfo = wdContext.nodeRadioButton().getNodeInfo().getAttribute(IPublicAxisUtilsComp.IRadionButtonElement.RADIO_BUTTN_ATTR);
ISimpleTypeModifiable radioKeySimpleTypeModifiable = radioTypeKeyInfo.getModifiableSimpleType();
IModifiableSimpleValueSet radioKeyvalueset = radioKeySimpleTypeModifiable.getSVServices().getModifiableSimpleValueSet();
radioKeyvalueset.clear();
radionkeyvalueset.put("1","Train");
radionkeyvalueset.put("2","Bus");
make sure that this context node RadionButton is created in the view itself, because you are adding the above code to actions defined in the view .
Regards
Govardan
hi Mahesh ,
which UI element you are using ......radio button group is group by key or group by index ?
if it is group by key above specified code holds ,
if is group by index , then you have bind a node of cardinaility 0...n and with one attiribute in that node.
in onActionxxxx()
wdcontext.nodeRadioButton().invalidate();
IPrivateDynamicTableView.IRadioButtonElement element;
element = wdContext.createRadioButtonElement();
element.setValueRadioButton("Train");
wdContext.nodeRadioButton().addElement(element);
----------------------------------------------------------------------------------------------------
and in onActionyyyyy()
wdcontext.nodeRadioButton().invalidate();
IPrivateDynamicTableView.IRadioButtonElement element;
element = wdContext.createRadioButtonElement();
element.setValueRadioButton("Train");
wdContext.nodeRadioButton().addElement(element);
element = wdContext.createRadioButtonElement();
element.setValueRadioButton("Bus");
wdContext.nodeRadioButton().addElement(element);
Regards
Govardan Raj
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
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.