Hello there,
I'm trying to create a master view details form with 4 comboboxes.
The following code is from "hr-dataview" example and I have adapted it to my needs.
If a combo item is selected, the second combo need to be updated to show only some dataobjects.
(The same for the third and fourth combo)
// update view
// [DATAVIEW EXAMPLE] creating combobox model
ObjEntityViewField nameField = model.getDepartmentView().getFieldForObjAttribute(
"name");
DOComboBoxModel comboModel = new DOComboBoxModel();
comboModel.setDataObjects(departments);
comboModel.setViewField(nameField);
// using lookup cache to translate between combobox labels and DataObjects.
nameField.getOwner().getOwner().getLookupCache().cache(nameField, departments);
view.getDepartmentsCombo().setModel(comboModel);
rendererFactory.installRenderer(view.getDepartmentsCombo(), nameField);
view.getConnectButton().setText(MainFrameModel.DISCONNECT_LABEL);
view.setDepartmentsVisible(true);
view.setEmployeesVisible(false);
I think my problem is in the line:
nameField.getOwner().getOwner().getLookupCache().cache(nameField, departments);
view.getDepartmentsCombo().setModel(comboModel);
Because if I use cache, I can't update every combo but only one pick list.
The question is, what can I use instead of that method ? (No need to chache at all)
Thank u in advance
Andrea