The problem is that things have changed since WO3.5 days...we've just ported
some apps so I'm quite familiar with all this.
>The first is to add an "Update" button that would invoke an action, similar
>to selectObject in the examples, which simply sets the display groups
>selected object to the new selected object in the PopUp. The code snippets
>are like this...
>
>// * * * * * PhoneNumbers.wod
>PhoneNames: WOPopUpButton {
> displayString = selectedPhone.Name;
> item = selectedPhone;
> list = phoneNumberDisplayGroup.displayedObjects;
>}
Tha big problem is here. You should bind selectedPhone to selection, not
item. Item is used to point to the current item as WO iterates through the
list creating the pop-up etc. selection is the actual item that was
selected. What you really wanted was this
PhoneNames: WOPopUpButton {
displayString = phoneItem.Name;
item = phoneItem;
selection = selectedPhone;
list = phoneNumberDisplayGroup.displayedObjects;
}
>UpdateButton: WOSubmitButton {
> action = updateView;
> value = "Update View";
>}
>PhoneNumber: WOTextField {
> value = selectedPhone.Number;
>}
This should now work properly. What was happening was that selectedPhone
was left being whatever item was the last one WO looked at while creating the
page, but the actual selection was different.
This is all in the docs, but can easily be overlooked, so I say RTFM in a
nice way :)
Hope this helps sort out your confusion
Craig Miskell
Programmer, Black Albatross, Otago University, New Zealand