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

Similar Messages

  • Calling a method in a bean when i clcked on the radio button of a table

    Hi,
    I need to call a method in the bean when i clicked on the radio button of a table
    I tried it , by callling the method in selectionListener..
    I can able to execute only System.out.prinln method,
    rather than that i am unable to execute any other expression..
    like setting rendering property to a component.
    Thanks in advance,

    Hi,
    what you say is not true. You can execute any code within a selection listener you want. If you can print then it shows the method s called and you can execute whatever you want within this method
    Frank

  • Radio button in a Table -Only one row/radio button selection to be possible

    Hi experts,
    I have a requirement from customer to have a radio button inside a table of a WebDynpro ABAP application. For example, a table containing list of mobile numbers.
    The columns has
    Mobile Model, Cost, Company name, and a radio button named choice.
    Only one record and hence one radio button can be chosen at a given time.
    When the user clicks on the radio button choice corresponding to the row of the mobile of his choice, the row should get lead selected .
    When the user chooses a different choice radio button (corresponding to another mobile) the old radio button choice should get deselected, new row and its radio button should be lead selected.
    Can you give me the code how to deselect the remaining radio buttons when a user selects on one Radio button

    Hi Sandeep ,
    Have a look at the events of table UI element and its paramaters , Here's the link.
    [Link|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/2d/390e422dfcde2ce10000000a1550b0/content.htm]
    The event 'Onselect' or 'OnLeadSelect' provides 4 standard paramaters , out of which , OLD_LEAD_SELECTION/OLD_ROW_ELEMENT is one of them.
    So you could use this element and set the attribute value (Which is bound to the radio button) to abap_false.
    Although I am not sure as to which event ight trigger ( ON_LEAD_SELECT / ON_SELECT ).:)
    Thanks,
    Aditya.

  • How to eliminate  select message  after Radio button in ADF tables

    how to eliminate select message after Radio button in ADF tables
    example <f:facet name="selection">
    <af:tableSelectOne>
    </af:tableSelectOne>
    </f:facet>
    output:
    radobutton select
    radiobutton select
    please help me regarding this issue.

    Hi,
    this usually has a text String in the header saying "Select and .." which can be changed through the property inspector for the TableSelectOne component
    Frank

  • How to deselect the Radio button from htmlb.table.TableView

    Hi Experts,
    Could you please help me, how to seselect the Radio button from htmlb.table.TableView?
    <hbj:tableView
                                       id="tbvCustomer"
                                       model="mcBean.csModel"
                                       design="ALTERNATING"
                                       headerVisible="TRUE"
                                       footerVisible="TRUE"
                                       navigationMode="BYPAGE"
                                       selectionMode="SINGLESELECT"                               
                                       fillUpEmptyRows="FALSE"
                                       headerText="Searchresults"
                                       visibleRowCount="10"
                                       onNavigate="CustomerSearchNavigate"
                                       visibleFirstRow="<%=mcBean.getCsVisibleFirstRow() %>">
    Problem: After searching and selecting the Customer in the table, then again we are searching for another customer. After that the searched customer is displaying in the Table. By default the table Radio button is selected. Because for first Customer we have selected the Radio button. How we can deselect the FRadio button while searching for another Customer.
    Thanks In Advance.
    Regards,
    Vijay.

    I think it is <2095>.
    In SmartForms, go to your text window. 
    Use the icon on the top left of the text window to switch to the old editor.
    INSERT -> CHARACTERS -> SAP ICONS. 
    Do a FIND on "radio".  It's called ICON_WD_RADIO_BUTTON_EMPTY.

  • How can I select a radio button in a table regarding the data in the cells?

    Hi everyone
    This is the issue: I need to select the RadioButton which is in a table with data related to transfers in the cells next to it, so I need to select the correct radio regarding the data next to it.
    This is the whole process: First I go to the Add Recurring Transfer section and select the parameters of the transfer (Accounts, date, amount, months etc), then with VB code I capture those parameters from the page and store them into Global variables for further usage on my E-tester script.
    Right after that I need to select the radiobutton regarding the data of the transfer that I already created in order to delete it or modify it (Please see Attachment selectradio1.jpg)
    So How can I move along the table and compare each cell with the variables that I created with the transfer information, so when I finish comparing a row cell by cell and if all the comparison match well in that row, I could select the radiobutton of the row.
    Note: Second Attachment selectradio2.jpg shows the source code of the table...If you need more info please let me know
    Could you please help me with this problem?? I'm Kind of frustrated with this issue jejeje

    Here is an example. I uploaded mock html so that you can actually try this code. I think this does exactly what you are asking.
    Private Sub RSWVBAPage_afterPlay()
    Dim tbl As HTMLTable
    Dim tblRow As HTMLTableRow
    Dim tblCell As HTMLTableCell
    Dim strValue As String
    Dim rButton As HTMLInputElement
    ' ******** This would be your global variable. I put this so that values are seperated by a semicolin you can use what ever format works for you.
    strValue = "03/22/2008;03/22/2008;*************1977;*************1977;$25.25;Jan, Jun, Jul, Dec"
    ' Strip out the ; for inner text comparison
    strValue = Replace(strValue, ";", "")
    ' This will get the table but can be modifoed to be more specific
    Set tbl = RSWApp.om.FindElement(, "TABLE")
    ' This loops through all the rows in the table until a match to the strValue is found
    ' then clicks the radio button. Findelements allows you to specify a root element
    ' once the correct root row is found, FindElemets can get the correct radio button
    For Each tblRow In tbl.rows
      If tblRow.innerText = strValue Then
        Set rButton = RSWApp.om.FindElement("account", "INPUT", "NAME", , , tblRow)
         rButton.click
       End If
    Next
    End Sub
    I also uploaded the script I created. You should be able to run it and see how it works.
    This should get you going.

  • Radio button in report table

    Hi,
    I have a table with two columns: NAME and PRIMARY
    Only one name should be the Primary name (PRIMARY='Y') all the others are secondary (PRIMARY='N').
    I have created an updateable report on that table and it's working fine... except the PRIMARY field returns as text boxes so there's nothing (on the surface) to stop a user trying to set two names with PRIMARY=Y.
    A nice way around this would be to have that field display as a radio button where only one row in the report can have it selected.
    Is that possible and, if so, can you give me a pointer in the right direction to make it work?
    Thanks,
    Joseph

    Thanks (again) Andy.
    That looks like it's exactly what I'm after... but reading through the thread I see you've said that it can't be used with the standard mutli-row updates/deletes that I have in my report.
    Since this is my first App (throwing myself in at the deep end to try and learn it) I'm nowhere near confident enough to replace the standard functionality with my own (yet). Think I'll stick this in the list of features to come in version 2 and revisit this thread as soon as I understand it ;)
    Thanks again (again).
    Joseph

  • Adding Radio Button in a Table

    Hi
    I need to create a table in which there has to be a column for radio button.
    The radio button will be used to set one row as default row (row corresponds to template in application) i.e i need to set 1 template as default.
    I feel that this cannot be done using SingleSelection of table since i also need to set initial value of radio from database (which will be the radio selected previously)
    Now how can this be implemented using RadioGroup.
    If it is possible in any other way please advice
    Thanks
    Husain

    You should be able ti use the SingleSelection feature. In your CO processRequest, identify the Row which need to be selected based on your business logic, and set the value of the Attribute mapped to Select Field to 'Y'.
    The Radio button select/unselect is controlled by the value of the mapped to Selection field('Y' - Select, N - unselect).
    Hope this helps.
    Srini

  • Replacing SAP Object Selector with Radio Button in ALV table in WD ABAP

    Hi All,
    I have a view in Webdynpro ABAP which displays data in an ALV table view (using SALV_WD_TABLE component).
    By default we have the SAP Object Selector for selecting a particular row of the table. This has to be replaced with radio buttons.
    I mean instead of using the SAP Object Selector, I need radio buttons at the start of each row.
    What I have thought of is to make the SAP Object Selector Invisible and create another attribute for the radio button in the node which contains ALV output data.
    Can you please let me know how to remove the SAP Object Selector from ALV output table and also how to include a column with radio button in the ALV output table.
    Thanks and Regards,
    Sayan Ghosh

    Hi Lekha,
    I am working with HRASR00_PROCESS_EXECUTE WD component of MSS application. In order to generate the data, this in turn calls another component called DATAOBJECTPROVIDER. I need to make the table selection as none and replace the SAP Object Selector with the radio button.
    Do you know under which method in DATAOBJECTPROVIDER do we need make the changes. I tried to search all the methods but couldnt understand a suitable one.
    Thanks and Regards,
    Sayan Ghosh

  • Default selection of radio buttons in  a table

    Hi
    I have a table which has 3 columns of radio buttons. I want to set one as the default selected one. The radio buttons selected kye property is linked to the sub node of model node. its cardinality is 1:1.I tried doing it through the supply functions, but it throws an error for the cardinality.
    I wrote the following piece of code in the wdModifyView(), but again the same error is displayed
    if (firstTime)
        int size = wdContext.nodeCmpNode_UserRights().size();
        IPrivateAssign_AuthenticationView.ICmpNode_UserRightsNode userright_node = wdContext.nodeCmpNode_UserRights();
         IPrivateAssign_AuthenticationView.INode_AuthorizationNode node = null;
         IPrivateAssign_AuthenticationView.INode_AuthorizationElement element = null;
        for(int i = 0;i<size;i++)
             node = userright_node.nodeNode_Authorization();
              element = node.createNode_AuthorizationElement();
         element.setAuthorization("Read");
         node.addElement(element);
    I changed the cardinality to 0..n, but in this case only the first row comes as enabled with default radio button marked. For 1..n all the rows are enabled but no radio buttons are marked default.
    Can someone please suggest in this regard.
    Thanks & regards,
    Anupreet

    Hello,
    Set the singleton property of the Sub Node (Value Node) to <b>false</b> and cardinality to 1:1.
    Under the Sub Node, create a value attribute "SetRadio" (datatype: String) and bind it to the <i><b>selectedKey
    </b></i> property of the radio button <i>column1</i>.
    Similarly, create a value attribute "DontSetRadio" (datatype: String) and bind it to the <i><b>selectedKey
    </b></i> property of the radio button <i>column2</i>.
    Then write the supply function to set the default selection for a specific column.
    A pointer code is shown below.
    public void supplyRadio(IPrivateTable_OVSCompView.IRadioNode node, 
    IPrivateTable_OVSCompView.IUserListElement parentElement)
        //@@begin supplyRadio(IWDNode,IWDNodeElement)
         IPrivateTable_OVSCompView.IRadioElement
                       radioElem = node.createRadioElement();
             * Set the default radio button column to be selected
            radioElem.setSetRadio(null);
             * Blank out other radio button columns
            radioElem.setDontSetRadio("gbhjd");
         parentElement.nodeRadio().addElement(radioElem);
        //@@end
    Bala

  • Putting radio buttons in a table

    I am creating an employment application form.
    The application contains a table for education information, and I want Yes and No radio buttons in each row of the table. I want Yes and No to be an exclusion group in each row, but not with the other rows.
    Can someone tell me how to do this?
    Thanks!
    Cindy

    I tried doing that - albeit by accident - but had trouble getting the buttons aligned properly in the table. I kept getting a subtable or subform in there, which wasn't what I wanted.
    Also, what do you mean by moving the objects around in the hierarchy? If I have a hierarchy in the form, it's nothing I did intentionally.
    I'm sorry - I need more information.

  • Radio button in data table

    Hi,
    In continuation to my previous post, i have another requisite.
    I have a pop and get my data from a data table.for each of my row in datatable i need to get a radio button.
    presently am using f:selectoneradio.
    At a time only one radio has to be selected.I understand jsf radio button does not support this.
    Is there anyway that i can achieve this?
    Does tomohawk tags support this feature?or shud i have to go only for some custom component?

    Here is an example. I uploaded mock html so that you can actually try this code. I think this does exactly what you are asking.
    Private Sub RSWVBAPage_afterPlay()
    Dim tbl As HTMLTable
    Dim tblRow As HTMLTableRow
    Dim tblCell As HTMLTableCell
    Dim strValue As String
    Dim rButton As HTMLInputElement
    ' ******** This would be your global variable. I put this so that values are seperated by a semicolin you can use what ever format works for you.
    strValue = "03/22/2008;03/22/2008;*************1977;*************1977;$25.25;Jan, Jun, Jul, Dec"
    ' Strip out the ; for inner text comparison
    strValue = Replace(strValue, ";", "")
    ' This will get the table but can be modifoed to be more specific
    Set tbl = RSWApp.om.FindElement(, "TABLE")
    ' This loops through all the rows in the table until a match to the strValue is found
    ' then clicks the radio button. Findelements allows you to specify a root element
    ' once the correct root row is found, FindElemets can get the correct radio button
    For Each tblRow In tbl.rows
      If tblRow.innerText = strValue Then
        Set rButton = RSWApp.om.FindElement("account", "INPUT", "NAME", , , tblRow)
         rButton.click
       End If
    Next
    End Sub
    I also uploaded the script I created. You should be able to run it and see how it works.
    This should get you going.

  • Create Radio button dynamically in Table column.

    HI All
       I have used following code to create radio button dynamically. but it's getting dump saying that Could not find attribute STATUS. 
    Here STATUS is the attribute of the node in View context. But why this dump is coming. 
    Please correct me if any thing worng.
      DATA: lr_radio TYPE REF TO cl_wd_radiobutton.
      DATA: lr_containr TYPE REF TO cl_wd_transparent_container.
      DATA: lr_data TYPE REF TO cl_wd_flow_data.
      IF first_time = abap_true.
        lr_containr ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
        lr_radio = cl_wd_radiobutton=>new_radiobutton(
        view = view
        id = 'RADIO'
        text = 'Enroll'
        bind_selected_key = 'STATUS'
        key_to_select = 'STATUS' ).
        lr_data = cl_wd_flow_data=>new_flow_data( element = lr_radio ).
        lr_radio->set_layout_data( lr_data ).
        lr_containr->add_child( lr_radio ).
      ENDIF.
    Thank you very much
    Ram

    Hi Rama,
    I solved it.check this code.
    i think u did mistake in creating radio button you are not passing the 
    BIND_KEY_TO_SELECT
      instead you are passing KEY_TO_SELECT.
    data:lr_column2 type ref to cl_wd_table_column,
         lr_radio type ref to cl_wd_radiobutton.
       lr_column2 = obj_table->get_column(
                   id         = 'TABLE1_PLANETYPE'
    *              INDEX      = INDEX
    lr_radio = cl_wd_radiobutton=>new_radiobutton(
    *      BIND_ENABLED        = BIND_ENABLED
           BIND_KEY_TO_SELECT  = 'STATUS'
    *      BIND_KEY_VISIBLE    = BIND_KEY_VISIBLE
    *      BIND_READ_ONLY      = BIND_READ_ONLY
           bind_selected_key   = 'STATUS'
    *      BIND_STATE          = BIND_STATE
    *      BIND_TEXT           = BIND_TEXT
    *      BIND_TEXT_DIRECTION = BIND_TEXT_DIRECTION
    *      BIND_TOOLTIP        = BIND_TOOLTIP
    *      BIND_VISIBLE        = BIND_VISIBLE
    *      ENABLED             = ABAP_TRUE
    *      EXPLANATION         = EXPLANATION
           ID                  = 'RAD1'
    *      KEY_TO_SELECT       = KEY_TO_SELECT
    *      KEY_VISIBLE         = KEY_VISIBLE
    *      ON_SELECT           = ON_SELECT
    *      READ_ONLY           = READ_ONLY
    *      STATE               = E_STATE-NORMAL
           TEXT                = 'Test'
    *      TEXT_DIRECTION      = E_TEXT_DIRECTION-INHERIT
    *      TOOLTIP             = TOOLTIP
    *      VIEW                = VIEW
    *      VISIBLE             = E_VISIBLE-VISIBLE
    lr_column2->set_table_cell_editor( the_table_cell_editor = lr_radio  ).
    Thanks,
    Suman

  • Using radio button selection in multiple tables

    Hello All,
    I've got a bit of a design issue and it being a Friday my brain is a bit foggy and I can't seem to figure out a solution.
    what I want to do is have 3 tables. The user should only be able to select one line from any of the three tables.
    I can do this by having events that clear down selection on the two other tables on any selection of the third, but the select buttons of tables don't really give the UI impression that only one row can be selected. To do this I'd like to use the radio button element.
    so
    table A
    choice - name
    (o) - Anne
    (o) - Bob
    (o) - Charlie
    Table B
    choice - name
    (x) - David
    (o) - Ellen
    (o) - Fran
    Table C
    choice - name
    (o) - George
    Here the entry in table B for David is selected. But any selection of any of the other options should deselected.
    My thoughts are to use a radio button ui element, bind the "selected" value to a unique id for each row/table (an attribute of the node element for each table) and the value to a common shared attribute (not table specific).
    Any better ideas - and certainly any which would mean I'm not going to have to maintain a lookup table of my unique ids and node elements to find out which one is selected?
    Cheers,
    Chris

    Ok - here's how I did it.
    I created another lookup table which had a guid and reference to the element.
    in the each elements I had a guid which I bound to the key for selection property of the radio button in the table.
    I then bound the selected key property to an attribute that was common to all elements.
    in my "processing" logic I read the selected key, read the lookup table - and therefore got the reference to the selected element.
    Would have been an awful lot easier if I could have used a reference to the element itself as the "key" - but that was required to be a character field.
    [image showing radio button selection working across multiple tables|http://i51.tinypic.com/bi79dx.jpg]
    End result works quite nicely.
    Cheers,
    Chris

  • 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

Maybe you are looking for