Re: supplying an initial selection in WOPopUpButton and its kin
Re: supplying an initial selection in WOPopUpButton and its kin
- Subject: Re: supplying an initial selection in WOPopUpButton and its kin
- From: Joe Little <email@hidden>
- Date: Wed, 21 Jul 2004 11:29:49 -0700
On Tue, 20 Jul 2004 15:30:52 -1000, Art Isbell <email@hidden> wrote:
> > My example is that I want to
> > assign Lab EOs to my Users. In WOPopUpButton I set this info:
> >
> > displayString itemLab.labName
> > item itemLab
> > list labs
> > noSelectionString "Select a Lab"
> > selection selectedLab
>
> To assign an initial selected value, assign a Lab to selectedLab.
> This can be done in the component's constructor, for example.
>
This was what caught me, as I was already doing this. Further
debugging show that selectedLab, which depended on selectedUser, would
always end up being null since selectedUser (which contains a lab id)
was always initialized via a nextPage call after the constructor was
run. I moved the assignment to the setUser() function that was being
called and everything started working (with a few other brain-dead
problems addressed along the way)
> > In my class constructor for the overall WOComponent, I initialize both
> > the values:
> >
> > public edit_user(WOContext context) {
> > super(context);
> > labs = getLabs();
> > itemLab = getSelectedLab();
>
> itemLab shouldn't be explicitly assigned. The pop-up dynamic element
> will assign itemLab.
dropped itemLab, and have getSelectedLab() outside of the constructor
to make things work (now assigning to selectedLab). Thanks for
pointing this part out. Once I stepped away from itemLab and what it
does, it became more clear.
>
> Aloha,
> Art
> _______________________________________________
> 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.
_______________________________________________
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.