onViewOpened called twice if component name matches

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

onViewOpened called twice if component name matches

James Foster-3
Attached is a simple example of the problem. The work-around is to mis-name
the view. See comments at TestShell>>createComponents for an example.

James Foster


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 G)RX-
M"@T*#0IP86-K86=E(&-L87-S3F%M97,-"@EA9&0Z("-497-T4VAE;&P[#0H)
M861D.B C5&5S=%-U8E-H96QL.PT*"7EO=7)S96QF+@T*#0IP86-K86=E(&)I
M;F%R>4=L;V)A;$YA;65S.B H4V5T(&YE=PT*"7EO=7)S96QF*2X-"@T*<&%C
M:V%G92!G;&]B86Q!;&EA<V5S.B H4V5T(&YE=PT*"7EO=7)S96QF*2X-"@T*
M<&%C:V%G92!S9710<F5R97%U:7-I=&5S.B H261E;G1I='E3970@;F5W#0H)
M861D.B G+BY<+BY<+BY<3V)J96-T($%R='-<1&]L<&AI;EQ"87-E7$1O;'!H
M:6XG.PT*"6%D9#H@)RXN7"XN7"XN7$]B:F5C="!!<G1S7$1O;'!H:6Y<3590
M7$)A<V5<1&]L<&AI;B!-5E @0F%S92<[#0H)861D.B G+BY<+BY<+BY<3V)J
M96-T($%R='-<1&]L<&AI;EQ-5E!<4')E<V5N=&5R<UQ497AT7$1O;'!H:6X@
M5&5X="!0<F5S96YT97(G.PT*"6%D9#H@)RXN7"XN7"XN7$]B:F5C="!!<G1S
M7$1O;'!H:6Y<35907%1Y<&4@0V]N=F5R=&5R<UQ$;VQP:&EN(%1Y<&4@0V]N
M=F5R=&5R<R<[#0H)>6]U<G-E;&8I+@T*#0IP86-K86=E(0T*#0HB0VQA<W,@
M1&5F:6YI=&EO;G,B(0T*#0I3:&5L;"!S=6)C;&%S<SH@(U1E<W13:&5L; T*
M"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A<'5B;&EC(2 A
M#0H-"B%497-T4VAE;&P@8VQA<W,@;65T:&]D<T9O<B$-"@T*<F5S;W5R8V5?
M1&5F875L=%]V:65W#0H)(D%N<W=E<B!T:&4@;&ET97)A;"!D871A(&9R;VT@
M=VAI8V@@=&AE("=$969A=6QT('9I97<G(')E<V]U<F-E(&-A;B!B92!R96-O
M;G-T:71U=&5D+@T*"41/($Y/5"!%1$E4($]2(%)%0T%414=/4DE:12!42$E3
M($U%5$A/1"X-"@T*"4EF('EO=2!W:7-H('1O(&UO9&EF>2!T:&ES(')E<V]U
M<F-E(&5V86QU871E.@T*"59I97=#;VUP;W-E<B!O<&5N3VXZ("A297-O=7)C
M94ED96YT:69I97(@8VQA<W,Z('-E;&8@<V5L96-T;W(Z("-R97-O=7)C95]$
M969A=6QT7W9I97<I#0H)(@T*#0H)7B,H(R<A(5-43"<@,R W.#@U-3@@,3 @
M(R,H4VUA;&QT86QK+E-40E9I97=0<F]X>2D@(#@@(R,H4VUA;&QT86QK+E-H
M96QL5FEE=RD@(#DX(#(W(# @," Y." R(#(W,3,Q.3 U(#$S,3 W,R T,38@
M," U,C0U-3 @(R,H4VUA;&QT86QK+D-O;&]R4F5F*2 @." T,C<X,3DP,#@P
M(#,R.#$Y." C(RA3;6%L;'1A;&LN4&]I;G0I(" Q,C Q(#@P,2 U-3$@," P
M(# @-#$V(# @,C,T(#(U-B Y." R(#0Q," X(",C*%-M86QL=&%L:RY2969E
M<F5N8V56:65W*2 @.3@@,30@," T,38@.3@@,B X(#$Q-# X-3 V.#@@,3,Q
M,#<S(#4Y,B P(# @," W(# @," P(#4Y,B Q,3@P,38V(",C*%-M86QL=&%L
M:RY297-O=7)C94ED96YT:69I97(I(" X(",C*%-M86QL=&%L:RY497-T4W5B
M4VAE;&PI(" X("-R97-O=7)C95]$969A=6QT7W9I97<@," Y.#,S,#(@(R,H
M4VUA;&QT86QK+DUE<W-A9V5397%U96YC92D@(#(P,B R,#@@.3@@,2 W,C$V
M-S @(R,H4VUA;&QT86QK+DUE<W-A9V5396YD*2 @." C8W)E871E070Z97AT
M96YT.B Y." R(#4S," S(#$@-3,P(#$Q.#,@-S,Q(#4Y,B Y.#,S,#(@(R,H
M4VUA;&QT86QK+E=)3D1/5U!,04-%345.5"D@(#@@(ULT-" P(# @," P(# @
M," P(#$@," P(# @,C4U(#(U-2 R-34@,C4U(#(U-2 R-34@,C4U(#(U-2 R
M-34@,C4U(#(U-2 R-34@,C4U(#(U-2 R-34@,C4U(#$@," P(# @," P(# @
M," X," R(# @," Q,#D@,2 P(#!=(#DX(# @-3,P(#$Y,R Q.3,@," R-R X
M("=S=6)6:65W)R P(# @," P(# @,2 P(# @," P(#$@," P(#<S." R,#(@
M,C X(#DX(#(@.# R(#@S,B Y." R(#4S," R-34Y(#(Q(#4S," Q,C Q(#@P
M,2 T,38@.# R(#@@(W5P9&%T94UE;G5"87(@.30T(#0Q-B X.3@@." C6S0T
M(# @," P(# @," P(# @," P(# @," R-34@,C4U(#(U-2 R-34@,C4U(#(U
M-2 R-34@,C4U(#(U-2 R-34@,C4U(#(U-2 R-34@,C4U(#(U-2 R-34@,C4U
M(#0@," P(#$P(# @," P(#@W(#<@," P(#$U-" Q(# @,%T@.3@@,2 U.3(@
M.38P(# @,C<@*2$@(0T*(51E<W13:&5L;"!C;&%S<R!C871E9V]R:65S1F]R
M.B C<F5S;W5R8V5?1&5F875L=%]V:65W(7!U8FQI8R%R97-O=7)C97,M=FEE
M=W,A("$-"@T*5&5S=%-U8E-H96QL(&=U:60Z("A'54E$(&9R;VU3=')I;F<Z
M("=[-45",38R0S@M,3%#-"TT.$-"+3@X1#,M,31&0S$Q13%$.44V?2<I(0T*
M5&5S=%-U8E-H96QL(&-O;6UE;G0Z("<G(0T*(51E<W13=6)3:&5L;"!C871E
M9V]R:65S1F]R0VQA<W,A3590+5!R97-E;G1E<G,A("$-"B%497-T4W5B4VAE
M;&P@;65T:&]D<T9O<B$-"@T*8W)E871E0V]M<&]N96YT<PT*#0H)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A;&QT
M86QK+E!O:6YT*2 @-3 Q(#4P,2 U-3$@," P(# @-#$V(# @,C,T(#(U-B Y
M." R(#0Q," X(",C*%-M86QL=&%L:RY497AT161I="D@(#DX(#$V(# @-#$V
M(#DX(#(@." Q,30P.3$V,S4R(#$P,C4@-3DR(# @-#@R(#@@-#(W.#$Y,# X
M," P(#<@," P(# @-3DR(# @." T,CDT.3 S,3(U(#@U,C0X-B C(RA3;6%L
M;'1A;&LN3G5L;$-O;G9E<G1E<BD@(# @," Q(#DX,S,P,B C(RA3;6%L;'1A
M;&LN365S<V%G95-E<75E;F-E*2 @,C R(#(P." Y." S(#<R,38W," C(RA3
M;6%L;'1A;&LN365S<V%G95-E;F0I(" X("-C<F5A=&5!=#IE>'1E;G0Z(#DX
M(#(@-3,P(#,@-3$@-3,P(#0R,2 T,2 U.3(@.#$X(#@@(W-E;&5C=&EO;E)A
M;F=E.B Y." Q(#4R-3 V,B C(RA3;6%L;'1A;&LN26YT97)V86PI(" S(#$@
M,R U.3(@.#$X(#@@(VES5&5X=$UO9&EF:65D.B Y." Q(#,R(#4Y,B Y.#,S
M,#(@(R,H4VUA;&QT86QK+E=)3D1/5U!,04-%345.5"D@(#@@(ULT-" P(# @
M," P(# @," P(#$@," P(# @,C4U(#(U-2 R-34@,C4U(#(U-2 R-34@,C4U
M(#(U-2 R-34@,C4U(#(U-2 R-34@,C4U(#(U-2 R-34@,C4U(#$@," P(# @
M,C4@," P(# @,C$Q(# @," P(#0U(# @," P72 Y." P(#4S," Q.3,@,3DS
M(# @,C<@." G=&5X="<@," P(# @," P(#$@," P(# @," Q(# @," W-30@
M,C R(#(P." Y." R(#@Q." X-#@@.3@@,B U,S @,C4U.2 R,2 U,S @-3 Q
M(#4P,2 T,38@.#$X(#@@(W5P9&%T94UE;G5"87(@.3@@," T,38@,3 T,B X
M("-;-#0@," P(# @," P(# @," P(# @," P(#(U-2 R-34@,C4U(#(U-2 R
M-34@,C4U(#(U-2 R-34@,C4U(#(U-2 R-34@,C4U(#(U-2 R-34@,C4U(#(U
M-2 R-34@-" P(# @,3 @," P(# @,C0Y(#4@," P(#0@,2 P(#!=(#DX(#(@
M-#$P(#@@(R,H4VUA;&QT86QK+E-T871I8U1E>'0I(" Y." Q-B P(#0Q-B Y
M." R(#@@,3$T,#@U,#DT-" Q(#$S-#0@," P(# @-R P(# @," Q,S0T(# @
M." T,CDT.3 S,3,S(#<R,B P(# @," W-30@,C R(#(P." Y." R(#@Q." X
M-#@@.3@@,B U,S @,R Q(#4S," T,C$@-#$@,3,T-" X,3@@." C=&5X=#H@
M.3@@,2 X("=#86QL<R!T;R C;VY6:65W3W!E;F5D('=E<F4Z)R Q,S0T(#$P
M-#(@." C6S0T(# @," P(# @," P(# @,2 P(# @," R-34@,C4U(#(U-2 R
M-34@,C4U(#(U-2 R-34@,C4U(#(U-2 R-34@,C4U(#(U-2 R-34@,C4U(#(U
M-2 R-34@,2 P(# @," P(# @," P(#(Q,2 P(# @," R," P(# @,%T@.3@@
M," Q,3 T(# @,C<@-3DR(#$Q,#0@," R-R I(2 A#0HA5&5S=%-U8E-H96QL
M(&-L87-S(&-A=&5G;W)I97-&;W(Z("-R97-O=7)C95]$969A=6QT7W9I97<A
M<'5B;&EC(7)E<V]U<F-E<RUV:65W<R$@(0T*#0HB0FEN87)Y($=L;V)A;',B
%(0T*#0H`
`
end


Reply | Threaded
Open this post in threaded view
|

Re: onViewOpened called twice if component name matches

James Foster-3
Andy/Blair,
Do you need anything further from me on this?
James

On 28 Nov 2005 "James Foster" <[hidden email]> wrote in message
news:438cd00f$[hidden email]...
> Attached is a simple example of the problem. The work-around is to
> mis-name the view. See comments at TestShell>>createComponents for an
> example.
>
> James Foster
>
>


Reply | Threaded
Open this post in threaded view
|

Bug: onViewOpened called twice if component name matches

James Foster-3
In reply to this post by James Foster-3
Following is a simple example of the problem. The work-around is to mis-name
the view. See comments at TestShell>>createComponents for an example.

James Foster

----------------------------
| package |
package := Package name: 'Test'.
package paxVersion: 1;
 basicComment: ''.


package classNames
 add: #TestShell;
 add: #TestSubShell;
 yourself.

package binaryGlobalNames: (Set new
 yourself).

package globalAliases: (Set new
 yourself).

package setPrerequisites: (IdentitySet new
 add: '..\..\..\Object Arts\Dolphin\Base\Dolphin';
 add: '..\..\..\Object Arts\Dolphin\MVP\Base\Dolphin MVP Base';
 add: '..\..\..\Object Arts\Dolphin\MVP\Presenters\Text\Dolphin Text
Presenter';
 add: '..\..\..\Object Arts\Dolphin\MVP\Type Converters\Dolphin Type
Converters';
 yourself).

package!

"Class Definitions"!

Shell subclass: #TestShell
 instanceVariableNames: 'subPresenter'
 classVariableNames: ''
 poolDictionaries: ''
 classInstanceVariableNames: ''!
Shell subclass: #TestSubShell
 instanceVariableNames: 'textPresenter'
 classVariableNames: ''
 poolDictionaries: ''
 classInstanceVariableNames: ''!

"Global Aliases"!


"Loose Methods"!

"End of package definition"!

"Source Globals"!

"Classes"!

TestShell guid: (GUID fromString: '{581CF2DA-1E6D-4B6C-B094-13BD6B1173F0}')!
TestShell comment: ''!
!TestShell categoriesForClass!MVP-Presenters! !
!TestShell methodsFor!

createComponents

 super createComponents.
 "subPresenter := self add: TestSubShell new name: 'subViewX'." "good"
 subPresenter := self add: TestSubShell new name: 'subView'.  "bad"
! !
!TestShell categoriesFor: #createComponents!public! !

!TestShell class methodsFor!

resource_Default_view
 "Answer the literal data from which the 'Default view' resource can be
reconstituted.
 DO NOT EDIT OR RECATEGORIZE THIS METHOD.

 If you wish to modify this resource evaluate:
 ViewComposer openOn: (ResourceIdentifier class: self selector:
#resource_Default_view)
 "

 ^#(#'!!STL' 3 788558 10 ##(Smalltalk.STBViewProxy)  8
##(Smalltalk.ShellView)  98 27 0 0 98 2 27131905 131073 416 0 524550
##(Smalltalk.ColorRef)  8 4278190080 328198 ##(Smalltalk.Point)  1201 801
551 0 0 0 416 0 234 256 98 2 410 8 ##(Smalltalk.ReferenceView)  98 14 0 416
98 2 8 1140850688 131073 592 0 0 0 7 0 0 0 592 1180166
##(Smalltalk.ResourceIdentifier)  8 ##(Smalltalk.TestSubShell)  8
#resource_Default_view 0 983302 ##(Smalltalk.MessageSequence)  202 208 98 1
721670 ##(Smalltalk.MessageSend)  8 #createAt:extent: 98 2 530 3 1 530 1183
731 592 983302 ##(Smalltalk.WINDOWPLACEMENT)  8 #[44 0 0 0 0 0 0 0 1 0 0 0
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 1 0 0 0 0 0
0 0 80 2 0 0 109 1 0 0] 98 0 530 193 193 0 27 8 'subView' 0 0 0 0 0 1 0 0 0
0 1 0 0 738 202 208 98 2 802 832 98 2 530 2559 21 530 1201 801 416 802 8
#updateMenuBar 944 416 898 8 #[44 0 0 0 0 0 0 0 0 0 0 0 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255 4 0 0 10 0 0 0 87 7 0 0 154
1 0 0] 98 1 592 960 0 27 )! !
!TestShell class categoriesFor:
#resource_Default_view!public!resources-views! !

TestSubShell guid: (GUID fromString:
'{5EB162C8-11C4-48CB-88D3-14FC11E1D9E6}')!
TestSubShell comment: ''!
!TestSubShell categoriesForClass!MVP-Presenters! !
!TestSubShell methodsFor!

createComponents

 super createComponents.
 textPresenter := self add: TextPresenter new name: 'text'.
!

onViewOpened

 super onViewOpened.
 textPresenter value: textPresenter value asNumber + 1.
! !
!TestSubShell categoriesFor: #createComponents!public! !
!TestSubShell categoriesFor: #onViewOpened!public! !

!TestSubShell class methodsFor!

resource_Default_view
 "Answer the literal data from which the 'Default view' resource can be
reconstituted.
 DO NOT EDIT OR RECATEGORIZE THIS METHOD.

 If you wish to modify this resource evaluate:
 ViewComposer openOn: (ResourceIdentifier class: self selector:
#resource_Default_view)
 "

 ^#(#'!!STL' 3 788558 10 ##(Smalltalk.STBViewProxy)  8
##(Smalltalk.ShellView)  98 27 0 0 98 2 10354689 131073 416 0 524550
##(Smalltalk.ColorRef)  8 4278190080 328198 ##(Smalltalk.Point)  501 501 551
0 0 0 416 0 234 256 98 2 410 8 ##(Smalltalk.TextEdit)  98 16 0 416 98 2 8
1140916352 1025 592 0 482 8 4278190080 0 7 0 0 0 592 0 8 4294903125 852486
##(Smalltalk.NullConverter)  0 0 1 983302 ##(Smalltalk.MessageSequence)  202
208 98 3 721670 ##(Smalltalk.MessageSend)  8 #createAt:extent: 98 2 530 3 51
530 421 41 592 818 8 #selectionRange: 98 1 525062 ##(Smalltalk.Interval)  3
1 3 592 818 8 #isTextModified: 98 1 32 592 983302
##(Smalltalk.WINDOWPLACEMENT)  8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255 1 0 0 0 25 0 0 0 211 0 0 0
45 0 0 0] 98 0 530 193 193 0 27 8 'text' 0 0 0 0 0 1 0 0 0 0 1 0 0 754 202
208 98 2 818 848 98 2 530 2559 21 530 501 501 416 818 8 #updateMenuBar 98 0
416 1042 8 #[44 0 0 0 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 4 0 0 10 0 0 0 249 5 0 0 4 1 0 0] 98 2 410 8
##(Smalltalk.StaticText)  98 16 0 416 98 2 8 1140850944 1 1344 0 0 0 7 0 0 0
1344 0 8 4294903133 722 0 0 0 754 202 208 98 2 818 848 98 2 530 3 1 530 421
41 1344 818 8 #text: 98 1 8 'Calls to #onViewOpened were:' 1344 1042 8 #[44
0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 1 0 0 0 0 0 0 0 211 0 0 0 20 0 0 0] 98 0 1104 0 27 592 1104 0
27 )! !
!TestSubShell class categoriesFor:
#resource_Default_view!public!resources-views! !

"Binary Globals"!