Hi Aiders,
HK> At least at the weekend I will give it a second try. It was obvious
HK> why it couldn't work but the modifications where few and
HK> straightforward.
ok I managed to have my app running on 6.0 beta2. Migration was not as
straightforward as just installing the new Aida, but maybe that was
me.
For Squeak I attach the changed methods as fileouts, for VW copy them
from the end of this mail.
Cheers,
Herbert mailto:
[hidden email]
WebApplication category private-ajax
ajaxDoBlock: aRequest
| elementId blockName block |
elementId := self session lastRequest ajaxParameter: 'blockElementId'.
blockName := self session lastRequest ajaxParameter: 'blockName'.
block := (aRequest context elementId: elementId) otherAt: blockName
ifAbsent: [^self].
block value
WebApplication category private-ajax
respondToAjaxRequest: aRequest
| oldElement e |
oldElement := aRequest context elementId: aRequest ajaxElementId.
aRequest isAjaxInPlaceEditingRequest ifTrue: [^self respondToAjaxInPlaceEditing: aRequest].
aRequest isAjaxPostWithInput ifTrue: [aRequest context form ajaxAcceptFormInputFrom: aRequest].
aRequest isAjaxAutocompleteRequest ifTrue: [^self respondToAjaxAutocomplete: aRequest].
aRequest isAjaxDoBlock ifTrue: [self ajaxDoBlock: aRequest].
e := self ajaxUpdateOfOld: oldElement from: aRequest. "update (recreate or refresh) that element"
e adaptFormElements.
aRequest context form registerFormElementsIn: e.
e prepareToHTMLPrintOn: self session. "to prepare again"
^e elements "because you need to send inner html of element only, not its tags"
WebElement category private-Ajax
dependentInformation: anElementOrIdCollection to: aStream isFirst: isFirst
| url head tail headId parm |
anElementOrIdCollection ifNil: [^''].
head := anElementOrIdCollection first.
tail := anElementOrIdCollection copyFrom: 2
to: anElementOrIdCollection size.
url := self ajaxCallUrl.
headId := head isSymbol
ifTrue: [head]
ifFalse:
[head registerId.
head id].
parm := self ajaxCallUrlParametersFor: head.
isFirst
ifTrue:
[self registerId.
parm := parm , '&blockElementId=' , self id
, '&blockName=onClickBlock'].
aStream
nextPutAll: 'new Ajax.Updater(''';
nextPutAll: headId asString;
nextPutAll: ''', ''';
nextPutAll: url;
nextPutAll: ''', {method: ''post'', postBody: ''';
nextPutAll: parm;
nextPut: $';
nextPutAll: ', onComplete: function() {'.
tail isEmpty
ifTrue: [aStream nextPutAll: ' inCall = false; ']
ifFalse:
[self
dependentInformation: tail
to: aStream
isFirst: false].
aStream
nextPutAll: '; }';
nextPutAll: ', evalScripts: true});'
WebElement category events-ajax
onClickDo: aBlock andUpdate: anElementOrId
| idSymbol url parms |
idSymbol := anElementOrId isSymbol
ifTrue: [anElementOrId]
ifFalse:
[anElementOrId registerId.
anElementOrId id].
url := self ajaxCallUrl.
parms := self ajaxCallUrlParametersFor: anElementOrId.
self otherAt: #onClickBlock put: aBlock.
self registerId.
parms := parms , '&blockElementId=' , self id
, '&blockName=onClickBlock'.
self
onClick: 'new Ajax.Updater(''' , idSymbol asString , ''', ''' , url
, ''', {method: ''post'', postBody: ''' , parms
, ''', evalScripts: true})'
WebElement category events-ajax
onClickDo: aBlock andUpdateMany: anElementOrIdCollection
| stream |
stream := String new writeStream.
self
dependentInformation: anElementOrIdCollection
to: stream
isFirst: true.
self
registerId;
otherAt: #onClickBlock put: aBlock;
onClick: 'if (!inCall) {inCall = true;' , stream contents , '}'
WebPage category initialize-release
initPageHeaderLinks
self initHeaders.
self app isNil ifTrue: [^nil].
self addMetaContentType: 'text/html; charset=UTF-8'.
self addLinkToScreenStyleSheet: self site style screenCssResource.
self addLinkToPrintStyleSheet: self site style printCssResource.
self addLinkToDefaultFavicon. "that from WebStyle favicon in imgs"
self addLinkToJavascript: self site style javascriptResource.
self addJavascript: 'var inCall = false;'.
self addGlobalKeywords. "if any"
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida