Re: Dataview: implementing master-datail view with combos. Cache problem ?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Sun Dec 04 2005 - 07:14:58 EST

  • Next message: Ahmed Mohombe: "Re: Dataview: implementing master-datail view with combos. Cache problem ?"

    Hi Andrea,

    I am afraid you are on your own with DataViews (unless other current
    DataViews users chime in), as committers who pushed for their
    inclusion in Cayenne are no longer active in the community:

    http://www.objectstyle.org/cayenne/lists/cayenne-user/2005/11/0088.html

    Andrus

    On Dec 4, 2005, at 1:34 PM, Andrea Borgogelli Avveduti wrote:
    > 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



    This archive was generated by hypermail 2.0.0 : Sun Dec 04 2005 - 07:15:01 EST