Hi
I am currently enhancing ListGrid with edit functionality and we are getting warning messages about edited records lost from cache after we saveAllEdits:
CONTEXT
----------
I will simplify situation by presenting it to you as a PERSON grid.
Columns are
- NAME, AGE, SEX - composite primary key
- PROFESSION (can be DEVELOPER or TESTER)
- COUNTRY
- CITY
Editable columns are only COUNTRY and CITY, and they are dependent. If we change country, we will preselect capital city by default.
And the new logic is when we change COUNTRY or CITY for record with PROFESSION TESTER, then we will find all other TESTERs in grid and change for them COUNTRY and CITY the same way.
USECASE:
-----------
Change country of John to France. City will get Paris preselected. John is tester, so this change will be applied to all testers: Clara will get France and Paris also.
Asterisk shows that we have outstanding edit values:
If I call now getAllEditRows() and for all rows I will log getEditValues(), I will see:
Now I call saveAllEdits(). Update goes to server, refetch is triggered on the grid. The console gets warnings which I mentioned at the beginning and if I call again getAllEditRows() and getEditValues(), I see:
John is saved completely, but Clara's primary key is still in the grid left as outstanding edit. How it is possible that we have pending edits after saveAllEdits()? Why it is the primary key values? I am investigating it since yesterday, trying to discard edits, change primary keys, clear grid data ... but nothing solves the problem completely.
I know, you will ask for test case, but currently I was not able to run showcase locally because ... superdevmode is failing all the time. I would try again, if I will success I will post testcase additionally.
Meanwhile, I will be glad if you get some help for me.
Thanks
Matus
I am currently enhancing ListGrid with edit functionality and we are getting warning messages about edited records lost from cache after we saveAllEdits:
Code:
[ERROR] [portal] - 13:33:35.688:XRP0:WARN:ListGrid:isc_ProviderAccountAccountingConfigurationListGrid__0:Record:{transactionCurrency: "EUR", providerAccountId: "954247380A0A227E01784911F6F938C2", merchantAccountPublicId: "000000315C1FBFAF"}, lost from local cache in paged result set. Pending edits for this record will be maintained.
CONTEXT
----------
I will simplify situation by presenting it to you as a PERSON grid.
Columns are
- NAME, AGE, SEX - composite primary key
- PROFESSION (can be DEVELOPER or TESTER)
- COUNTRY
- CITY
Editable columns are only COUNTRY and CITY, and they are dependent. If we change country, we will preselect capital city by default.
And the new logic is when we change COUNTRY or CITY for record with PROFESSION TESTER, then we will find all other TESTERs in grid and change for them COUNTRY and CITY the same way.
Code:
+-------+-----+-----+------------+----------+--------+ | NAME | AGE | SEX | PROFESSION | COUNTRY | CITY | +-------+-----+-----+------------+----------+--------+ | John | 25 | M | Tester | Germany | Munich | +-------+-----+-----+------------+----------+--------+ | Clara | 27 | F | Tester | Germany | Munich | +-------+-----+-----+------------+----------+--------+ | Matus | 27 | M | Developer | Germany | Munich | +-------+-----+-----+------------+----------+--------+
-----------
Change country of John to France. City will get Paris preselected. John is tester, so this change will be applied to all testers: Clara will get France and Paris also.
Asterisk shows that we have outstanding edit values:
Code:
+-------+-----+-----+------------+----------+--------+ | NAME | AGE | SEX | PROFESSION | COUNTRY | CITY | +-------+-----+-----+------------+----------+--------+ | John | 25 | M | Tester | *France | *Paris | +-------+-----+-----+------------+----------+--------+ | Clara | 27 | F | Tester | *France | *Paris | +-------+-----+-----+------------+----------+--------+ | Matus | 27 | M | Developer | Germany | Munich | +-------+-----+-----+------------+----------+--------+
Code:
Edit rows = 0,1 0. {NAME=John, AGE=25, SEX=M, COUNTRY=France, CITY=PARIS} 1. {NAME=Clara, AGE=27, SEX=F, COUNTRY=France, CITY=PARIS} 2. {}
Code:
Edit rows = 1 0. {} 1. {NAME=Clara, AGE=27, SEX=F} 2. {}
I know, you will ask for test case, but currently I was not able to run showcase locally because ... superdevmode is failing all the time. I would try again, if I will success I will post testcase additionally.
Meanwhile, I will be glad if you get some help for me.
Thanks
Matus
Comment