Announcement

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

    Reg: formatEditorValue is treating as values changed in the DynamicForm

    Hi,

    In the form Item, We are using fomratEditorValue to format the value. But If we load the form like below and one of the field has formatEditorValue method. And after loading the data from the server If I am trying to check form.getChangedValues() then it is returning the field which has fiilterEditorValue.

    It was not happening SmartCleint 9.1, But this is happening in SmartClient 10.0_11_19 version.

    So, Could you please suggest to not to get the formatEditorValue field in the getChangedValues().

    Code:
    isc.DynamicForm.create({
        ID: "locationForm",
        width:900,height:250,top:380,
    	initialCriteria:{"II1_PRODUCT_NUMBER":"1"},
        dataSource:"TII1_CUSTODY_ISSUE_ITEM_DETAIL",
        fields:[
            {name:"II1_PRODUCT_NUMBER",title:'II1_PRODUCT_NUMBER',width:230},
            {name:"II1_PRODUCT_STATE_V",textBoxStyle:"myMandatoryCell",title:'II1_PRODUCT_STATE_V',formatEditorValue:"getUOMId(value, record, form, item)"
    							
            },
            {name:"II1_ISSUED_QUANTITY",title:'II1_ISSUED_QUANTITY',width:150},
            {name:"II1_ASSIGNEE_TYPE_V",textBoxStyle:"myMandatoryCell",title:'II1_ASSIGNEE_TYPE_V',width:150
            }
        ],
        autoFetchData: true
    })
    We are working on the below environment:
    SmartClient version : Isomorphic SmartClient/SmartGWT Framework (10.0p_2014-11-19/PowerEdition Deployment 2014-11-19)

    Browser : IE9

    #2
    Hi,

    Please find the attached test case of the above issue.

    Please find the below video:

    http://www.screencast.com/users/Vija...5-70e43dd31558

    We are working on the below environment:
    SmartClient version : Isomorphic SmartClient/SmartGWT Framework (10.0p_2014-11-19/PowerEdition Deployment 2014-11-19)

    Browser : IE9

    Please suggest me to resolve this issue.

    Please let me know if you need more information for the same.

    Thanks in advance
    Attached Files

    Comment


      #3
      Thanks for the test case. We'll take a look and will follow up when we have more information for you

      Regards
      Isomorphic Software

      Comment


        #4
        The problem here appears to be that you're specifying an edit value formatter but no corollary parser.
        In other words, the framework knows how to take a data value and modify it before displaying it in the text box, but it doesn't know how to take a user entered value and modify it in order to get back the desired data value.
        So when this page loads, the initial data value is 1, but the text box displays "1changed".
        When retrieving the values for the form, we then look at the value of the item. Since there's no parser, we assume this should not be modified - essentially it's the data value. So "1changed" becomes the data value of the item.
        This of course differs from the original value - hence the change notification. Similarly if the user entered "2changed" we'd store out that string rather than just the "2".

        You can fix this in 2 ways:
        1) You can declare a parser - something like this:
        Code:
        {name:"II1_PRODUCT_STATE_V",textBoxStyle:"myMandatoryCell",
                 formatEditorValue:"getUOMId(value, record, form, item)",
                 parseEditorValue:function (value) {
                     if (isc.isA.String(value) && value.endsWith("changed")) {
                         value = value.substring(0, value.length-7);
                     }
                     return value;
                 },
        or
        2) You can use the formatOnBlur feature, and replace your "formatEditorValue" method with a static "formatValue" formatter. This tells the text box to apply the static formatter while the item does not have focus. When the user puts focus into the item, the formatter will be removed meaning the dev can modify the unformatted data value.
        So in this case, you'd see "1changed" when the form loaded, then as the user tabs into the field you'd see "1" and the user would be able to edit that value. When they tab out, the value would be reformatted.

        As an aside we have recently made a change to fix a problem with formatOnBlur in some cases so be sure to try that with the latest nightly build.

        Regards
        Isomorphic Software

        Comment


          #5
          Hi,

          Thanks for the reply.

          The above issue was not happening in the previous versions of SmartClient. It is happening from SmartClient 10.0.

          formatEditorValue is not for this purpose in the previous versions of smartclient. We are using formatEditorValue() to format the value for just display for TextItem.not for the Editable textfields.

          And also you have changed the documentation for the formatEditorValue and formatValue in the latest 9.1 build ad 10.0 build.

          it is affecting my application. So, Please mention in the release notes about the changes done in the latest versions. So that we will decide whether to take an update or continue with the same version.

          Please let me know this is change is affected from which nightly build of SmartClient 9.1.

          Comment


            #6
            Sorry, you are not correct.

            formatEditorValue() has always had the purpose of formatting the value that the user will edit. formatValue() is what you should use if you just want to form the displayed (non-editable) value.

            Documentation for formatEditorValue was unchanged from 9.1 to 10.0. Documentation for formatValue() was updated to introduce the formatOnBlur feature, but existing behavior is unchanged.

            Comment

            Working...
            X