[CLOSED] GridPanel Store UseIdConfirmation

  1. #1

    [CLOSED] GridPanel Store UseIdConfirmation

    Hello,

    When using UseIdConfirmation with a Store and I insert an empty record into a GridPanel; once I issue a GridPanel.save() the BeforeRecordInserted and AfterRecordInserted do not fire. The Updated and Deleted events do however fire if I've done one of them.

    I'm guessing this is because my new record does not have an Id but I think it should still fire.

    Can you confirm?

    Cheers,
    Timothy
  2. #2

    RE: [CLOSED] GridPanel Store UseIdConfirmation

    Hi Timothy,

    I want to give some clarifications about UseIdConfirmation

    1. The ReaderID in Reader specification is required if you use UseIdConfirmation
    2. The Id genereates automatically for inserted records on client side. But I want describe two cases:
    <ul>[*] The ReaderID is specified but the id field is absent in reader fields
    and grid columns. In this case the id value will be generate and submit to server during saving[/list]
               <Reader>
                    <ext:XmlReader Record="Customer" ReaderID="CustomerId">
                        <Fields>
                            <ext:RecordField Name="CompanyName" />
                            <ext:RecordField Name="ContactName" />
                        </Fields>
                    </ext:XmlReader>
                </Reader>
    <ul>[*] The ReaderID is specified and id field exists in record fields. In this case the id will be generate automatically but during save it will be override by default value of reader field (by default empty value). [/list]
                 <Reader>
                    <ext:XmlReader Record="Customer" ReaderID="CustomerId">
                        <Fields>
                            <ext:RecordField Name="CustomerId" />
                            <ext:RecordField Name="CompanyName" />
                            <ext:RecordField Name="ContactName" />
                        </Fields>
                    </ext:XmlReader>
                </Reader>
    The confirmation list can't contains empty id values, so will be throwing exception on server side. If you need to show id in GridPanel then you must set unique id for each inserted record on CLIENT side. It can be temporary unique id (on server side you can set real id in confirmation list and this id will replace temporary id )

    I'll discuss with Geoffrey the confirmation logic and may be we changes it. I let you know discussing result tomorrow
  3. #3

    RE: [CLOSED] GridPanel Store UseIdConfirmation

    Thanks vlad, but what if your Id is not integer based but rather guid based ? :)

    Cheers,
    Timothy
  4. #4

    RE: [CLOSED] GridPanel Store UseIdConfirmation

    It is not problem. On client side the autogenerated id will be int (the js is not strong-typed language). On server side in confirmation record this id will be convert to string (the confirmation record in confirmation list represent oldId and newId as string). So, you can set newId on server as GUID transforming it to string. Then on client side the oldId will be replaced by newId

  5. #5

    RE: [CLOSED] GridPanel Store UseIdConfirmation

    OK, will give it a try.

Similar Threads

  1. Replies: 1
    Last Post: Dec 14, 2011, 8:17 PM
  2. Replies: 3
    Last Post: May 26, 2011, 5:18 AM
  3. Replies: 2
    Last Post: Apr 13, 2011, 7:30 AM
  4. Replies: 1
    Last Post: Nov 01, 2010, 9:00 PM
  5. [CLOSED] [1.0] UseIdConfirmation not working
    By tdracz in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 09, 2010, 8:07 AM

Posting Permissions