on 11-14-2008 5:56 AM
Hi,
I need to create radio button group and dropdown dynamically in my application. Kindly suggest me the steps.
Regards,
Becky.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thank you all for the quick responses.
While creating a radio button do we need to create new context for it?
And also the drop down which i have to create, there is an application which already contains buttons containing different actions, but i need to modify it and change it to a drop down list containing different values which were earlier performed through buttons. What all do i need to change in this. What will be teh changes in the context to be made?
Please explain.
Thanks n Regards,
Becky.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joseph,
For radio button, if you like then create context same as you have done for dropdown otherwise you just create an enum and bind the properties of radio button.
You can use existing event with dropdown but in this scenario you have to bind event dynamically.
Like :--
IWDAction theAction = wdThis.wdCreateAction(
IPrivateDynamicView.WDActionEventHandler
.GENERIC_ACTION,
"");
theButton.setOnAction(theAction);
theButton.mappingOfOnAction().addParameter(
"Command",op.getName());
theActionContainer.addChild(theButton);
Kind Regards
Sarsij
Hi Joseph,
Please find code to create dynamacally drop-down.
List<ConfigFieldStructureDTO> fieldValuesList = cfgParamDTO.getParamValuesList();
IWDDropDownByKey fieldDescDropDown = (IWDDropDownByKey)view.createElement(IWDDropDownByKey.class, "descDropDown_"+cfgParamDTO.getConfigParamId());
IDataType dataType = wdContext.nodeFieldData().getNodeInfo().getAttribute("defaultdataType").getDataType();
IWDAttributeInfo attr = wdContext.nodeFieldData().getNodeInfo().addAttribute("FieldDescDropDownType"+cfgParamDTO.getConfigParamId(), dataType);
IModifiableSimpleValueSet<String> set = wdContext.nodeFieldData().getNodeInfo().getAttribute(attr.getName()).getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
Iterator<ConfigFieldStructureDTO> cfgStructIter = fieldValuesList.iterator();
while(cfgStructIter.hasNext())
{
ConfigFieldStructureDTO cfgStructureDTO = cfgStructIter.next();
String value = cfgStructureDTO.getFieldValue();
boolean selected = cfgStructureDTO.isSelected();
set.put(value,value);
if(selected==true)
{
wdContext.currentFieldDataElement().setAttributeValue(attr.getName(),value);
}
}
fieldDescDropDown.setWidth("28%");
fieldDescDropDown.bindSelectedKey(wdContext.nodeFieldData().getNodeInfo().getAttribute(attr.getName()));
Here defaultdataType I have created a blank context of type String.
cfgParamDTO is a class from where I am getting data to populate dropdown.
Other part of code is straight forward.
If you have any concern please let me know.
Kind regards
Sarsij
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please give more details (use-case, context structure etc.)
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>
> I need to create radio button group and dropdown dynamically in my application. Kindly suggest me the steps.
>
Hi,
Pls have a look -
Regards
Anagha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can go for the following links for Dynamic UI Creation.
http://help.sap.com/erp2005_ehp_03/helpdata/EN/4f/07cf3dd28b5610e10000000a114084/frameset.htm
To create a DropDownByIndex that displays the elements of node "Items" as its items, you write the following code in method wdDoModifyView():
IWDDropDownByIndex dd = (IWDDropDownByIndex) view.createElement(IWDDropDownByIndex.class, null);
dd.bindTexts("Items.Text");
IWDUIElementContainer parent = (IWDUIElementContainer) view.getElement("ID-of-parent");
parent.addChild(dd);
I hope the code and the links will help you a lot.
Thanx
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
In the domodifyView method ur View , create the Ui Element , which u want to display at runtime .
for eg :
IWDradioButton radio = view.createElemebnt()IWDRadioButtonb.class);
radio.set.....();
in this way , create drop down and bind the attribute to it .
hope it helps
Thanks and Regards
fazal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.