BUILD: Version v12.0p_2020-03-03 (2020-03-03)
BROWSER: Chrome/Firefox latest
LOCALE: de
I have been trying to figure something out in regards to input with german users.
No suprise in Germany the decimal seperator is "," instead of "." -- I am certain that surpises nobody here.
The issue I am running into is the following.
On a german Keyboard the character under the Numpad is "," and people typing in decimals into Listgrids and/or Forms run into Problems with certain Options.
1) localFloat is as far as i can tell wortless here I only included it for completions sake or if I may have missed something.
2) Plain Float works perfectly it enforces the right length of the pre/post - decimal parts BUT after the 3 numbers before the decimal you want to put in a "," and 2 decimals afterwards which it does not accept. It only works if you use a "." while typing.
Question:
Is there a Setting for this or maybe a clever workaround ... did I do something wrong in my attributes maybe.
Ideas:
I was thinking of catching the input and letting it write a "." when a "," is input via a keypress function on the field.
The Issue here is that It can overwrite legitimate entries with false ones.
My simple Testcase is as follows:
Workaround Idea:
Issue:
This can overwrite any format or restriction put into the field.
I have not found something that lets me input characters into a field as typing would in the documentation.
BROWSER: Chrome/Firefox latest
LOCALE: de
I have been trying to figure something out in regards to input with german users.
No suprise in Germany the decimal seperator is "," instead of "." -- I am certain that surpises nobody here.
The issue I am running into is the following.
On a german Keyboard the character under the Numpad is "," and people typing in decimals into Listgrids and/or Forms run into Problems with certain Options.
1) localFloat is as far as i can tell wortless here I only included it for completions sake or if I may have missed something.
2) Plain Float works perfectly it enforces the right length of the pre/post - decimal parts BUT after the 3 numbers before the decimal you want to put in a "," and 2 decimals afterwards which it does not accept. It only works if you use a "." while typing.
Question:
Is there a Setting for this or maybe a clever workaround ... did I do something wrong in my attributes maybe.
Ideas:
I was thinking of catching the input and letting it write a "." when a "," is input via a keypress function on the field.
The Issue here is that It can overwrite legitimate entries with false ones.
My simple Testcase is as follows:
Code:
<!doctype html>
<html lang="en">
<head>
<title>Testcaese decimals</title>
<SCRIPT>var isomorphicDir="isomorphic/";</SCRIPT>
<SCRIPT SRC="isomorphic/system/modules/ISC_Core.js"></SCRIPT>
<SCRIPT SRC="isomorphic/system/modules/ISC_Foundation.js"></SCRIPT>
<SCRIPT SRC="isomorphic/system/modules/ISC_Containers.js"></SCRIPT>
<SCRIPT SRC="isomorphic/system/modules/ISC_Grids.js"></SCRIPT>
<SCRIPT SRC="isomorphic/system/modules/ISC_Forms.js"></SCRIPT>
<SCRIPT SRC="isomorphic/system/modules/ISC_DataBinding.js"></SCRIPT>
<SCRIPT SRC="isomorphic/skins/Tahoe/load_skin.js"></SCRIPT>
<SCRIPT SRC="isomorphic/locales/frameworkMessages_de.properties"></SCRIPT>
<style>
</style>
</head>
<body>
<script>
Canvas.resizeFonts(3);
isc.DynamicForm.create({
ID: "testcase",
width: "100%",
fixedColWidths: true,
colWidths: [150, "*"],
isGroup: true,
groupTitle: "Float/localFloat Testcase",
fields : [
{ID: "pe_dstd", name:"pe_dstd", title:"localFloat", type:"localeFloat", titleAlign:"left", length:5, decimalPrecision:2, decimalPad:2, keyPressFilter: "[0-9.,]", format: "0.00", defaultValue: ""},
{ID: "pe_ss", name:"pe_ss", title:"float", type:"float", titleAlign:"left", length:6, decimalPrecision:2, decimalPad:2, keyPressFilter: "[0-9.,]", format: "0.00", defaultValue: "",},
]
});
</script>
Workaround Idea:
Code:
keyPress: function (item, form, keyName, characterValue) {
console.log(keyName);
console.log(characterValue);
console.log(item);
if (characterValue == 44) {
console.log("chara ,");
item.setValue(item.getValue()+".");
return(false);
}
}
This can overwrite any format or restriction put into the field.
I have not found something that lets me input characters into a field as typing would in the documentation.
Comment