This question already has answers here:
sap.m.Input's value binding with type="Number" clears the input field
(2 answers)
Closed 12 days ago.
This simple form clears out the input field when a number >1000 is entered. I've tried to add formatOptions but it does not make any difference.
This is the relevant part of the code.
<Input
description="Quantity"
placeholder="Float"
width="100%"
type="Number"
value="{path:'/classified',
type: 'sap.ui.model.type.Float',
constraints: {minimum: 1, maximum: 1001},
formatOptions: {pattern: '#,##0.###'} }">
<layoutData>
<l:GridData span="L2 M2 S2"/>
</layoutData>
</Input>
For clarity 1001, which is allowed by the validation, is also cleared out.
Here is a jsbin showing this.
Any help is greatly appreciated.
The OpenUI5/SapUI5 team has given me the solution. type="Number" should not be used. It works fine if this is removed.
Related
I'm doing FreeCodeCamp's survey project but keep failing 9. If I enter numbers outside the range of the number input, I will see an HTML5 validation error.'
I don't understand because I though all I would have to do is add a min="10" max="100" thing. Here's what I have so far:
<label for="number" id="number-label" min="10" max="100"> Age </label>
<input type="number" id="number" placeholder="Enter Your Age" required>
min, max are attributes applied to numeric input elements. reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input
So you need the following changes to your code.
<label for="number" id="number-label" > Age </label>
<input type="number" min="10" max="100" id="number" placeholder="Enter Your Age" required>
I have a problem: when I create a HTML-Element in the Backen of Typo3 (Version 9) and save it with some HTML-Content. All fine so far the output on the frontend works perfect. But when I want to edit, it seems like that the backend want to parse it wrong - I got the output as following: all tags are HTML-Entities now and the code is wrapped in some p-Tags (when I want to save now the code is saved this way to the db and frontend gets also wrong output for these element).
Does anybody have the same issue or an solution?
<p><form action="/action_page.php"> <label for="fname">First name:</label><br> <input type="text" id="fname" name="fname" value="John"><br> <label for="lname">Last name:</label><br> <input type="text" id="lname" name="lname" value="Doe"><br><br> <input type="submit" value="Submit"> </form></p>
The extension responsible for the code highlighting is t3editor (typo3/cms-t3editor). You can deactivate or remove it.
I cannot reproduce this problem in a v9.5.26.
This is a follow-up question to How to bind integer Input value to Slider.
I have found out that the demo solution in this answer only works when there are integer values in the slider and the language of your browser is set to English.
Snippet from the demo:
<Input xmlns="sap.m"
xmlns:core="sap.ui.core"
core:require="{FloatType: 'sap/ui/model/type/Float'}"
type="Number"
value="{
path: '/value',
type: 'FloatType'
}"
/>
To reproduce the issue:
Go to the settings of your browser.
Set e.g. German as the language.
Reload the demo.
If the step of the slider is then set to an integer value (e.g. 1), values are all shown correctly in the input field.
With step="0.1", however, only integer values are shown whereas float values (e.g. "1,4") are hidden, causing warning in the browser console:
The specified value "1,4" cannot be parsed, or is out of range.
Any ideas or better solutions?
In that case, remove type="Number" from the <Input> control.
The property type="Number" in UI5 shouldn't be used together with value-binding anyway, due to browsers implementing HTML <input type="number"> behavior slightly differently, according to the API reference:
Only the default value sap.m.InputType.Text may be used in combination with data model formats. (Source).
Found a solution:
A formatter is needed that replaces the "," with a ".":
formatStringToNumber: sNumber => parseFloat(sNumber.replace(","))
In the binding of the input then simply add the formatter:
<Input
width= "50px"
type="Number"
value="{
path: '/passageWidth',
formatter: 'formatStringToNumber',
type: 'FloatType',
formatOptions: { emptyString: 0 }
}"/>
Since the last update to TYPO3 6.2.47 ELTS forms (the old core forms; without use of sysext "form") are no longer rendered normally ...
<input type="text" name="name" id="mailformname" size="30" value="" />
... but the input fields seem to be sent through an HTML encoder. It now looks like this in the source code:
<input type="text" name="name" id="mailformname" size="30" value="" />
How can this be fixed?
I couldn't find anything related to this in the changelog.
There's a new parseFunc, which is responsible for the issue
tt_content.mailform.20.stdWrap.parseFunc =< lib.parseFunc
You can overwrite this as follows
tt_content.mailform.20.stdWrap.parseFunc >
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I have following SAPUI5 app:
[Codepen](https://codepen.io/bifunctor/project/editor/XaOapY#)
I would like to indent the query button on the same like from input.
How to accomplish that?
This is kind of a hack. Just add an empty label association to the
button.
<Label text="Payers"></Label>
<Input id="payerFrom" showSuggestion="true" placeholder="From"
required="true">
</Input>
<Input id="payerTo" showSuggestion="true" placeholder="To"
required="true">
</Input>
<Label text=""></Label>
<Button text="Query" type="Emphasized" press="queryData">
<layoutData>
<layout:GridData span="XL6 L6 M6 S12"/>
</layoutData>
</Button>
You can use the indent property of GridData.
Try this out:
<Label text="Payers"></Label>
<Input id="payerFrom" showSuggestion="true" placeholder="From"
required="true">
</Input>
<Input id="payerTo" showSuggestion="true" placeholder="To"
required="true">
</Input>
<Button text="Query" type="Emphasized" press="queryData">
<layoutData>
<layout:GridData span="XL6 L6 M6 S12" indent="L1 M1 S0"/>
</layoutData>
</Button>