Skip to Content
avatar image
Former Member

SAPUI5 segmentedButton set none selected

Hi, I've added a segmentedButton object in my app but one is default selected. I need none to be selected so that the user chooses one of them. I've had a look at the examples and all seem to have one button selected. I have as follows:

<SegmentedButton> <items>

<SegmentedButtonItem text="yes" key="yes" press="actionInput" /> <SegmentedButtonItem text="NO" press="actionInput"/>

</items> </SegmentedButton>

How can I have both buttons displayed unselected ?

Thanks.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Jun 26, 2017 at 07:53 AM

    Hi,

    <SegmentedButton selectedButton="none"> 
    	<items>
    		<SegmentedButtonItem text="yes" key="yes" press="actionInput" /> 
    		<SegmentedButtonItem text="NO" press="actionInput"/>
    	</items>
    </SegmentedButton>
    
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 24, 2017 at 01:13 AM

    Hi

    You can play a trick like this.

    https://jsbin.com/kemejib/edit?html,js,output

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks, this was an option, using an invisible button and mark it as selected. It's also working!