Announcement

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

    Numeric mask not working as expected

    When using a TextItem whose type is 'float' and a numeric mask is specified, the data entry is not behaving as would normally be expected.

    Code:
    isc.DynamicForm.create({
        ID: "contactForm",
        width: 400,
        wrapHintText: false,
        fields: [
            { name: "firstName", title: "First name", editorType: "TextItem",
              mask: ">?<??????????????", hint: "<nobr>&gt;?&lt;??????????????</nobr>"},
            { name: "lastName", title: "Last name", editorType: "TextItem",
              mask: ">?<??????????????", hint: "<nobr>&gt;?&lt;??????????????</nobr>"},
            { name: "state", title: "State", editorType: "TextItem",
              mask: ">LL", hint: "<nobr>&gt;LL</nobr>"},
            { name: "phoneNo", title: "Phone No.", editorType: "TextItem",
              mask: "(###) ###-####", hint: "(###) ###-####", showHintInField: true},
            { name: "dateItem", title: "Date", editorType: "DateItem",
              useTextField: true, useMask: true},
            { name: "dateTimeItem", title: "Date Time", editorType: "DateTimeItem",
              useTextField: true, useMask: true},
            { name: "timeItem", title: "Time", editorType: "TimeItem",
              useMask: true},
    [B]{ name: "numericMask", type: "float", title: "Numeric", editorType: "FloatItem", mask: "###.###.##", useMask: true}[/B]
        ]
    });
    Expected behavior: When the field acquires focus, the cursor should be on the right. Data entry should populate the field from the right, such that the field's display value is as follows when entering in the numbers 1,2,3,4 and 5.

    Its like Windows 10 calculator numeric entry?

    Click image for larger version

Name:	numericmask.png
Views:	80
Size:	20.9 KB
ID:	251339

    There is any solution to offer me for this situation?

    I already thank yor for all efforts.

    #2
    Windows calculator doesn't use masked input, that's just freeform numeric input. You can get freeform numeric input by simply removing the mask property.

    Comment


      #3
      Removed to mask property and i get numeric input. But floatItem not insert to decimal sperator (.) in number value when typing it. Is floatItem possible to behave like windows calculator, sent you previous post?

      I already thank yor for all efforts.

      http://www.smartclient.com/smartclie...maskedTextItem

      Code:
      isc.DynamicForm.create({
          ID: "contactForm",
          width: 400,
          wrapHintText: false,
          fields: [
              { name: "firstName", title: "First name", editorType: "TextItem",
                mask: ">?<??????????????", hint: "<nobr>&gt;?&lt;??????????????</nobr>"},
              { name: "lastName", title: "Last name", editorType: "TextItem",
                mask: ">?<??????????????", hint: "<nobr>&gt;?&lt;??????????????</nobr>"},
              { name: "state", title: "State", editorType: "TextItem",
                mask: ">LL", hint: "<nobr>&gt;LL</nobr>"},
              { name: "phoneNo", title: "Phone No.", editorType: "TextItem",
                mask: "(###) ###-####", hint: "(###) ###-####", showHintInField: true},
              { name: "dateItem", title: "Date", editorType: "DateItem",
                useTextField: true, useMask: true},
              { name: "dateTimeItem", title: "Date Time", editorType: "DateTimeItem",
                useTextField: true, useMask: true},
              { name: "timeItem", title: "Time", editorType: "TimeItem",
                useMask: true},
      [B]{ name: "numericMask", type: "decimal", title: "Numeric", editorType: "FloatItem" [I]/*,mask: "###.###.##", useMask: true removed*/[/I][/B] }  
          ]
      });
      Click image for larger version

Name:	Screenshot_2.png
Views:	67
Size:	23.4 KB
ID:	251352

      Comment


        #4
        Are you saying that you want a decimal point automatically inserted after the third digit, even if the user doesn't type it? That's not actually a normal behavior for Calculator.. but if you wanted it, you would use an InputTransformer.

        Comment

        Working...
        X