Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    decimal with german keyboard

    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:

    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);
                    }
                }
    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.
    Last edited by jj_kbs; 9 Mar 2020, 04:00.

    #2
    There's no "localFloat" - you want "localeFloat"

    Comment


      #3
      man WAY to make someone feel dumb :D
      (i edited the example)
      ok "localeFloat" seems to handle the stated function without issue

      one followup
      when i now write the numbers it does not stop at the decimal put puts it there by itself which is fine
      BUT it does ignore further input

      example:
      on the first field if i hold down 1 the result in the field is "11.00" instead of "11.11"
      the normal float stopped at the decimal part and you could either tab out and it padded or you pressed the "." and could put in the last 2 digits

      Last edited by jj_kbs; 9 Mar 2020, 04:03.

      Comment

      Working...
      X