I'm still trying to build a standalone test case, but there's a lot going on here and I'd hoped to pare it down to something more manageable before I post it.
For now, I'll say that I have 2 tabs. One with a form and one with a ListGrid. The form gets its fields collection from the result of some fetch operation, and looks something like this:
where getRelatedEditor's setGridFields method does pretty much what it sounds like:
Each of the dynamic fields in this case has a valueMap defined on it by way of a (dynamic) datasource. This all works fine, except that when I double click a grid row to startEditing, I'm greeted with a bunch of log entries like
at which time either the formItem's valueMaps are unusable or the listGridField's are. Which is affected seems to be pretty arbitrary. Each attempt to edit yields something like this in the log
As I said, there's a lot going on here. I'm hoping that the minimal code & log output I've shown here is enough to put us on the right track. If not, I'm happy to post the entire contents of the log, but I'd ask for some guidance regarding log levels and where you think I should start and end it.
Thanks in advance.
Edit: I don't necessarily see how it's relevant, but I'll also mention that form and grid use different datasources having these dynamic fields in common.
For now, I'll say that I have 2 tabs. One with a form and one with a ListGrid. The form gets its fields collection from the result of some fetch operation, and looks something like this:
Code:
ds.fetchData(criteria, new DSCallback() { @Override public void execute(DSResponse response, Object rawData, DSRequest request) { ArrayList<String> attributes = new ArrayList<String>(); ArrayList<FormItem> items = new ArrayList<FormItem>(); for (int i=0; i<response.getData().length; i++) { Record rec = response.getData()[i]; String attributeName = "attr" + rec.getAttribute("id"); attributes.add(attributeName); FormItem item = new FormItem(attributeName); item.setWidth(150); items.add(item); } form.setFields(items.toArray(new FormItem[0])); getRelatedEditor().setGridFields(attributes); } }); }
Code:
void setGridFields(List<String> attributes) { final ArrayList<ListGridField> fields = new ArrayList<ListGridField>(); /* * always add these 2 fields, but the rest are determined dynamically */ ListGridField color = new ListGridField(ProductionLineVariant.ITEM_COLOR); color.setValueMap(IPGui.getValueMapFromRecords(IPGui.getColorRecords(), IPCOLOR.CCLR, IPCOLOR.CLRN)); color.setCanEdit(false); ListGridField size = new ListGridField(ProductionLineVariant.ITEM_SIZE); size.setValueMap(IPGui.getValueMapFromRecords(IPGui.getSizeRecords(), IPSIZES.SSIZ, IPSIZES.SNAM)); size.setCanEdit(false); fields.add(color); fields.add(size); for (String attr : attributes) { ListGridField field = new ListGridField(attr); field.setAttribute("detail", false); fields.add(field); } grid.setFields(fields.toArray(new ListGridField[]{})); grid.invalidateCache(); }
Code:
[ERROR] [ipgui] - 10:54:42.927:MUP7:WARN:Log:ClassFactory.addGlobalID: ID:'isc_SelectItem_59' for object '[SelectItem ID:isc_SelectItem_59 name:attr40]' collides with ID of existing object '[SelectItem ID:isc_SelectItem_59 name:attr01]'. The global reference to this object will be replaced
Code:
11:16:18.602:IFCS8:WARN:nativeFocus:isc_SelectItem_93[attr35]:calling element.blur() to correct focus in hidden item: [SelectItem ID:isc_SelectItem_93 name:attr35]
Thanks in advance.
Edit: I don't necessarily see how it's relevant, but I'll also mention that form and grid use different datasources having these dynamic fields in common.
Comment