qualiture / ui5-validator Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hi,
thanks for this script, it would be nice if the i18n-todo will be fixed.
e.g.: https://github.com/qualiture/ui5-validator/blob/master/Validator.js#L129
Thanks
When I use this class with master-details applications if I set the valuestate of one element to error, and then return it back to a None.
Then visit another object and go back to the previous object, then I will see the Error state again on that object.
It seems it has a problem with bound items
There was no license file in this repo. I hope it's fine to reuse in my own projects?
Cheers,
Jan
Sometimes i only want to validate required fields... that maybe they don't have a Type, for example with ComboBox controls.
I make a simple change on validation to control this situation
Hope you like it,.
if (oControl.getBinding(aValidateProperties[i])) {
///original code
}else if (oControl.getRequired && oControl.getRequired()===true) {
oControlBinding = oControl.getBinding(aValidateProperties[i]);
oExternalValue = oControl.getProperty(aValidateProperties[i]);
if (!oExternalValue || oExternalValue==="") {
this._isValid = false;
sap.ui.getCore().getMessageManager().addMessages(
new Message({
message: "",
type: MessageType.Error,
target : ( oControlBinding.getContext() ? oControlBinding.getContext().getPath() + "/" : "") +
oControlBinding.getPath(),
processor: oControl.getBinding(aValidateProperties[i]).getModel()
})
);
}
}
Hi,
if I add required="true" to my input field it does not work.
I thought the following input should be validated correct (after #11).
Unfortunately it does not work:
working:
<Label text="Old style" required="true" />
<Input value="{
path : '/text',
type : 'sap.ui.model.type.String',
constraints : {
minLength : 3,
maxLength : 10
}
}"
/>
not working:
<Label text="length and required" required="true" />
<Input value="{
path : '/text2',
type : 'sap.ui.model.type.String',
constraints : {
minLength : 3,
maxLength : 10
}
}"
required="true" />
<Label text="only required" required="true" />
<Input value="{
path : '/text3'
}"
required="true" />
see http://plnkr.co/edit/nj3kFKSFjtkZElQMi69m?p=preview
Any suggestions?
Thanks
Preconditions:
The demo uses the newest library version and automatic validation turned on in init():
sap.ui.getCore().getMessageManager().registerObject(this.getView(), true);
The ValueState border of the control flickers and disappears.
Press "Validate form" again and all is ok.
It seems the library is not compatible with automatic validation.
https://openui5.hana.ondemand.com/#/topic/a90d93df5a024e8bb18826b699c9aaa7
I tried to set target and processor property of the Message instance to these values, this worked for me:
target : oControl.getId() + "/" + propertyName,
processor : new sap.ui.core.message.ControlMessageProcessor()
Hi Robin
I should test InputFields in sap.m.table. For that I need the Aggregation "cells".
In Line 54:
aPossibleAggregations = ["cells", "items", "content", "form", "formContainers", "formElements", "fields", "sections", "subSections", "_grid"],
Do you see any problems?
Regards Philipp
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.