Radio button in table column

Hi,
I display a table of data. The user wants to select a row. For this, there is a column called "Select" with a radio button. The user is allowed to select only one column, but they want to do it by clicking on a radio button, not using lead selection. My problem is, that several of the radio buttons are "selected". How do I make only one radio button selectable? I want to be able to click on one radio button, and if I click on another one the first choice should be vacated.
Or if I were to use lead selection, is there an easy way to tie the radio button with the lead selection. Like, if the user selects a row, can the radio button in this row get turned on automatically?
I welcome any hints
Thanks,
Ira

Hi Ira,
I'm not sure I understand why you would want this as lead selection should be sufficient for most selection cases.  Still, one way you could use this is to embed an action hander to the OnLeadSelection event of the table.  Here are my thoughts:
1. Have an attribute in the context node of type WDY_BOOLEAN or some other boolean to represent your radio button.
2. Bind the cell editor of your colum to a radio button or check box and set the value to the context attribute.  You will also want to set the enabled setting to FALSE.
3. Add an action to OnLeadSelect for your table
4. Have the action handler do your button logic.
Perhaps if you give an example of the scenario for this, I'd be able to help with the solution.
Regards,
Adam

Similar Messages

  • Radio button in three column in a single selection-screen

    Hi,
    I am trying to create radio buttons with three column within a single selection-screen.
    I.e.
    Column 1:
    radio1
    Column2:
    radio2
    radio3
    column3:
    radio4
    radio5
    radio6
    Also I wish to give three names(as headers) to each columns.Is is possible?If yes how?

    Hi,
    write as :
    SELECTION-SCREEN COMMENT /1(50) text-001.
    PARAMETERS: r1 RADIOBUTTON GROUP rad1.
    SELECTION-SCREEN COMMENT /1(30) text-002.
    PARAMETERS: r2 RADIOBUTTON GROUP rad1,
                r3 RADIOBUTTON GROUP rad1.
    SELECTION-SCREEN COMMENT /1(30) text-003.
    PARAMETERS: r4 RADIOBUTTON GROUP rad1,
                             r5 RADIOBUTTON GROUP rad1,
                             r6 RADIOBUTTON GROUP rad1.
    Regards,
    Srini.

  • Adding Radio buttons to table cell

    Hi,
    Im a beginner in JAVAFX, i would like to add a radio button to table cell.
    Please could anybody help us on this.
    Thanks,
    Dhanraj

    Hi,
    Im a beginner in JAVAFX, i would like to add a radio button to table cell.
    Please could anybody help us on this.
    Thanks,
    Dhanraj

  • Creating radio buttons in table coloumn.

    Please share any documents available on how to
    create  and implement radio buttons in table coloumns .
    And please also share how to read the enabled or diaabled radio buttons

    Here is a guide to provide this feature:
    The context:
    - Persons (Node)
    -- Name (Attribute)
    -- SelectedKey (Attribute, String)
    -- Selection (Node, cardinality: 0..1, selection: 1..1, supplyFuntion selectPerson)
    --- KeyToSelect (Attribute, String)
    Layout:
    - Add table with dataSource propertie: Persons
    - Tablerow TextView with propertie text: Persons.Name
    - Tablerow RadioButton with propertie keyToSelect: Persons.Selection.KeyToSelect, selectedKey: Persons.SelectedKey, onSelect: SelectPerson
    Code:
    public void selectPerson(......) {
    ISelectionElement el = node.createSelectionElement();
    node.addElement(el);
    el.setKeyToSelect(parentElement.getName());
    public void onActionSelectPerson(.....) {
    for (int i=0; i < wdContext.nodePersons().size(); i++) {
    if (i != wdContext.nodePersons().getLeadSelection()) {
    wdContext.nodePersons().getElementAt(i).setAttributeValue("SelectedKey", null);
    Method above is for not getting a multiple select (work-around)
    If you have a button in your layout that submits the selection, you can read the selected row with:
    String key = wdContext.nodePersons().currentPersonsElement().getSelectedKey();
    wdComponentAPI.getMessageManager().reportSuccess(key);
    Regards,
    Björn
    Paresh,
    Does this guide solved your problem?
    Message was edited by: B. van Prooijen

  • Radio button in table

    Hi Experts
    My Problem is i need 2 RadioButtons in a Table.so i have inserted 2 RadioButtons (Accept & Reject)in
    cellEditor and i have binded those values to the boolean value which is coming from the BackEnd
    .but my problem is i can select both the radiobuttons and on selecting it is showing an error
    is Not A Valid value.but i need only one radio button to be selected for a row.How can i get this?
    Regards,
    Asif

    I forgot to say that the value node must be non-singleton (singleton=false) such that it exists for every parent node element (table row).
    Say you have the following context structure:
    Rows (node, c=0:n, s=0:n)
    -- Selection (node, c=1:1, s=1:1, singleton=false)
    ---- value (string)
    Add two table columns "AcceptColumn" and "RejectColumn", and add two RadioButtons "AcceptButton", "RejectButton" as cell editors. Bind the "selectedKey" property of both radio buttons to attribute "Rows/Selection/@value". Further assign an action (at least a dummy action) to both buttons.
    Now, to initialize the values for the table rows, write code like
    for (int i = 0, n = wdContext.nodeRows().size(); i < n; i++)
      IRowsElement row = wdContext.nodeRows().getRowsElementAt(i);
      /* this line defines which radio button should be selected in the row at index i: */
      row.currentSelectionElement().setValue("accept"); /* or "reject" */
    To check the value of the radio buttons in row at index i:
    IRowsElement row = wdContext.nodeRows().getRowsElementAt(i);
    String value = row.currentSelectionElement().getValue();
    if ("accept".equals(value))
    else if ("reject".equals(value))
    else
      /* null or illegal value */
    Armin

  • Radio Button of two columns to be grouped

    Dear Experts,
    I have a table with columns like SUBSCRIBE and UNSUBSCRIBE which are wdy_boolean data type and displaying as radio buttons.
    The problem is both columns are displaying as selected and want to make these two columns as group so only one can be selected.
    I mapped cell variant with other column but its not hit.
    Please suggest.
    Thanks & Regrads
    Siva Mandapudi.

    Hello Siva,
    To achieve this functionality do the following
    1. Create one context attribute by name 'selectedValue' ( type string) under the context node of the table
    2. create two columns in the table with name SUBSCRIBE and UNSUBSCRIBE (as you did already). let the cell editor be RadioButton. Cell variants are  not required
    3. Now for the SUBSCRIBE radio button, bind the 'selectedKey' property to 'selectedValue' context attribute. And maintain the 'KeyToSelect' property as 'SUBSCRIBE'
    4. for the UNSUBSCRIBE radio button, bind the 'selectedKey' property to 'selectedValue' context attribute. And maintain the 'KeyToSelect' property as 'UNSUBSCRIBE'
    so whenever the user selects a radiobutton, corresondinf values SUBSCRIBE or UNSUBSCRIBE will be stored in the selectedValue context attribute.
    Hope this helps. you can refer the following article for more details
    [http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/d0aba847-ff58-2c10-4a98-c0fad334c5aa]
    BR, Saravanan

  • Association of radio buttons to table rows

    Hi
    I am using servlets to connect to a database and display it in the form of HTML table. I need to assign a radio button to each row. This table contains around 100 rows. THe radio button should be a column before "Name". How can I assign a radio button to each row without doing 100 times like
    <input type=radio name="id" value="1"> <input type=radio name="id" value="2"> ...so on for each row because I am using result set to display the table.
                                                  while(rs.next())
                                                    out.println("<TR>");
                                                    out.println("<TD>" + rs.getString("NAME") + "</TD>");
                                                    out.println("<TD>" + rs.getString("PHONE") + "</TD>");
                                                    out.println("<TD>" + rs.getString("ADDRESS") + "</TD>");
                                                    out.println("<TD>" + rs.getString("ADDRESS") + "</TD>");
                                                    out.println("</TR>");
                                                  ex table:
                                                  Name  Phone  Address   State
                                                  asd    asd     dasd     dasd
                                                  sada   dasd    dasd     sadas
                                                  sda    dasd    sadas    dasd
                          Any help would be greatly appreciated
    Thanks

    You could do it in a loop...
    for (int i = 0; i < 100; i++) {
    <input type=radio name="id" value="<%=i%>">
    Hope this helps!

  • Grouping Of radio Buttons in table Control

    Hi All,
              I have one problem in my table control.I am using some radio buttons in the table control.I want that in one row only one button is selected.I have grouped them.But iam not getting mutual exclusivity row wise.Infact I am getting it column wise i.e i am not able to select more than one button in one column but i can select multiple buttons in one row.
    Please suggest.
    Thanks In Advance,
    Saket

    Hi ,
           The above mentioned is the way of creating a radio button in a table control . Can u elaborate on the issue i.e input field disabled.

  • How to put a radio button ina table

    Hi Frndz..
    I want to show a radio button in a table which table contains multiple rows, so with this radio button user can select only one row out of multi rows.
    My table like this am getting the data from RFC...
                       PONum                  BarCode                    OptionButton
                          100032                   rnsnsv-e3r                   radiobutton
                          100043                   sae489-q3                   radiobutton           
                          100034                   fs88a7-df4                   radiobutton   
    So with the option of radio button user can select only one row..
    while using Insert Table cell editor am adding a radio button but am not able go ahead...suggest me if u have any ideas.
    Thanks in Advance
    Regards
    Rajesh

    Hi Rajesh,
    Try this:
    Step1: Right click on RootUIElementContainer and manually insert the Table
    Step2: Now right click on Table and Insert the TableCoulmn Group
    Step3: In the TableColumnGroup Insert TableColumn
    Step4: Now Insert TableCellEditor  Radio Button Type.
    Step5: Bind the value attributes to the Radio Button property called selectedKey and KeyToSelect and deploy the application
    Thanks
    Krishna

  • Hide button in table column

        Hi ,
        I have added 2 buttons in one table column using layout. if the bindproperty for that column is "Approved" than that buttons set to false, if the bindproperty is "Pending" than buttons get visible. i am trying this code, but it is not going to that if condition and switch case
         oTable.addColumn(new sap.ui.table.Column({
          label: new sap.ui.commons.Label({text: "Status"}),
          template: new sap.ui.layout.HorizontalLayout({id:"HL",
            content : [
              new sap.ui.commons.Button({id:"btn1",
                text: "Assign status"
              new sap.ui.commons.Label({}),
              new sap.ui.commons.Button({id:"btn2",
                text : "Deny"
         ).bindProperty("visible","Status",function(oEvent){
          var bt = sap.ui.getCore().byId("HL");
       //   var bt1 = sap.ui.getCore().byId("btn2");
         // var bt2 = sap.ui.getCore().byId("btn3");
          if (oEvent === "Approved"){
           bt.setVisible(false);
    i am trying to use Switch case also
       /* switch(str)
                 case 'Approved' :
                  return bt.setVisible(false), bt1.setVisible(false),bt2.setVisible(false);
                 case 'SE' :
                  return bt.setVisible(true), bt1.setVisible(true),bt2.setVisible(true);
    Can anybody help me in this
    Thanks & Regards,
    Jayasree.

    Hi Robin,
      We tried that is useful, now we are doing same for Table col template.     In template I am having one button and one textview( i used horizantal layout for this).
         oTable.addColumn(new sap.ui.table.Column({
          label: new sap.ui.commons.Label({text: "Status"}),
          template: new sap.ui.layout.HorizontalLayout({id:"HL",
            content : [
              new sap.ui.commons.Button({id:"btn1",
                text: "true"
              new sap.ui.commons.Label(),
              new sap.ui.commons.TextView({id:"TV1",
                text : "True"
              new sap.ui.commons.Button({id:"btn2",
                text: "false"
              new sap.ui.commons.Label(),
              new sap.ui.commons.TextView({id:"TV2",
                text : "false"
         ).bindProperty("text","Status",function(oEvent){
          var bt1 = sap.ui.getCore().byId("btn1");
         var tv1= sap.ui.getCore().byId("TV1");
         var bt2 = sap.ui.getCore().byId("btn2");
         var tv2= sap.ui.getCore().byId("TV2");
          if (oEvent === "1"){ //true
           bt.setEnabled(true);
    tv1.setEnabled(true);
          else (oEvent === "0"){ //false
           bt.setEnabled(false);
    tv1.setEnabled(false);
    i am trying to use Switch case also
       /* switch(str)
                 case '1' :
                  return  bt.setEnabled(true),tv1.setEnabled(true);
                 case '0':
                  return  bt.setEnabled(false),tv1.setEnabled(false);
    but no use it is not able to bind text and button property at a time.

  • Radio button in table toolbar

    Hi,
    I need to insert a radio button in a table toolbar. Is this possible in WD ABAP.
    Regards
    Azad

    Not available in NW04s SP8.
    In the view element heirarchy, right click on the Toolbar inside the table.
    Then choose insert element.
    The popup has only those elements supported.
    Toolbar_toggle_button is the closest option.
    but no radio button.
    Cheers
    Phil.

  • Radio button in table maintainenance

    HI Experts,
    In table maintenance view of a table i want to see one field as radio button and want to have checked for one of the entries out of the set of entries.
    My table contain four field.
    Key1 key2 nonkey1 nonkey2
    I want to have nonkey2 as X for only one records for all same key1.
    example data set
    key1  key2 nonkey1 nonkey2
    E1    1    eame   X
    E1    2    eame2
    Here user shd not be able to put second row nonkey2 as X.  This i want to achieve through radio button for nonkey2 in table maintenance.
    Please advise.
    Regards
    Shiv

    > example data set
    >
    > key1  key2 nonkey1 nonkey2
    >
    > E1    1    eame   X
    > E1    2    eame2
    >
    > Here user shd not be able to put second row nonkey2 as X.  This i want to achieve through radio button for nonkey2 in table maintenance.
    Hi Shivaram,
    I could'nt get you....
    If key1 and key2 are different in both cases then why can't the monkey2 be 'X'.
    and the functionality you are talking about can also be easily achieved by using list box which has a value 'Blank' and 'X'.
    Hope it helps you,
    Regards,
    Abhijit G. Borkar

  • Button in Table column pass key and navigate to different (detail page)

    So in the tutorials, you typically have a form w/ navigation buttons (first/previous/next/last), then you add a button w/ an action that references a Control Flow case.
    Instead of a form, I'm trying to use a table with a pushbutton as a column per row to mimic that functionality. I assume I need to use a backing bean for the page, and pass in a binding, but I'm at a lost. Looking for some direction, or some sample, or any help.
    Sorry for such a n00b question - searched via OTN but couldn't find what I was looking for.

    Yes you can call an action that you have in the page's ADF binding from another piece of your backing bean.
    This section of the Fusion Developer Guide should help - 27.4 Overriding Declarative Methods
    http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/web_adv.htm#CACDJCFE

  • Radio Button in a table

    Hi ,
    My requirement is to have a radio button in a table .
    scenerio : i have 3 coloumns in a table as shown below
    From Date      To Date            Select
    Select coloumn is a radio button . i made that coloumn to a radio button in table not in SALV .
    Now , data will be fetched from the DB for first two coloumns and where the difference of FROMDATE AND TODATE will be greater or equal to 5 only those rows should have a active radio button which can be clicked .
    Other rows should have disabled radio button.
    Moreover , User can select only one radio button at a time .
    if it can be possible with SALV , suggest me that option as well.
    Thanks.

    Hello,
    find the steps to achieve your requirement with normal table UI element. I'm not sure whether the same will work for alv. I expect it to work
    1. Create one boolean attribute in the Table Context node to indicate whether the radio button should be enabled or not (Attribute name : say RB_ENABLED). Populate the value of this attribute based on your From_Date DIF TO_DATE >= 5.
    2. Create a string attribute in the table context node to indicate the value for the radio button (Attribute Name: say RB_VALUE)
    Populate the Value of this attribute like for first record say FIRST and second record say SECOND. Or if you have unique Id for each row then you populate the same here.
    This attribute is required to identiy which radio button is selected by the user
    3. Create a context node (say RB_SELECTED) of cardinality 1..1 and an attribute of type string (say RB_SELECTED)
    4. In the table ui element, create a Radio button column and bind the following
    enabled property to RB_ENABLED attribute
    KeyToSElect to RB_VALUE attribute
    SElectedKEy to RB_SELECTED.
    So at runtime whenever the user selects a radio button, the correpsonding value will be set in the RB_SELECTED attribute. example if the user selects the radio button in the first row, the value 'FIRST' will be populated in the RB_SELECTED attribute.
    BR, Saravanan

  • Two radio button in each row of Table view

    Hi,
    I have a issue like two radio button should come in each row of the tableview and any one only can be selected and selected value should be assigned to a variable.
    Kindly help with coding in methods RENDOR_CELL_START AND RENDER_ROW_START.
    Thanks in Advance.
    Saravanan.

    Saravanan,
    If you keep the Radiobutton in 2 different column then it wil difficult to put it in one Radiobuttong Group. I am not sure its possible or not. I would suggest you do keep both the "Approved" & "Rejected" radio button in single column as shown below so that the memont "Rejected" is selected, "Approved" will be unchecked.
    WHEN 'Your Column'.
            DATA: RAD_GRP TYPE REF TO CL_HTMLB_RADIOBUTTONGROUP,
                     RAD_BTN  TYPE REF TO CL_HTMLB_RADIOBUTTON,
                     COL_BEE TYPE REF TO CL_BSP_BEE_TABLE.
              CREATE OBJECT COL_BEE.
              RAD_GRP = CL_HTMLB_RADIOBUTTONGROUP=>FACTORY(
                      ID = P_CELL_ID COLUMNCOUNT = '2' ).
              COL_BEE->ADD( ELEMENT = RAD_GRP LEVEL = 1 ).
              RAD_BTN ?= CL_HTMLB_RADIOBUTTON=>FACTORY( ID = '1' TEXT = 'Approved' ).
              COL_BEE->ADD( ELEMENT = RAD_BTN LEVEL = 2 ).
              RAD_BTN ?= CL_HTMLB_RADIOBUTTON=>FACTORY( ID = '2' TEXT = 'Rejected' ).
              COL_BEE->ADD( ELEMENT = RAD_BTN LEVEL = 2 ).
              P_REPLACEMENT_BEE ?= COL_BEE.
          ENDCASE.
    Again to get the selected radiobutton, use method REQUEST->GET_FORM_FIELDS
    DATA: GT_TIHTTPNVP TYPE TIHTTPNVP.
    REFRESH GT_TIHTTPNVP.
    CALL METHOD REQUEST->GET_FORM_FIELDS
      CHANGING
        FIELDS = GT_TIHTTPNVP.
    For example, suppose your 3r column has 2 radio buttons & In 1st Row if you've selected the radiobutton 2. THen get_form_fields return the below value.
    TV1_1_3 = 2. Here TV1 is tableview name & 1 - Row 1 & 3 -Column three. value 2 indicates that 2nd radio button is selected.
    DO 10 TIMES. "Here 10, stands for number of visible rows in tableview
    concantenate 'TV1' '_' sy-tabix '_' '3' into v_cell_id. "Here now v_cell_id will have TV1_1_3 for 1st row & etc..
    Read table GT_TIHTTPNVP into wa with key name = v_cell_id.
    if sy-subrc = 0.
    v_selected_rad_btn = wa-value. " THis will give you the selected radio button.
    endif.
    enddo.
    Hope this will solve your problem.
    Raja T
    Message was edited by:
            Raja Thangamani

Maybe you are looking for