SmartClient Version: SNAPSHOT_v8.3d_2012-08-01/LGPL Development Only (built 2012-08-01)
Hi
We have a problem with setting multiple field values in a ValueManager that hopefully you can help us with.
We have a Form with rather a lot of custom code but it is backed by a ValueManager which is tied to a custom DataSource.
We have a field that is marked multiple = true in the DataSource and have our own listing window for adding multiple items to the form.
The listing window has a callback into the valueManager which updates the existing record with setAttribute (if the record exists).
For an Update, when save is called we save any other values in the form into the Record and call editRecord on the ValueManager.
Before this call if we do a getAttributeAsStringArray on the Record for that field in question the values are returned correctly.
After the call to editRecord, in our extended DataSource when we check the value of the attribute in the Record, again using getAttributeAsStringArray we see [object Object] for any new value we added.
So somewhere between editRecord in the ValueManager and transformRequest in the DataSource any NEW values are over written as [object Object] and we don't know why.
We do see trace that says
But I assumed thats only because we are by passing the form and adding the values directly to the record.
Whats really infuriating is that in gwt debug mode, this works perfectly. In compiled javascript it doesn't for firefox, chrome or IE.
Incidentally, the reverse works correctly. From a Fetch, in our DataSource we call setAttribute with a String[] and we see the expected multiple values in the form.
Hi
We have a problem with setting multiple field values in a ValueManager that hopefully you can help us with.
We have a Form with rather a lot of custom code but it is backed by a ValueManager which is tied to a custom DataSource.
We have a field that is marked multiple = true in the DataSource and have our own listing window for adding multiple items to the form.
The listing window has a callback into the valueManager which updates the existing record with setAttribute (if the record exists).
Code:
private void setMultipleFieldValues(String itemName, String[] values) { if(record!=null) { record.setAttribute(itemName, values); } Map map = this.getValues(); map.put(itemName, values); this.setValues(map); }
Before this call if we do a getAttributeAsStringArray on the Record for that field in question the values are returned correctly.
After the call to editRecord, in our extended DataSource when we check the value of the attribute in the Record, again using getAttributeAsStringArray we see [object Object] for any new value we added.
So somewhere between editRecord in the ValueManager and transformRequest in the DataSource any NEW values are over written as [object Object] and we don't know why.
We do see trace that says
Code:
TextItem:isc_TextItem_3[myField]:$952 - this is a multiple FormItem but newValue is not null and is not an array.
Whats really infuriating is that in gwt debug mode, this works perfectly. In compiled javascript it doesn't for firefox, chrome or IE.
Incidentally, the reverse works correctly. From a Fetch, in our DataSource we call setAttribute with a String[] and we see the expected multiple values in the form.
Comment