Announcement

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

    #16
    Ok. What else could I provide then?

    Also, if you really needed more info, it would've helped if you said so after my last comment instead of me waiting for a response. Thanks.

    Comment


      #17
      A standalone test case is always the way to guarantee that we can reproduce something.

      As far as what else could be provided - remember, we don't have your app in front of us - we have no idea what else it's doing, so we can't really suggest what you may need to change to find a reproducible case. However as soon as you can tell us something like "I turned off X and the problem stopped" we can provide further guidance.

      Comment


        #18
        Here is the sample I was finally able to recreate. It is not exactly what I have in our environemnt - in this testcase I am nullifying a required value just before I call updateData where as in our environment, the required field is by default null. To run the testcase, load that sample (I used /isomorphic/system/reference/SmartClient_Explorer.html#databoundUpdate), and click on g8 column. The error I see will show and the response is what we have pretty much.

        Server returned VALIDATION_ERROR with no error message performing operation 'worldDS_update'.

        Code:
        isc.ListGrid.create({
            ID: "countryList",
            width:500, height:224, alternateRecordStyles:true,
            dataSource: worldDS,canEdit :true,editEvent: "click",
        cellClick: function(record, rowNum, colNum){
        if(colNum == 4){
        record['countryCode'] = null;
                countryList.updateData(record);
        }
        },
            // display a subset of fields from the datasource
            fields:[
                {name:"countryCode"},
                {name:"countryName"},
                {name:"capital"},
                {name:"continent", required:true},
        {name:"member_g8"}
            ],
            sortFieldNum: 0, // sort by countryCode
            dataPageSize: 50,
            autoFetchData: true,
            selectionType: "single"
        })
        
        
        isc.IButton.create({
            left:0, top:240, width:150,
            title:"Continent > Europe",
            click: function () {
                if (!countryList.getSelectedRecord()) return; // nothing selected
                var updatedRecord = isc.addProperties(
                    countryList.getSelectedRecord(),
                    {continent:"Europe"}
                );        
                countryList.updateData(updatedRecord);
            }
        })
        
        isc.IButton.create({
            left:170, top:240, width:150,
            title:"Continent > Asia",
            click: function () {
                if (!countryList.getSelectedRecord()) return; // nothing selected
                var updatedRecord = isc.addProperties(
                    countryList.getSelectedRecord(),
                    {continent:"Asia"}
                );        
                countryList.updateData(updatedRecord);
            }
        })
        Data:

        Code:
        <DataSource
            ID="worldDS"
            serverType="sql"
            recordName="country"
            testFileName="/examples/shared/ds/test_data/world.data.xml"
        >
            <fields>
                <field name="pk"            type="integer"    hidden="true"            primaryKey="true" />
                <field name="countryCode"   type="text"       title="Code"             required="true"   />
                <field name="countryName"   type="text"       title="Country"          required="true"   />
                <field name="capital"       type="text"       title="Capital"          />
                <field name="government"    type="text"       title="Government"       length="500"      />
                <field name="continent"     type="text"       title="Continent"        >
                    <valueMap>
                        <value>Europe</value>
                        <value>Asia</value>
                        <value>North America</value>
                        <value>Australia/Oceania</value>
                        <value>South America</value>
                        <value>Africa</value>
                    </valueMap>
                </field>
                <field name="independence"  type="date"       title="Nationhood"          />
                <field name="area"          type="float"      title="Area (km&amp;sup2;)" />
                <field name="population"    type="integer"    title="Population"          />
                <field name="gdp"           type="float"      title="GDP ($M)"            />
                <field name="member_g8"     type="boolean"    title="G8"                  />
            </fields>
        </DataSource>
        Server Response:

        Code:
        [
            {
                queueStatus:-1, 
                errors:[
                    {
                        countryCode:{
                            errorMessage:"Field is required"
                        }
                    }
                ], 
                invalidateCache:false, 
                data:null, 
                status:-4, 
                isDSResponse:true
            }
        ]
        Last edited by acarur01; 19 Sep 2011, 09:37.

        Comment


          #19
          OK, the issue in this test case is that your assignment to "record" is a direct change to the client-side cache and makes the data invalid, which is never supposed to incur - loaded data should already be valid and user editing and/or calls to setEditValue() can never make it invalid.

          So if you've got this kind of direct modification of the cache in the real app, get rid of it - the click methods on the two buttons in your sample (that you copied from a product sample) show a correct way to submit changes without modifying cached data.

          Comment


            #20
            No I do not have a direct modification in my real app. But the row that the user is editing is a new row coming from the server and does not contain initial data -I just did the nullifying in the browser side in that testcase to show the error I was getting.

            Comment


              #21
              Thats equivalent - you're basically delivering data from the server (so it should be valid) but it would not pass validation. Aside from this particular manifestation, this creates a general problem that we don't know whether / when to report errors because data that has not been edited is invalid.

              If you want to put a row into a state where it's a new row that will need user input to become valid, use startEditingNew().

              Comment

              Working...
              X