Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controller Code for Sample Input Checked does not work #82

Closed
simonarangelova opened this issue Feb 2, 2023 · 0 comments
Closed

Controller Code for Sample Input Checked does not work #82

simonarangelova opened this issue Feb 2, 2023 · 0 comments

Comments

@simonarangelova
Copy link
Contributor

simonarangelova commented Feb 2, 2023

This issue is moved from SAP-docs repository
Hi,

the sample for Input - Checked (https://ui5.sap.com/#/entity/sap.m.Input/sample/sap.m.sample.InputChecked) does not work.

In the Controller code https://ui5.sap.com/#/entity/sap.m.Input/sample/sap.m.sample.InputChecked/code/C.controller.js the function _validateInput needs to be corrected from:

_validateInput: function (oInput) {
	var sValueState = "None";
	var bValidationError = false;
	var oBinding = oInput.getBinding("value");

	try {
		oBinding.getType().validateValue(oInput.getValue());
	} catch (oException) {
		sValueState = "Error";
		bValidationError = true;
	}

	oInput.setValueState(sValueState);

	return bValidationError;
},

to:

_validateInput: function (oInput) {
	var sValueState = "None";
	var bValidationError = false;
	var oBindingInfo = oInput.getBindingInfo("value");

	try {
		oBindingInfo.type.validateValue(oInput.getValue());
	} catch (oException) {
		sValueState = "Error";
		bValidationError = true;
	}

	oInput.setValueState(sValueState);

	return bValidationError;
},

Kind regards,
Sebastian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant