on 07-21-2006 1:18 PM
Hi,
I have 2 radio buttons in 2 columns of the table say for 'yes' and 'No' options.
Initially both the buttons are not selected.Now I want to select one button from them.
I also want that only one button can be select at a time which means to say that for example if i select 'yes' button then the 'no' button should be unselected and vice versa. One button at a time. Either of them.
Please suggest.
Thanks,
vicky
Hi Vikram,
Probably u will be dioing in the method wdDoModifyView().
set the property of Radio button as selected .
--Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Use the Follwing Steps
Try This Code and also avoid my own variable and use your
own variable like p1 or janee or t etc.ok
it will be very helpful for you
A )Static Radio Button
You have to set leadselection only for static radio button
like
wdContext.getChildNode("NodeAcheck" + janee,IWDNode.LEAD_SELECTION).setLeadSelection(0);
B) Dynamic Radiobutton
Step1
Say p1=1
//Node Creation and assign for Yes/No
IWDNodeInfo info=wdContext.getNodeInfo().addChild("NodeAcheck"+p1,null,true,false,true,false,false,true,null,null,null);
info.addAttribute ("Name","ddic:com.sap.dictionary.string");
Step 2
Say t=1
for(int i=0;i<2;i++){
IWDNodeElement eles=wdContext.getChildNode("NodeAcheck"+t,IWDNode.LEAD_SELECTION).createElement();
eles.setAttributeValue("Name",janee<i>.toString());
wdContext.getChildNode("NodeAcheck"+t,IWDNode.LEAD_SELECTION).addElement(eles);
}
Create Mode
***********
wdContext.getChildNode("NodeAcheck" + janee,IWDNode.LEAD_SELECTION).setLeadSelection(0);
IWDAttributeInfo info=wdContext.getChildNode("NodeAcheck"janeeyx,IWDNode.LEAD_SELECTION).getNodeInfo().getAttribute("Name");
IWDRadioButtonGroupByIndex radioList = (IWDRadioButtonGroupByIndex)view.createElement (IWDRadioButtonGroupByIndex.class, "inpja"+1);
radioList.bindTexts(info);
radioList.setColCount(2);
Regards
Dhinakar J
You cannot use RadioButtonGroupByIndex as table cell editor, that's why I suggested using a CheckBox or DropDownBy{Index, Key} instead.
A solution with 2 columns and RadioButton as cell editor:
Context:
People (node, cardinality=0:N)
-- Name (attribute, string)
-- Gender (attribute, string)
(Gender could also be a DDIC type with value set {"male", "female"}).
Table.DataSource = People
Table.Columns = (ColumnName, ColumnMale, ColumnFemale)
ColumnName.TableCellEditor = TextView
ColumnName.TableCellEditor.Text = People.Name
ColumnMale.TableCellEditor = RadioButton
ColumnMale.TableCellEditor.KeyToSelect = "male"
ColumnMale.TableCellEditor.SelectedKey = People.Gender
ColumnFemale.TableCellEditor = RadioButton
ColumnFemale.TableCellEditor.KeyToSelect = "female"
ColumnFemale.TableCellEditor.SelectedKey = People.Gender
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why not simply using a checkbox or drop-down list and only one table column?
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.