RE: Newbie: NonDirect Java - Using Popup Menus in Nib Files
RE: Newbie: NonDirect Java - Using Popup Menus in Nib Files
- Subject: RE: Newbie: NonDirect Java - Using Popup Menus in Nib Files
- From: "Pierre Bernard" <email@hidden>
- Date: Thu, 20 Mar 2003 09:11:57 +0100
- Thread-topic: Newbie: NonDirect Java - Using Popup Menus in Nib Files
Martin,
that code should actually go into the controller class. When you work with a NIB you usually create 2 classes: the archive which is generated by IB and the controller which you write. IN D2JC you will actually write two separate rules: one for the archive key to load the NIB and one for the className key to load the controller.
In the NIB you should have at least 2 display groups. One bound to the displayGroup key of the controller (file's owner) and one bound to the controllerDisplayGroup key. The controller display group actually contains only one item: the controller. This allows you to bind UI items to the controller.
In you example you are likely to have a 3rd display group providing the possible values for the pop-up menu. That is unless that's what you use the default display group for. Let's assume that display group is named countries. You would have a public variable named countries in your controller. You would have declared that variable as an outlet of your controller class in IB. You should then bind from the file's owner countries key to the countries display group. Then you also need to add two keys to the controllerDisplayGroup in IB: contries & countries.selectedObject. Your pop-up will need to have at least 2 aspects bound: titles to a key in the countries display group & selected object to countries.selectedObject.
Your display group is now available to the controller as is the selected object.
Pierre.
-----Original Message-----
From: Martin Spenceley [mailto:email@hidden]
Sent: Wednesday, March 19, 2003 7:15 PM
To: Pierre Bernard
Cc: email@hidden
Subject: RE: Newbie: NonDirect Java - Using Popup Menus in Nib Files
Hi Pierre,
On Wednesday, March 19, 2003, at 05:00PM, Pierre Bernard <email@hidden> wrote:
>I don't know what the tutorial wants you to do with the _illustrator variable. But I would guess later code will depend on that. Code you will have to write.
Unfortunately, the example does not go any further. I suppose it assumes one already know what to do next!
>For the second example you would need to set the selected object in the display group that holds the list of County. You can do that much like you did with _illustrator and use the selected index binding/aspect.
> * In order to use this display group rather than the default one add the following to you
> * subclass of EOArchiveController:
> * <CODE>
> * public EODisplayGroup controllerDisplayGroup()
> * {
> * if ( ! hasControllerDisplayGroup())
> * {
> * EODisplayGroup displayGroup = new EODisplayGroup();
> *
> * setControllerDisplayGroup(displayGroup);
> * }
> *
> * return super.controllerDisplayGroup();
> * }
> * </CODE>
I assume this has to go in the file the NIB generates, which is normally not shown anywhere.
But will I lose this information each time I save the NIB file?
Martin
**********************************************************************
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.