Skip to Content

Enabling all Check Box using single Button in SAP UI5.

Mar 29, 2017 at 07:22 AM


avatar image
Former Member

Hello All,

I am trying to enable All the CheckBox on my screen using single button click. But i am not able to do that i have tried many things but it is not working. Please help me.


<mvc:View controllerName="CheckBox.controller.check1" xmlns:html="" xmlns:mvc="sap.ui.core.mvc"
	displayBlock="true" xmlns="sap.m">
			<Page title="{i18n>title}">
						<Button text="Select All" press="onPress"/>
						<CheckBox text="Option a" id="cb"/>
						<CheckBox text="Option b" name="cb"/>
						<CheckBox text="Option c" name="cb"/>
						<CheckBox text="Option d" name="cb"/>
						<CheckBox text="Option e" name="cb"/>
						<CheckBox text="Warning" valueState="Warning" name="cb" />
						<CheckBox text="Error" valueState="Error" name="cb"/>


], function(Controller) {
	"use strict";

	return Controller.extend("CheckBox.controller.check1", {
		onPress: function() {
		sap.m.MessageBox.alert("Hii all");
			//alert("Hi all");


Even Alert message is also not getting dispalyed.

Please help me solve this.

Thanks & regards,

Urvish Panchal

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

1 Answer

Best Answer
A K Mar 29, 2017 at 11:50 AM
Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Karthik,

Thanks for your answer but it is still not working as desired

Thanks & regards,

Urvish Panchal


Where you are facing an issue?... Above example have 2 buttons to selectAll and Deselect All, you can follow up the same core or create a new plunkr with your existing code.This will make a clear view to answer your question :)

Can you try now?

Former Member

Hello Karthik,

Issue got resolved.

Many many thanks to you :)

Thanks and regards,

Urvish Panchal