Hello, I have a doubt about DynamicForms. I’m using SmartGWT LGPL and the problem is that I have multiple TextItem in a Window, but these fields are divided into two Layouts. To do this I had to put two DynamicForms due to Items are not added directly to the panel.
In my application I have a DataSource bound to the two DynamicForms but when I perform fetchdata() action, these DynamicForms show all the fields contained in the Datasource.
Then, Aren’t there any way to do this? Because, I have the fields of my form divided in several SectionStacks, and for this reason I need use several DynamicForms (one for section). But if I need use several DataSources (one for dynamicform) when I view data on ListGrid I cannot see all datasources in this listgrid.
Set the DataSource on the form first and then define the fields you want to show. You can use a ValuesManager to let multiple forms edit the same DataSource record.
I have read this in documentacion: “Like a DynamicForm, a ValuesManager can be databound by setting dataSource. In this case all member forms must also be bound to the same DataSource.”
Then I have done:
ValuesManager vm = new ValuesManager();
dfNForm1.setDataSource(ClientDS.getInstance());
dfNForm2.setDataSource(ClientDS.getInstance());
vm.addMember(dfNForm);
vm.addMember(dfNForm1);
vm.setDataSource(ClientDS.getInstance());
vm.fetchData();
The DataSource has 6 fields: dfNform1 has 3 items associated, and dfNform2 has the 3 other. But when I say “dfNForm1.setDataSource”, dfNform1 show all the DataSource’s fields, although I have set setUseAllDataSourceFields to false. (The same for dfNForm2)