如何在不使用RadioButtonGroup的情况下获取控制器中的RadioButton文本?

问题描述 投票:-1回答:1

我的看法:

<FlexBox
    alignItems="Start"
    justifyContent="SpaceBetween">
      <m:HBox alignItems="Stretch">
        <l:VerticalLayout>
          <m:RadioButton id="rb-Yes" text="Quotation" select="changeKdsr" selected="true"/>
        </l:VerticalLayout>
      </m:HBox>
      <m:HBox alignItems="Stretch"> 
        <l:VerticalLayout>
          <m:RadioButton id="rb-No" text="material" select="changeKdsr"/>
        </l:VerticalLayout>
      </m:HBox>
    </FlexBox>

控制器:

changeKdsr: function (e) {

        var rbText = e.getSource().mProperties.text; //this returns previously selected button text
    }

此changeKdsr函数也被调用了两次,所以我必须使用怪异的逻辑来使它起作用。

view controller radio-button sapui5
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.