title: Retrieve Key value from Radiobutton in UI5 (xml View)
body: <p><div class="snippet" data-lang="js" data-hide="true">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>sap.ui.controller("test.controller", {
          
  onInit: function() {
   var aData = {
          items: [
          {
            ATNAM: "FIORI_PRG",
            ATWRT: "BA",
            ATWTB: "Barcelona"
          }, {
            ATNAM: "FIORI_PRG",
            ATWRT: "BE",
            ATWTB: "Berlin"
          }, {
            ATNAM: "FIORI_PRG",
            ATWRT: "HA",
            ATWTB: "Havanna"
          }, {
            ATNAM: "FIORI_TYP",
            ATWRT: "SE",
            ATWTB: "Sessel"
          }, {
            ATNAM: "FIORI_TYP",
            ATWRT: "ZW",
            ATWTB: "Zweisitzer"
          }, {
            ATNAM: "FIORI_TYP",
            ATWRT: "DR",
            ATWTB: "Dreisitzer"
          }, {
            ATNAM: "FIORI_FARBE",
            ATWRT: "BL",
            ATWTB: "Blau"
          }, {
            ATNAM: "FIORI_FARBE",
            ATWRT: "BR",
            ATWTB: "Braun"
          }, {
            ATNAM: "FIORI_FARBE",
            ATWRT: "GR",
            ATWTB: "Grün"
          }, {
            ATNAM: "FIORI_FARBE",
            ATWRT: "SW",
            ATWTB: "Schwarz"
          }, {
            ATNAM: "FIORI_BEZUGSSTOFF",
            ATWRT: "ST",
            ATWTB: "Stoff"
          },  {
            ATNAM: "FIORI_BEZUGSSTOFF",
            ATWRT: "KL",
            ATWTB: "Kunstleder"
          },  {
            ATNAM: "FIORI_BEZUGSSTOFF",
            ATWRT: "NL",
            ATWTB: "Naturleder"
          } ],
        };
  
        var oModel = new sap.ui.model.json.JSONModel();
        oModel.setData(aData);
        sap.ui.getCore().setModel(oModel);
      },
    
  radiobuttonselect:function(oEvent){
      var oSelectedIndex = oEvent.getParameter("selectedIndex");  
      var oRadioButtonSrc = oEvent.getSource().getAggregation("buttons");  
      var oSelectedRadio = oRadioButtonSrc[oSelectedIndex].getText();
  //oRadioButtonSrc[oSelectedIndex].getKey(); does not work
      alert(oSelectedRadio);
   },
   
    });
  
      var oView = sap.ui.xmlview({
          viewContent: jQuery("#view1").html()
      });
      oView.placeAt("content");</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;meta name="description" content="OpenUI5 BIN Starting template" /&gt;
    &lt;meta http-equiv="X-UA-Compatible" content="IE=edge" /&gt;
    &lt;meta charset="utf-8"&gt;
      &lt;script id="sap-ui-bootstrap" 
      type="text/javascript"
      data-sap-ui-libs="sap.ui.table,sap.ui.commons"
      data-sap-ui-theme="sap_bluecrystal" src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"&gt;&lt;/script&gt;
  &lt;script id="view1" type="sapui5/xmlview"&gt;
  &lt;sap.ui.core.mvc:View controllerName="test.controller"
      xmlns:c="sap.ui.commons"
      xmlns:k="sap.ui.core"
      xmlns:sap.ui.core.mvc="sap.ui.core.mvc"&gt;
      
      
     &lt;RadioButtonGroup xmlns="sap.m" id="Typ" buttons="{/items}" width="500px" columns="1" enabled="true" class="sapUiMediumMarginBottom" select="radiobuttonselect"&gt; 
        &lt;buttons&gt;                                                    &lt;RadioButton id="RBG1" text="{ATWTB}" key="{ATWRT}"/&gt;
        &lt;/buttons&gt;                                         &lt;/RadioButtonGroup&gt;
  &lt;/sap.ui.core.mvc:View&gt;
  
  &lt;/script&gt;
  
    &lt;title&gt;buttons Vs Combobox&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body class="sapUiBody"&gt;
    &lt;div id="content"&gt;&lt;/div&gt; 
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Hello Experts,
  this question is about to retrieve a key value from a radiobutton. To retrieve the text is possible (as in the snippet above), but I am having a hard time getting the key value (here is my attempt: <a href="http://jsbin.com/yoxube/edit?html,js,output" rel="nofollow">http://jsbin.com/yoxube/edit?html,js,output</a>) . Is it possible? what would be the way? thank you in advance and best regards,
  Gabriel</p>