Hi,
I've come across below warning in some parts of my application.
I've done some digging, and it can relate to:
https://forums.smartclient.com/forum...alue-for-field
I've managed to create simple test case.
As you can see there is a simple DataSource and two forms joined with ValuesManager.
When clicking on button two warnings appears:
Similar warning appears when I load record with:
and this is correct. But in above example I think it shouldn't. There are two forms that cover all fields and are connected with ValuesManager.
In fact this is a simulation of real live example with ValuesManager.saveData() when server responds with whole record. After some debugging I've found that it's connected with updateCaches() method called in core during saveData() processing response.
Strange thing is that I've used the same schema in several DataSources and in some cases Warning appeared recently (after SmartGWT update from last years version) and in other case it does not. Don't know why is that yet but above minimal case shows a problem.
I've also tried to connect DynamicForm with ValuesManager with vm.addMember() but behavior did not changed.
Tested on latest nightly: SmartGWT 13.0p 2023-03-22
So is this warning correct in above test case and I'm missing something or is it a bug??
Another thing is when second form will not have hidden field with primary key, after updateCaches() value is not changed. Despite connection with ValuesManager. This is probably desired behavior but I ask to be sure.
Best regards
Mariusz Goch
I've come across below warning in some parts of my application.
Code:
*20:12:18.354:MUP5:WARN:ValuesManager:isc_ValuesManager_0:Member Form: [DynamicForm ID:isc_DynamicForm_1] has explicitly specified value for field[s] 'text1', but has no item associated with this fieldName. Ignoring this value. Values may be set for fields with no associated form item directly on the valuesManager via valuesManager.setValues(), but not on member forms. See ValuesManager documentation for more info.
https://forums.smartclient.com/forum...alue-for-field
I've managed to create simple test case.
Code:
VLayout layout = new VLayout(5); DataSource ds = new DataSource(); DataSourceIntegerField fieldId = new DataSourceIntegerField("id"); fieldId.setPrimaryKey(true); ds.addField(fieldId); ds.addField(new DataSourceTextField("display")); ds.addField(new DataSourceTextField("text1")); ValuesManager vm = new ValuesManager(); vm.setDataSource(ds); DynamicForm form1 = new DynamicForm(); form1.setDataSource(ds); form1.setValuesManager(vm); form1.setFields( new TextItem("id"), new TextItem("display") ); layout.addMember(form1); DynamicForm form2 = new DynamicForm(); form2.setDataSource(ds); form2.setValuesManager(vm); form2.setFields( new HiddenItem("id"), new TextItem("text1") ); layout.addMember(form2); Record r = new Record(); r.setAttribute("id", 1); r.setAttribute("display", "aaa"); r.setAttribute("text1", "bbb"); vm.editRecord(r); Button button = new Button(); button.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { ListGridRecord r2 = new ListGridRecord(); r2.setAttribute("id", 1); r2.setAttribute("display", "aaa1"); r2.setAttribute("text1", "bbb1"); DSResponse dsResponse = new DSResponse(); dsResponse.setData(r2); dsResponse.setOperationType(DSOperationType.UPDATE); ds.updateCaches(dsResponse); } }); layout.addMember(button); this.addChild(layout);
When clicking on button two warnings appears:
Code:
20:12:18.354:MUP5:WARN:ValuesManager:isc_ValuesManager_0:Member Form: [DynamicForm ID:isc_DynamicForm_1] has explicitly specified value for field[s] 'text1', but has no item associated with this fieldName. Ignoring this value. Values may be set for fields with no associated form item directly on the valuesManager via valuesManager.setValues(), but not on member forms. See ValuesManager documentation for more info. 20:12:18.357:MUP5:WARN:ValuesManager:isc_ValuesManager_0:Member Form: [DynamicForm ID:isc_DynamicForm_2] has explicitly specified value for field[s] 'display', but has no item associated with this fieldName. Ignoring this value. Values may be set for fields with no associated form item directly on the valuesManager via valuesManager.setValues(), but not on member forms. See ValuesManager documentation for more info.
Code:
form1.editRecord(r);
In fact this is a simulation of real live example with ValuesManager.saveData() when server responds with whole record. After some debugging I've found that it's connected with updateCaches() method called in core during saveData() processing response.
Strange thing is that I've used the same schema in several DataSources and in some cases Warning appeared recently (after SmartGWT update from last years version) and in other case it does not. Don't know why is that yet but above minimal case shows a problem.
I've also tried to connect DynamicForm with ValuesManager with vm.addMember() but behavior did not changed.
Tested on latest nightly: SmartGWT 13.0p 2023-03-22
So is this warning correct in above test case and I'm missing something or is it a bug??
Another thing is when second form will not have hidden field with primary key, after updateCaches() value is not changed. Despite connection with ValuesManager. This is probably desired behavior but I ask to be sure.
Best regards
Mariusz Goch
Comment