I'm having an issue using a DynamicForm and ListGrid which share the same RestDataSource.
I can use the ListGrid to FETCH and UPDATE items and this works fine. And I can use the DynamicForm to add a new item, which works fine the first time. The first time it's called, it sends only the parameters in the form to the server. The server responds with the full JSON representation of the new domain object which updates the RestDataSource. However, the second time I try to use the form to add a new object, it sends not only the parameters defined in the form, but all the additional attributes of the domain object that were returned on the last use of the form.
For example, I have a Book with a "title" attribute. The DynamicForm has a single field, "Title". But the data source has all the fields in the domain object, including "id" which is the primary key. The first time I use the form it sends only the "title" field. The second time, it sends the value in the "title" field, and the "id" from new domain object created with the last form submission.
I'm calling "reset" on the form, which clears the fields, but this doesn't seem to stop it from sending fields which are not part of the form.
Any suggestions? What am I doing wrong?
- Greg
I can use the ListGrid to FETCH and UPDATE items and this works fine. And I can use the DynamicForm to add a new item, which works fine the first time. The first time it's called, it sends only the parameters in the form to the server. The server responds with the full JSON representation of the new domain object which updates the RestDataSource. However, the second time I try to use the form to add a new object, it sends not only the parameters defined in the form, but all the additional attributes of the domain object that were returned on the last use of the form.
For example, I have a Book with a "title" attribute. The DynamicForm has a single field, "Title". But the data source has all the fields in the domain object, including "id" which is the primary key. The first time I use the form it sends only the "title" field. The second time, it sends the value in the "title" field, and the "id" from new domain object created with the last form submission.
I'm calling "reset" on the form, which clears the fields, but this doesn't seem to stop it from sending fields which are not part of the form.
Any suggestions? What am I doing wrong?
- Greg
Comment