Announcement

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

    problems with field _selection_1

    Hello,
    when I use the enterprise skin(!) and transfer data form a form to the server with form.saveData() a field named "_selection_1" is transfered to the server and has a value of true. So far everything is fine, because I simply ignore that CGI-VAR. When I use tahoe skin the value of _selection_1 is "undefined" an the data that is transfered to the server is corrupted and my server cannot process the cgi-var correctly and simply does not recognize them. Part of the url-encoded data looks like this:
    "&_selection_1=true&&_operationType=update". There are two "&" in contrast when I use the Enterprise skin there is only one "&" and my server processes all "CGI-VARS" correctly. Here is a part of it: "&Discount=10&_selection_1=false&_operationType=update&"
    Kind regards
    Paul


    #2
    Please show how this can be reproduced. The Debugging topic has advice for preparing test cases and/or finding samples where a problem like could be reproduced.

    Comment


      #3
      Hello, I prepared 2 examples.
      The source code is nearly identical. The first uses the tahoe skin:
      http://www.boemer.com/cgi-bin/cgiip...._progress_04.r
      The second the enterprise skin:
      http://www.boemer.com/cgi-bin/cgiip....progress_04a.r

      Please click on a record then change the field "name" and then click on "Speichern" to update the record.
      In the first case the server returns a error message because the _operationType CGI-VAR cannot be read.
      In the second case it works.
      Please take also a look ot the source code. Meanwile I tried to use a workaround. When I use the pDataSource subclass instead of the RestDataSource everything works fine. Perhaps this will help.
      Kind regards
      Paul

      Comment


        #4
        Please revisit the Debugging topic we referenced earlier: we need to see source code for a test case, not a running test case where we have no idea what you've done in your code.

        We did make an attempt to reproduce your claimed issue with a RestDataSource and a saveData() call, and did not see the issue. So again, we need a minimal, ready-to-run test case.

        Comment


          #5
          Hello,
          it is difficult to create a demo code to show the described behavior. When I copy the following code in a demo snippet like
          https://www.smartclient.com/smartcli...id=helloButton
          an then "try it" everything works fine.
          The response goes through your proxy and reaches my server with all the data I need.
          My google chrome developer console shows the following "Form Data" content as part of the request:

          ***************************
          data:<data xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:type="xsd:Object">
          <url>http://www.boemer.com/cgi-bin/cgiip.exe/WService=wsbroker1/sc_progress_cust.p</url>
          <httpMethod>POST</httpMethod><params xsi:type="xsd:Object"><CustNum>2</CustNum><Country>Finland</Country>
          <Name>fffffff</Name><Address>Rattipolku 3</Address><City>Oslo</City><State>Uusima</State><PostalCode>45321</PostalCode>
          <Contact>Urpo Leppakoski</Contact><Phone>(603) 532 5471</Phone><SalesRep>DKP</SalesRep><CreditLimit xsi:type="xsd:long">27600</CreditLimit>
          <Balance xsi:type="xsd:double">437.63</Balance><Discount xsi:type="xsd:long">35</Discount>
          <Comments>Ship all products 2nd Day Air.</Comments><_selection_9 xsi:type="xsd:boolean">true</_selection_9>
          <_embeddedComponents_gridCustomer>[]</_embeddedComponents_gridCustomer><_operationType>update</_operationType>
          <_textMatchStyle>exact</_textMatchStyle><_oldValues>{&quot;CustNum&quot;:&quot;2&quot;,&quot;Country&quot;:&quot;Finland&quot;,&quot;Name&quot;:&quot;ffff&quot;
          ,&quot;Address&quot;:&quot;Rattipolku 3&quot;,&quot;City&quot;:&quot;Oslo&quot;,&quot;State&quot;:&quot;
          Uusima&quot;,&quot;PostalCode&quot;:&quot;45321&quot;,&quot;Contact&quot;
          :&quot;Urpo Leppakoski&quot;,&quot;Phone&quot;:&quot;(603) 532 5471&quot;
          ,&quot;SalesRep&quot;:&quot;DKP&quot;,&quot;CreditLimit&quot;:27600,&quot;
          Balance&quot;:437.63,&quot;Discount&quot;:35,&quot;Comments&quot;:
          &quot;Ship all products 2nd Day Air.&quot;,&quot;_selection_9&quot;:true,
          &quot;_embeddedComponents_gridCustomer&quot;:[]}</_oldValues>
          <_componentId>formCustomer</_componentId><_dataSource>dsCustomer</_dataSource><isc_metaDataPrefix>_</isc_metaDataPrefix><isc_dataFormat>
          json</isc_dataFormat></params><contentType xsi:nil="true"/>
          <requestBody xsi:nil="true"/><username xsi:nil="true"/><password xsi:nil="true"/>
          <httpHeaders xsi:nil="true"/><uploadFileName xsi:nil="true"/><callbackParam xsi:nil="true"/></data>
          *****************************
          But when I use the complete code from my page
          http://www.boemer.com/cgi-bin/cgiip...._progress_04.r

          I see the following form data in my chrome developer console:

          ******************************
          Form Data
          CustNum:17
          Country:United Kingdom
          Name:High Tide Sailingö
          Address:178 Schooner Hill
          Address2:South Killingholme
          City:Immingham
          State:Humberside
          PostalCode:DN40 3LU
          Contact:Angela Tackle
          Phone:0469 73211
          SalesRep:SLS
          CreditLimit:10500
          Balance:2648.02
          Discount:25
          Comments:Speak with Captain Bob before shipping any products.
          _selection_1:true
          (empty)
          _operationType:update
          *****************************
          As you can see their is an "empty" Var before _operationType and all the data that comes after _selection1 does not reach my server process wich leads to the server error response.
          Thanks an kind regards
          Paul

          Comment


            #6
            Yes, that empty var is what we cannot reproduce and need a test case for.

            As far as producing a test case, all you need is code that caused such an invalid request to be created. We won't need any server code.

            If you can't produce a test case that shows how the problem occurs, sorry, but there's obviously nothing further we can do for you.

            Comment


              #7
              Hello,
              below there is a code with wich you can reprodruce the error. I copied it into the example page
              https://www.smartclient.com/smartcli...izeIncrease=10

              an clicked "try it".

              I opened the isc.showConsole() window and switched to RPC-Tab an activated "Track-RPC"
              then i saved a record (update Url does not exist) and the RawRequest shows the empty var
              between two other vars: "_selection_19=true&&_operationType="
              -----------------------------^---------------
              After I switched to Enterprise skin the rawRequest shows no empty var:

              "_selection_7=true&_operationType=update" without the empty var.

              Kind regards
              Paul


              //******************
              isc.RestDataSource.create({
              ID:"countryDS",
              dataURL:"countryData",
              fields:[
              {name:"countryCode", title:"Code", primaryKey:true, canEdit:false},
              {name:"countryName", title:"Country"},
              {name:"capital", title:"Capital"}
              ],

              fetchDataURL:"[ISOMORPHIC]/system/reference/inlineExamples/dataIntegration/xml/responses/country_fetch_rest.xml",
              updateDataURL:"whatever"


              });


              isc.ListGrid.create({
              ID: "countryList",
              width:500, height:224, alternateRecordStyles:true,
              emptyCellValue: "--",
              dataSource: countryDS,
              // display a subset of fields from the datasource
              fields:[
              {name:"countryCode"},
              {name:"countryName"},
              {name:"capital"},
              {name:"continent"}
              ],
              sortField: 0, // sort by countryCode
              dataPageSize: 50,
              autoFetchData:true,
              recordClick: function (viewer, record, recordNum, field, fieldNum, value, rawValue){

              formCountry.editRecord(record);
              },
              });

              isc.DynamicForm.create({
              ID:"formCountry",
              autoDraw:false,
              numCols:4,
              autoFetchData: false,
              margin: 4,
              dataSource:"countryDS",
              fields:[
              {
              name:"countryCode"
              ,disabled:true
              },
              {
              name:"countryName",

              required: true
              },

              {name: "countrySave", title: "Save", type: "button", endRow: false,
              click: function(){
              formCountry.saveData();
              }
              }



              ]
              });

              isc.VLayout.create({
              ID:"custLayout",
              margin: 20,
              width : 600,
              height: 700,
              autoDraw:true,
              members:[
              countryList,
              formCountry


              ]
              })

              //******************

              Comment


                #8
                Thanks for the sample. We are now able to reproduce the issue and are working on a solution.

                Comment


                  #9
                  This issue has been fixed in builds starting on Oct 11.

                  Comment

                  Working...
                  X