Java client: creating a 'subwindow' in code
Java client: creating a 'subwindow' in code
- Subject: Java client: creating a 'subwindow' in code
- From: "Pierre Bernard" <email@hidden>
- Date: Tue, 18 Mar 2003 11:58:16 +0100
- Thread-topic: Java client: creating a 'subwindow' in code
Hi!
With D2JavaClient under WO 5.2 I have the ability to set a "subwindow" layout hint which allows for a subcontroller not to be shown in its parent but rather in a separate window. The parent controller merely has a button to open that subwindow.
I would like to recreate the exact same behavior in code. I have the feeling I am _this_ close but can't figure it all out.
So far I managed to add the desired subcontroller using the below code. What I need to do is to hide it behind a button opening a new window.
EOActionButtonsController controller = new EOActionButtonsController();
EOListController list = (EOListController) EOControllerFactory.sharedControllerFactory().editorControllerWithEntity(LigneSousTableauDetailImpl.entityName);
EODetailDataSource ds =
new EODetailDataSource(
displayGroup().dataSource(),
LigneImpl.LIGNES_SOUS_TABLEAU_DETAIL);
EODisplayGroup dg = new EODisplayGroup();
dg.setDataSource(ds);
EOMasterDetailAssociation md = new EOMasterDetailAssociation(dg);
md.bindAspect(
EOMasterDetailAssociation.ParentAspect,
displayGroup(),
LigneImpl.LIGNES_SOUS_TABLEAU_DETAIL);
md.establishConnection();
disposableRegistry().addObject(md);
list.setDisplayGroup(dg);
list.setEditingContext(editingContext());
addSubcontroller(list);
list.setRelationshipPath(LigneImpl.LIGNES_SOUS_TABLEAU_DETAIL);
controller.addSubcontroller(list);
controller.setUsesLargeButtonRepresentation(false);
controller.setActionWidgetPosition(EOActionButtonsController.BottomRight);
What this does is that it ask the (undocumented) controller factory for the controller I desire. It wraps it into an EOActionButtonController that should shoe the "Add" and "Remove" buttons. That controller is added as subcontroller to the current one.
I was under the impression that setting both a relationship path and creating the detail group manually was redundant but it seems to be required.
TIA for any comments
Pierre
**********************************************************************
This email and any files transmitted with it are intended solely for
the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the sender
of this message. (email@hidden)
This email message has been checked for the presence of computer
viruses; however this protection does not ensure this message is
virus free.
Banque centrale du Luxembourg; Tel ++352-4774-1; http://www.bcl.lu
**********************************************************************
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.