Problem - Adding a List Box to a dialog Shell

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem - Adding a List Box to a dialog Shell

bpaul
Hi

I try to add a ListBox (for example name: myList) from a resource browser to
example dialog shell like: a PersonalAccountTransactionDialog (from applic
ation Personal Money), and next,
in method "model:" i would like to write a line:

mylistPresenter model: (anAspectBuffer mylist).

now mylistPresenter is connected to the object List  in my model (like in
method "model:" at PersonalMoneyShell class)
when i try to show this shell, the message box inform me that AspectBuffer
doesn't understand #mylist
why it is workig in PersonalMoneyShell class but in Dialog shell like Pers
onalAccountTransactionDialog no ?


Thanks
bpaul


Reply | Threaded
Open this post in threaded view
|

Re: Problem - Adding a List Box to a dialog Shell

Bill Schwab-2
> I try to add a ListBox (for example name: myList) from a resource browser
to

> example dialog shell like: a PersonalAccountTransactionDialog (from applic
> ation Personal Money), and next,
> in method "model:" i would like to write a line:
>
> mylistPresenter model: (anAspectBuffer mylist).
>
> now mylistPresenter is connected to the object List  in my model (like in
> method "model:" at PersonalMoneyShell class)
> when i try to show this shell, the message box inform me that AspectBuffer
> doesn't understand #mylist
> why it is workig in PersonalMoneyShell class but in Dialog shell like Pers
> onalAccountTransactionDialog no ?

The problem is occurring because of Dialog's buffering mechanism.  Note that
the argument to #model: is an AspectBuffer, not the object you created in
#defaultModel or provided to #showModalOn:.  You can send #subject to the
buffer to get the model, and then #mylist will work, but that's going to
cause confusion if the user edits things and then cancels.

I have long used a NonBufferedDialog that deliberately disables buffering,
but I have to do my own buffering and apply changes when appropriate, which
can be non-trivial at times.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Problem - Adding a List Box to a dialog Shell

Ian Bartholomew-17
In reply to this post by bpaul
> why it is workig in PersonalMoneyShell class but in Dialog shell like Pers
> onalAccountTransactionDialog no ?

Bill is quite right about the underlying cause being the buffering used by
the Dialog class but in this case I think there is more to it than that.
The AspectBuffer makes use of the #doesNotUnderstand mechanism to forward
messages onto it's buffered copy of the model (it's subject).  If you have
set up the model correctly, and it implements the #mylist method, then you
shouldn't get a walkback (but the Dialog probably won't work in the way you
want either!).

Another point is that the ListPresenter requires a ListModel for it's Model
and unless your Model provides one, rather than an ordinary collection, then
errors will occur when you select from the list.

See the attached package for a *very* simplistic example. The package
comment shows how to run the example.

There are some other things that can cause problems when using
ListPresenters in Dialogs, some of which depend on what you want the Dialog
to do - for example, a buffered edit of the original list is more complex
than just displaying a list to make a selection.

If you want post a copy of your package (assuming it's not too big, <15K
should be OK) then I'm sure someone can point out the problems.  If you
prefer not to go public then feel free to mail me a copy and I'll have a
look.

Regards
    Ian









