Skip to Content
0

UI5: Conditional tooltip on Switch button based on state

Aug 22, 2017 at 07:08 PM

60

avatar image
Former Member

I have a switch as one of the cells in a table. Is it possible to set two different tooltips to the SAP UI5 user interface control Switch (sap.m.Switch) based on the state of the control? For example if the switch is ON then the hover should show "Open" and if it is OFF then the hover should show "Closed".

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

avatar image
Former Member
Aug 23, 2017 at 12:02 AM
0
Share
10 |10000 characters needed characters left characters exceeded
Sharath M G Aug 22, 2017 at 07:51 PM
0

yes. Assign a variable as tool tip. Then based on the state of the bitton(on event) set the value of variable to on or off.

Share
10 |10000 characters needed characters left characters exceeded
Irfan Gokak Aug 23, 2017 at 07:20 AM
0

Hi,

Try this.

<Switch state="false" change="callChange"></Switch>
=======================================================
callChange : function(oEvent){
		if(oEvent.getParameter("state") == true)
			oEvent.getSource().setTooltip("True Tooltip");
		else
			oEvent.getSource().setTooltip("False Tooltip");
	}

Share
10 |10000 characters needed characters left characters exceeded