Hi,
I'm just facing this problem. Any help will be very appreciated.
- I have a DataSource with hidden PrimaryKey field (I just don't wanna distract users with IDs). The data are populated from database via RPC.
- I display this DataSource using ListGrid.
- Via DynamicForm it is possible to add new data. To eliminate unnecessary roundtrips to database, I just send (when some "Save" button on DynamicForm is pressed) this new data to database.
- If it is processed, RPC returns new PrimaryKey ID generated in database.
Then I wanna perform DynamicForm.saveData() to save these data to DataSource.
But it is not possible to save it also with the new PK! PrimaryKey field in both DataSource and (consequently) DynamicForm is hidden, thus DynamicForm .getItem("ID").setValue(newPKValue) does not work!
If I just perform DynamicForm.saveData(), new values are added to DataSource and new PK is (I guess) generated automaticaly by DataSource. How to overwrite this? Or how to retrieve - after DynamicForm.saveData() - the DataSource's DataSourceField where it was actually saved?
I just don't want to perform DataSource's refresh from the database because I've just added one line. Of course, I need not to use DynamicForm.saveData(), instead, I can read value from all fields and than generate new DataSourceField and add it to the DataSource. But it does not ease the development either.
Thanks for help. Hope its clear, if not, I can provide an example.
Rgds
Mirek
I'm just facing this problem. Any help will be very appreciated.
- I have a DataSource with hidden PrimaryKey field (I just don't wanna distract users with IDs). The data are populated from database via RPC.
- I display this DataSource using ListGrid.
- Via DynamicForm it is possible to add new data. To eliminate unnecessary roundtrips to database, I just send (when some "Save" button on DynamicForm is pressed) this new data to database.
- If it is processed, RPC returns new PrimaryKey ID generated in database.
Then I wanna perform DynamicForm.saveData() to save these data to DataSource.
But it is not possible to save it also with the new PK! PrimaryKey field in both DataSource and (consequently) DynamicForm is hidden, thus DynamicForm .getItem("ID").setValue(newPKValue) does not work!
If I just perform DynamicForm.saveData(), new values are added to DataSource and new PK is (I guess) generated automaticaly by DataSource. How to overwrite this? Or how to retrieve - after DynamicForm.saveData() - the DataSource's DataSourceField where it was actually saved?
I just don't want to perform DataSource's refresh from the database because I've just added one line. Of course, I need not to use DynamicForm.saveData(), instead, I can read value from all fields and than generate new DataSourceField and add it to the DataSource. But it does not ease the development either.
Thanks for help. Hope its clear, if not, I can provide an example.
Rgds
Mirek
Comment