cannot mention minimum value to the numeric component - syncfusion

Cannot mention minimum value and need to customize the arrow button
<NumericTextBoxComponent
validateDecimalOnType={true}
format='n2'
placeholder="Applied"
enabled={this.props.overApplied}
change={this.props.handleOverApplied}
value={this.props.added.value}
/>

Query-1: Setting minimum value
If you want to set minimum/maximum values in NumericTextBox, Please refer to the below range validation online sample,
<!-- Initialize Numeric Textbox -->
<ejs-numerictextbox id="numeric" min="10" max="100" value="15"></ejs-numerictextbox>
Sample : https://ej2.syncfusion.com/aspnetcore/NumericTextBox/RangeValidation#/material
Query-2: Customizing arrow buttons
To customize the arrow buttons to different icons, you can refer to the below how-to documentation page,
https://ej2.syncfusion.com/aspnetcore/documentation/numerictextbox/how-to/customize-the-spin-buttons-up-and-down-arrow/
Note:
We assumed that you are using ASP.Net Core and Provided the above information. If you are using different platform, the same links are available in that platform itself.

Related

Fluent UI react missing icons in Dropdown and DatePicker

I'm creating an electron-app that uses Microsoft fluent-ui lib. I have added the reference #fluentui/react": "^7.107.1 to the package.json file. When I then create a Dropdown like this
<Dropdown
label='Time zone'
onChange={(e, option) => this.updateTimeZone(..)}
/>
The caret with the drop down icon is missing.
When inspecting the element, it seems as the i-tag is empty and does not have the right font applied in the css-class, when compared to examples in the documentation.
Could someone see what I'm doing wrong?
By default, the Fabric icons are not added to your bundle, in order to save bytes for scenarios where you don't care about icons, or you only care about a subset.
To make them available, you may initialize them as such:
import { initializeIcons } from 'office-ui-fabric-react/lib/Icons';
initializeIcons(/* optional base url */);

How to display the value chosen from Sliderfield xtype on the dialog?

I am using sliderfield xtype allowing authors to chose a value. Currently authors are not aware of current chosen value. Is there a way to show the value as either a bubble as shown here or a separate text value outside the slider? Below is the dialog.
<backgroundAlpha
jcr:primaryType="cq:Widget"
fieldLabel="Background Alpha (Opacity)"
increment="1"
maxValue="{Long}100"
minValue="{Long}0"
name="./backgroundAlpha"
useTips="{Boolean}true"
xtype="sliderfield"/>
I Just used the below code to get the property and able to display in page. And the default dialog already shows the selected value.
<% if(properties.get("sliderfield")!=null){%> Here is your sliderfield FIELD DATA:: <%=properties.get("sliderfield")%> <%}%>

sap.m.Input allow only positive integer values

I need reject for sap.m.Input control any input except integer values. So in input may be inputted only 0-9, without any sign symbol(+-) or any decimal separators. I Can't find good solution. View declared in XML format, and preferable way is just change this XML with additional parameters, if it possible.
Possible solutions:
The first one - write custom formatter.
The second one - try to find some standard solution with types. I found internal data types and they settings, but it seems that they not working well.
A custom formatter won't help you in this case as its only used oneway (model->view).
But data types are your friend here. I would suggest sap.ui.model.type.Integer with a minimum constraint of 0.
<Input value="{path: '/value', type: 'sap.ui.model.type.Integer', constraints:{minimum:0}}" />
However this does have two prerequisites:
You need to enable complex databinding. This can be done in the bootstrap tag in index.html with the data-sap-ui-compatVersion attribute. Version 1.26 is needed at least. You can use the value edge to specify the newest version:
<script src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-libs="sap.m"
data-sap-ui-compatVersion="edge">
Alternatively you can use data-sap-ui-bindingSyntax="complex".
If the user enters invalid data the datatype throws a ValidationException. The error will be silently ignored but the model won't be updated. To get some feedback for the user you can register the control or the whole view at the MessageManager:
sap.ui.getCore().getMessageManager().registerObject(this.getView(), true);
You can also enable handleValidation in the Component or when instantiating the component.
Example on JSBin.
Regex is your friend here.
Here is a pretty simple jsbin I re-used from someone validating text only and modified the regex to accept numbers only.
You could wire the validation into the change event so it would fire and set the state to error if text entered.
Let us know how this works out.
Cheers,
Nigel

Phone Number Masking in Zk

I need to add masking for telephone number.Is there any attribute for asking in textbox like primefaces http://www.primefaces.org/showcase/ui/inputMask.jsf
or we have to add jquery for it.
Below is my code:
<textbox value="#bind(vm.phoneNo)" width="180px" constraint="no empty"/>
Below Image showing error message stick to Textbox (Tele)
Below Image showing error message not stick to Textbox(Tele).This is main issue
Here is a zk demo, shows you how to use jq.
But zk got different types of input elements as well that you may like to use,
cos they got constraint attribute where you can define reg ex.
See textbox for example.
If you use MVVM you could use the #validator too. Here is a demo of it.

Is it allowed to use <label> tag without labeled control?

I need to show in a page a list of, let's say, person's properties that should be rendered more or less as follow:
name: Name
date: 1/1/2000
other: Other
Reading the doc they say:
The LABEL element may be used to attach information to controls.
So, is it the right tag to encompass the names of the properties like name, date...
even if there's not an <input> to associate with?
Nope, as per Quentin’s answer.
However, in HTML5, <dl> can be used for generic associations where <label> isn’t appropriate.
No.
It says that it can associate information with controls.
It does not say that it can associate information with anything else.
See also the newer (but draft) specification:
Some elements, not all of them form-associated, are categorized as
labelable elements. These are elements that can be associated with a
label element.
button input (if the type attribute is not in the hidden state) keygen
meter output progress select textarea
No, it is not correct to use the label element like that.
The important thing here is the meaning of may.
The LABEL element may be used to attach information to controls.
RFC 2119 (which the HTML4 spec follows) defines may:
May: This word, or the adjective "OPTIONAL", mean that an item is truly optional
So here, may does not mean the label element can be used for other purposes; it just means that it is not required to use a label element with controls.
As far as alternatives go, it depends what you want to achieve. If you are just trying to follow the spec closely, then I suggest using p and a strong element for each pair. If you want the data to be more meaningful to computers, you could consider using one of the Microformat specifications.
I partially agree with the answers so far but want to add that if you want to use labels for some reason, then I would display the property values in read-only controls, and then your labels will be valid.
I've done this using appropriate styling to differentiate the read-only controls from the functioning controls to avoid confusing your users. This was on a sequence of pages which built up the information gathered from the user in a wizard.
I have this link to W3C - the "Editor's Draft" as opposed to the link above which is the "Working Draft", which states that you can associate it with any element - as long as it's 'labelable' - even though this is a subsection of the Form section. It states earlier that a labelable element does not have to be within a form.
http://dev.w3.org/html5/spec/single-page.html#the-label-element