Any Update on the TXDataWebDataset updating all returned values

Further to Values added on the XDataServer aren't being returned

Have you managed to add that option yet?



You can try this approach:

I'll give it a go, although the Ids do update IIRC.

Although I think it would be a normal expectation that data updated during a call to the server would be reflected when returned to the dataset.

I have tried that but the values aren't in the Info array - either the id or the other fields that are populated on the server. Working around this is going to be hard. have to make sure I get all the async stuff nested correctly.

It should have that ID of the main object inserted. What do you see in the server JSON response in the Network tab?

So I am getting the id now. But not the other data. This is in the AfterApplyUpdates

The data in the Network response is

    "$id": 1,
    "Id": 170007,
    "ShopRef": "S53",
    "SaleDate": "2022-01-12",
    "CreditCards": 35,
    "CashAndCheques": 45,
    "TotalBanked": 80,
    "CompletedBy": "roger the lodger",
    "BatchId": 160007,
    "SheetNumber": 1,
    "SheetCount": 1,
    "AddedBy": 51,
    "DateAdded": "2022-02-01T00:17:19.374",
    "LastUpdatedBy": null,
    "LastUpdated": null

I'm getting lost in what is exactly going on. Can we please go back and start again by describing what is the current issue and steps to reproduce? Note that the mentioned code only updates the ID generated by the server. It won't update any other property that have been modified server-side.

Hi Wagner,

wouldn't the handling of these inserts with/without server-side generators and processing the answers be an ideal topic for a Web-Academy-Session ?

Regards, Tom

That's something we can think of, maybe in the context of a session about TXDataWebDataset.
But actually for such kind of things I think sample code/demo are a best fit.

Sure - I mentioned this as a general hint - not to solve specific issues of the forum...

"Note that the mentioned code only updates the ID generated by the server. It won't update any other property that have been modified server-side."

I think that's the issue. I use a multi-tier approach with the business logic on the middle tier. As such a lot of work is done in the server app. We would expect that to be reflected on the UI end of the system. If it is not then a subsequent edit and post might well undo the changes made on the server during the insert. I would be interested to understand the thinking behind not doing this.

I don't mind coding around this, but if the data isn't made available then I will have to re-fetch the record. The data is sent back from the server, as shown in the Network response, but this is populated in the Info array (TResolveResults) in AfterApplyUpdates. (In this case BatchId, AddedBy, DateAdded, TotalBanked).

One of the reasons is just to avoid overhead. Each and every request will have to receive, process, inspect and update every property of every object in the tree. Slow and error prone.

The developer can do this best, as he knows which properties are critical and/or might be updated by the server.

Yes, I can see that - especially if you had a lot of associations.

But as I mentioned above, all the data is not in the TResolveResults parameter in AfterApplyUpdates, even though the data is returned from the server and visible in the response data in the browser.

The work around I have done is to basically re-fetch the data from the server which is an overhead in itself/.

The data should be there. I'd need a case reproducing the issue to fix it (if it's a problem).

I will put one together, but the post above shows the returned json (network tab) and the image is of the Info data during step through for the same call.

1 Like