begin 666 Test.pac
M?"!P86-K86=E('P-"G!A8VMA9V4@.CT@4&%C:V%G92!N86UE.B G5&5S="<N
M#0IP86-K86=E('!A>%9E<G-I;VXZ(# [#0H)8F%S:6-#;VUM96YT.B G37E$
M:6%L;V<@<VAO=TUO9&%L3VXZ($UY36]D96P@;F5W)RX-"@T*#0IP86-K86=E
M(&-L87-S3F%M97,-"@EA9&0Z("-->41I86QO9SL-"@EA9&0Z("-->4UO9&5L
M.PT*"7EO=7)S96QF+@T*#0IP86-K86=E(&)I;F%R>4=L;V)A;$YA;65S.B H
M4V5T(&YE=PT*"7EO=7)S96QF*2X-"@T*<&%C:V%G92!G;&]B86Q!;&EA<V5S
M.B H4V5T(&YE=PT*"7EO=7)S96QF*2X-"@T*<&%C:V%G92!A;&Q297-O=7)C
M94YA;65S.B H4V5T(&YE=PT*"6%D9#H@(TUY1&EA;&]G("T^("=$969A=6QT
M('9I97<G.PT*"7EO=7)S96QF*2X-"@T*<&%C:V%G92!S9710<F5R97%U:7-I
M=&5S.B H261E;G1I='E3970@;F5W#0H)861D.B G3V)J96-T($%R='-<1&]L
M<&AI;EQ"87-E7$1O;'!H:6XG.PT*"6%D9#H@)T]B:F5C="!!<G1S7$1O;'!H
M:6Y<35907$)A<V5<1&]L<&AI;B!-5E @0F%S92<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#4R,# P,# P,3 P,# P,# T-#9&-D,W,#8X-CDV13(P-$0U-C4P,C T,C8Q
M-S,V-34R,# P,# P,$$P,# P,# T-#8Y-C$V0S9&-C<U-C8Y-C4W-S8R,# P
M,# P,44P,# P,# P,# P,# P,# P,# P,# P-C(P,# P,# P,C P,# P,# Q
M,# Y,# Q,#$P,# R,#!!,# Q,# P,# P,# P,# P,# P,# P,# P,# P,# P
M,#@W,# P,# P,# P,# P,# P,# P,# P,# P,# P,# P03 P,3 P,# P-C W
M,$,P,#0R-D8W,C8T-C4W,C1#-C$W.39&-S4W-# P,# P,# P,#$P,# P,# P
M,3 P,# P,# P,# P,# P.4$P,3 P,# P,# P,# P,#E!,# P,# P,# P,# P
M,#!#,# Q,# P,#4R,# P,# P,$0P,# P,# U,C8U-C8V-3<R-C4V138S-C4U
M-C8Y-C4W-S8R,# P,# P,$4P,# P,# P,# P,# P,$$P,#$P,# P-C(P,# P
M,# P,C P,# P,#@R,# P,# P,#0P,# P,# P,# P,# T-# Q,# P,C P,C P
M,C P,# P,# P,# P,# P,# P,# P,# P,# P,# P-S P,# P,# P,# P,# P
M,# P,# P,# P,# P,# P,#(P,#(P,# P,#8P,C$R,# U,C8U-S,V1C<U-S(V
M,S8U-#DV-#8U-D4W-#8Y-C8V.38U-S(P,# P,# P,#E!,# P,# P,# P,# P
M,#!#,# Q,# P,#4R,# P,# P,#DP,# P,# U,#<R-C4W,S8U-D4W-#8U-S(U
M,C P,# P,#$V,# P,# P-$8T0C(P-#,V,39%-C,V-39#,C V,C<U-S0W-#9&
M-D4R,#8R-D,V1C8S-D(P,# P,# P,# V,#$P1C P-$0V-3<S-S,V,38W-C4U
M,S8U-S$W-38U-D4V,S8U,# P,# P,#!#03 P,# P,# P,# P,# P1# P,# P
M,# V,C P,# P,# Q,# P,# P,#8P,S!",# T1#8U-S,W,S8Q-C<V-34S-C4V
M138T,# P,# P,#!"03 P,# P,# P,# P,# P-3(P,# P,# Q,# P,# P,#8S
M-S(V-38Q-S0V-30Q-S0S038U-S@W-#8U-D4W-#-!-C(P,# P,# P,C P,# P
M,# V,#(P-3 P-3 V1C8Y-D4W-# P,# P,# P,34P,# P,#!"-3 Q,# P,#8R
M,#,P,# P,# P,# P,#!$-3 Q,# P,#0W,# P,# P,C P,C P,# P-C Q,$8P
M,#4W-#DT130T-$8U-S4P-$,T,30S-#4T1#0U-$4U-# P,# P,# P-S(P,# P
M,# R0S P,# P,#)#,# P,# P,# P,# P,# P,3 P,# P,$9&1D9&1D9&1D9&
M1D9&1D9&1D9&1D9&1D9&1D9&1D9&,$$P,# P,#!$03 P,# P,$8T,# P,# P
M1D0P,# P,# V,C P,# P,# P,# P,# P-C(P,S P,# P,# P,# P,$,Q,# P
M,# P0S$P,# P,# P,# P,# P,#$U,# P,# P,# P,# P,# P,# P,# P,# P
M,# P,# P14$P,# P,# P,# P,# P,# P,#$P,# P-C(P,# P,# P,C P,# P
M,#E!,#$P,# P,# P,# P,# Y03 P,# P,# P,# P,# P0S P,3 P,# U,C P
M,# P,# W,# P,# P-$,V.3<S-S0T,C9&-S@V,C P,# P,#$Q,# P,# P,# P
M,# P,#!!,# Q,# P,#8R,# P,# P,#(P,# P,# X,C P,# P,# T,# P,# P
M,#$P,3,Q-#0P,3 T,# P,# P,#0P,# P-#8P,S Y,# P,C P,# P,#1#-CDW
M,S<T-$0V1C8T-C4V0S P,# P,# P0T$P,# P,# P,# P,# P,$0P,# P,# P
M-C(P,# P,# P,# P,# P,# P,# P,# P,#8P,#$T,# T.38T-C4V13<T-CDW
M-#<Y-3,V-38Q-S(V,S8X-3 V1C9#-CDV,S<Y,# P,# P,# P,# P,# P,# P
M,# P,# P,#<P,# P,# P,# P,# P,# P,# P,# P,# P,# P,# P,# T,# P
M,# P,# P,# P.#(P,# P,# P.# P,# P,$(U,#9&1D9&,# P,# P,# Y03 P
M,# P,# P,# P,# P0S P,3 P,# U,C P,# P,#$Q,# P,# P-#(V,3<S-CDV
M,S1#-CDW,S<T-#$V,C<S-S0W,C8Q-C,W-#8R,# P,# P,# P,# P,# R,# P
M,# P,$0R,#(P,# P,# P,# P,#!#03 P,# P,# P,# P,# P1# P,# P,# V
M,C P,# P,# S,# P,# P,3(P,S P,# P,# P,# P,#,P,#,P,# P-C(P,# P
M,# P,C P,# P,#8R,#,P,# P,# P,# P,# T-S P,# P,#%&,# P,# P-C(P
M,S P,# P,# P,# P,$9",# P,# P-48P,3 P,# P,# T,# P,#$R,#,P,# P
M,# P,# P,#!"03 P,# P,# P,# P,# P-3(P,# P,# Q-S P,# P,#8R-C$W
M,S8Y-C,U,S8U-D,V-38S-S0V.39&-D4W,S0R-SDT.39%-C0V-3<X,T$V,C P
M,# P,# Q,# P,# P-C(P,# P,# P,# P,# P,# P,#0P,# P,3(P,S P,# P
M,# P,# P,$)!,# P,# P,# P,# P,# U,C P,# P,#$Q,# P,# P-C@V1C<R
M-CDW039&-D4W-#8Q-D,T-3<X-S0V-39%-S0S038R,# P,# P,#$P,# P,# P
M,3 P,# P,# P,#0P,# P.3(P,S P,# P,# P,# P,#<R,# P,# P,D,P,# P
M,# R0S P,# P,# P,# P,# P,#$P,# P,#!&1D9&1D9&1D9&1D9&1D9&1D9&
M1D9&1D9&1D9&1D9&1C(S,# P,# P,$8P,# P,#!!,# P,# P,$)%,# P,# P
M0T$P,# P,# P,# P,# P,$0P,# P,# P.3 P-# P,#!$,# S,# P,# P,# P
M,# P,3,P,# P,# U,C P,# P,# V,# P,# P-D0W.31#-CDW,S<T,#8P,C Y
M,# U,C8U-C,W-#8Q-D4V-S9#-C4P,# P,# P,#8R,#,P,# P,# P,# P,# Q
M-3 P,# P,#$U,# P,# P-C(P,S P,# P,# P,# P,#$U,# P,# P,34P,# P
M,# P,# P,# P,# P,# P,# P,# P,# P,# P,# P,# P,$4W,C(P,# P,# P
M,# P,# P,# P,# P,# P,# P,# P,# P,# P,# P,3 P,# P,# P,# P,# P
M,# P,# P,# P-C S,#DP,#4S-C4V1#8Q-S V.#9&-S(V-3 P,# P,# P,# P
M,# P,# P,# P,# P,# Q,# P,# P,# P,# P,# X,C P,# P,# T,# P,# P
M0S1#-D0T-S=$,C R,# P,# P,# P,# P0T$P,# P,# P,# P,# P,$0P,# P
M,# P-C(P,# P,# P,C P,# P,#$R,#,P,# P,# P,# P,# S,# S,# P,#8R
M,# P,# P,#(P,# P,# V,C S,# P,# P,# P,# P,$(P,# P,# P0C P,# P
M,#8R,#,P,# P,# P,# P,# P.3 R,# P,#1&,#(P,# P03 P,3 P,# Q,C S
M,# P,# P,# P,# P0D$P,# P,# P,# P,# P,#4R,# P,# P,#@P,# P,# V
M1#8U-D4W-30R-C$W,C-!-C(P,# P,# P,3 P,# P,# P,# P,# P03 P,3 P
M,# Y,C S,# P,# P,# P,# P-S(P,# P,# R0S P,# P,#)#,# P,# P,# P
M,# P,# P,# P,# P,$9&1D9&1D9&1D9&1D9&1D9&1D9&1D9&1D9&1D9&1D9&
M,#4P,# P,# P-3 P,# P,# Y,#$P,# P,D,P,3 P,#!#03 P,# P,# P,# P
M,# P1# P,# P,# V,C P,# P,# R,# P,# P,C P,C P,# P,# T,# P,$0P
M,#,P,# P,# P,# P,# Q-3 P,# P,#0V,#4P-# P,#,P,# P,# T.38S-D8V
M13 P,# P,# P,# P,# P,# Q,# P,# P,#!%,#(Q,3 P-3,U-#0R-3,V.39%
M-C<V0S8U-S0V1C9%-3 W,C9&-S@W.3 P,# P,# P.4$P,# P,# P,# P,# P
M,#4R,# P,# P,#<P,# P,# T-#9&-D,W,#8X-CDV134R,# P,# P,3@P,# P
M,# T.39$-C$V-S8U-3(V-39#-C$W-#8Y-S8V-30V-CDV0S8U-$,V1C8S-C$W
M-#9&-S)"03 P,# P,# P,# P,# P-3(P,# P,# P-S P,# P,#8S-S4W,C<R
M-C4V13<T-3(P,# P,# P13 P,# P,#0T-CDV,39#-D8V-S4V-CDV-3<W,D4V
M.38S-D8P13 R,48P,#4S-30T,C0U-S@W-#8U-S(V138Q-D,U,C8U-S,V1C<U
M-S(V,S8U-$,V.38R-S(V,3<R-SDU,#<R-D8W.#<Y,# P,# P,# U,C P,# P
M,#$P,# P,# P-C0V1C9#-S V.#8Y-D4V-#<R,S S,#,U,D4V-#9#-D,P,# P
,,# P,"<I*2$-"@T*
`
end