Announcement

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

    11.0 problem: DSRequest.getCriteriaValue returns only first value of array

    Hello, while trying to migrate an application to 11.0, I've found a problem but I don't know if it's a regression in SmartClient framework or not.

    I've got a client DSRequest with a criteria like this:
    Code:
    2016-04-22 14:59:43,216 DEBUG RPCManager Request #1 (DSRequest) payload: {
        criteria:{
            CODICE_SETTORE:[
                "M01",
                ...
                "M40"
            ],
            ID_LISTINI_FK:23
        },
    ...
    previously using this code in a DMI:

    Code:
    dsRequest.getCriteriaValue("CODICE_SETTORE")
    will give me a List. Now it will result in the first value of CODICE_SETTORE array.
    To obtain the List I can use
    Code:
    dsRequest.getClientSuppliedCriteria().get("CODICE_SETTORE")
    but I don't know if it's a regression in the framework or only a bad practice in my code which worked in the past. I suspect I've got many of those usage of getCriteriaValue.

    #2
    I forgot to mention that the 11.0 build was
    SmartClient Version: v11.0p_2016-04-22/EVAL Deployment (expires 2016.06.21_11.05.07) Licensed to: Isomorphic Software (#ISC_EVAL_NIGHTLY)

    but actually I've just discovered that the change in behavior was already introduced in 10.1:
    SmartClient Version: v10.1p_2016-03-02/Enterprise Deployment (built 2016-03-02)

    Comment


      #3
      Also I've checked the javadocs and they say
      If AdvancedCriteria were passed, getCriteriaValue finds the first value provided for the fieldName anywhere in the AdvancedCriteria structure, by depth-first search.
      But in my case it's not an AdvancedCriteria

      Comment


        #4
        We've made a change to address this issue. Please try the next nightly build, dated April 28.

        Regards
        Isomorphic Software

        Comment


          #5
          ​SmartClient Version: v11.0p_2016-05-03/EVAL Development Only (expires 2016.07.03_03.32.42) Licensed to: Isomorphic Software (#ISC_EVAL_NIGHTLY)

          verified, thank you very much.

          Comment


            #6
            Hello, I've just noticed there's still a difference with the previous behavior.

            When there's a single value in the criteria array, like this request:
            Code:
            2016-05-09 15:21:55,898 DEBUG RPCManager Request #1 (DSRequest) payload: {
                criteria:{
                    CONTRATTO_NUM:[
                        "10028"
                    ]
                },
                operationConfig:{
                    dataSource:"JPC_CONTRATTI",
                    repo:null,
                    operationType:"fetch",
                    textMatchStyle:"exact"
                },
                appID:"builtinApplication",
                operation:"stampaSchedaAbbonamento",
                oldValues:{
                    CONTRATTO_NUM:[
                        "10028"
                    ]
                }
            }
            dsRequest.getCriteriaValue returns only *that* single value, not a List containing it.

            Comment


              #7
              We were not able to reproduce this specific issue when using a List with a single value. Could you please show us your test code so that we can test it?.

              Regards
              Isomorphic Software

              Comment


                #8
                SmartClient Version: v11.0p_2016-05-12/EVAL Deployment (expires 2016.07.11_07.39.10) Licensed to: Isomorphic Software (#ISC_EVAL_NIGHTLY)

                Hello, I've found the code which triggers that behavior. This is my test case:
                Code:
                <DataSource xmlns:fmt="urn:jsptld:/WEB-INF/fmt.tld" xmlns="http://www.smartclient.com/schema"
                            ID="JPC_CONTRATTI_TEST"
                            tableName="JPC_CONTRATTI"
                            schema="DBSALES"
                            dbName="dbJpcEP"
                            serverType="sql"
                        >
                    <fields>
                        <field sqlType="decimal" name="CONTRATTO_NUM" type="integer"/>
                        <field name="TIPO" type="text" sqlType="varchar" sqlLength="3" length="3"/>
                    </fields>
                    <operationBindings>
                        <operationBinding operationType="fetch" operationId="stampaSchedaAbbonamento"
                                          serverMethod="stampaSchedaAbbonamento">
                            <serverObject lookupStyle="new" className="com.juve.jpcep.contratti.fatture.StampaSchedaAbbonamentoDMI"/>
                            <criteria fieldName="TIPO" operator="equals" value="JPC"></criteria>
                        </operationBinding>
                    </operationBindings>
                </DataSource>
                If I comment out the <criteria> tag, dsRequest.getCriteriaValue returns a List containing the value, otherwise it returns only the single value.

                Comment


                  #9
                  Actually, for this test case, there's still the bug of the first post.

                  Comment


                    #10
                    We made a change yesterday to address this issue (should be present in the latest nightly build dated May 27).

                    Regards
                    Isomorphic Software

                    Comment


                      #11
                      SmartClient Version: v11.0p_2016-05-27/EVAL Deployment (expires 2016.07.26_09.52.03) Licensed to: Isomorphic Software (#ISC_EVAL_NIGHTLY)

                      verified, thank you very much.

                      Comment

                      Working...
                      X