logo       

Re: nested LiveCallbacks: msg#00126

Subject: Re: nested LiveCallbacks
Juan Burella a écrit :

Using this version it works in a different way but not completely right. When the second list is selected everything works fine, but then the first one is selected, it disappears leaving only the second and the third visible.

I got some new ideas...
See Seaside2.5b8-mb.15
The nested live callbacks work for me with the attached example.
Can you also try with your code ?
Michel.

Something I did not mention in my previous posts: when you are nesting live callbacks, the Javascript must execute all the <script> tags produced by the live callbacks.
This is also part of the new implementation.

'From Squeak3.7 of ''4 September 2004'' [latest update: #5989] on 28 October 
2005 at 6:11:36 pm'!
WAComponent subclass: #NestedLiveCallbackExample
        instanceVariableNames: 'country province city'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'SeaComp-Example'!

!NestedLiveCallbackExample methodsFor: 'initialization' stamp: 'mb 10/28/2005 
17:52'!
initialize
        self country: 'Argentina'.! !


!NestedLiveCallbackExample methodsFor: 'rendering' stamp: 'mb 10/28/2005 17:48'!
renderCitiesOn: aRenderer

        aRenderer spanNamed: 'citySelector' with:
                [aRenderer 
                        selectFromList: self cityNames
                        selected: city
                        callback:[:f | city := f ]                              
                
                        labels: [:ea |  ea ]]           
! !

!NestedLiveCallbackExample methodsFor: 'rendering' stamp: 'mb 10/28/2005 17:49'!
renderContentOn: aRenderer 

        aRenderer
                selectFromList: #( 'Argentina' 'Aruba' )
                selected: country
                callback:[:f | self error: 'Should never come here' ] 
                labels: [:ea |  ea ]
                liveCallback: 
                        [:anObject :h | 
                        country := anObject. 
                        province := self provinceNames first. 
                        city := self cityNames first.
                        self renderProvincesOn: h].

        self renderProvincesOn: aRenderer.
! !

!NestedLiveCallbackExample methodsFor: 'rendering' stamp: 'mb 10/28/2005 17:49'!
renderProvincesOn: aRenderer

        aRenderer spanNamed: 'provinceSelector' with:
                [aRenderer
                        selectFromList:  self provinceNames
                        selected: province
                        callback:[:f | self error: 'Should never come here' ] 
                        labels: [:ea |  ea ]
                        liveCallback: 
                                [:anObject :h | 
                                province := anObject. 
                                city := self cityNames first.
                                self renderCitiesOn: h]].
        self renderCitiesOn: aRenderer.

! !


!NestedLiveCallbackExample methodsFor: 'accessing' stamp: 'mb 10/28/2005 17:51'!
city: anObject
        city := anObject.
! !

!NestedLiveCallbackExample methodsFor: 'accessing' stamp: 'mb 10/28/2005 17:45'!
cityNames
        province = 'Oranjestad'
                ifTrue: [^#( 'Casibari' 'Bubali')       ].
        province = 'Santa Cruz'
                ifTrue: [^#( 'Arikok' 'Yamonta')        ].
        province = 'Buenos Aires'
                ifTrue: [^#('La Plata' 'Azul')].
        province = 'Cordoba'
                ifTrue: [^#('Alta Gracia' 'La Falda ')].
        ^#()
! !

!NestedLiveCallbackExample methodsFor: 'accessing' stamp: 'mb 10/28/2005 17:52'!
country: anObject
        country := anObject. 
        self province: self provinceNames first. 
! !

!NestedLiveCallbackExample methodsFor: 'accessing' stamp: 'mb 10/28/2005 17:51'!
province: anObject
        province := anObject.
        self city: self cityNames first.
! !

!NestedLiveCallbackExample methodsFor: 'accessing' stamp: 'mb 10/28/2005 17:42'!
provinceNames
        country = 'Aruba'
                ifTrue: [^#('Oranjestad' 'Santa Cruz')].
        country = 'Argentina'
                ifTrue: [^#( 'Buenos Aires' 'Cordoba')].
        ^#()
! !

"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!

NestedLiveCallbackExample class
        instanceVariableNames: ''!

!NestedLiveCallbackExample class methodsFor: 'as yet unclassified' stamp: 'jmb 
10/27/2005 11:34'!
canBeRoot

^true! !
_______________________________________________
Seaside mailing list
Seaside@xxxxxxxxxxxxxxxxxxxxxxxxxx
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe