No subject


Wed May 23 23:23:08 CEST 2007


ajaxUpdateWith: aParmString
	| parm |
	(aParmString notNil and: ['sort-*' match: aParmString]) ifTrue: 
		[parm := aParmString readStream upTo: $-; upToEnd.
		(self columnWithId: parm asInteger) sort. "or toogle sort order"
		self page: 1]. "always back to first page after sort change"
	(aParmString notNil and: ['page-*' match: aParmString]) ifTrue: 
		[parm := aParmString readStream upTo: $-; upToEnd.
		self page: parm asInteger]. 
	^self

Which really, in my mind, should be this:

actionSort: aColumnNumber
	(self columnWithId: parm) aColumnNumber.
	self page: 1.

actionPage: aPageNumber
	self page: aPageNumber

I don't really know how hard it would be to "push" those events to an upper level component but since each WebElement knows its parent, I don't see that it would be that hard. A WebElement that wanted to expose an API to its parent would simply pass the event upwards to be handled by that parent's event handlers:

viewMain
	e := MyWebElement new.
	e action: #twiddle.
	self pageFrameWith: e title: 'purely hypothetical example'.

actionMainTwiddle
	self doSomething.

The action methods are still not identical because where WebApplication has views, WebElement does not but the basic mechanism is the same. I'm not sure how to cleanly handle the difference between those two. Basically in this scheme, events are passed to the components responsible for generating them. These components can ignore, consume or pass them to their parent.

Eli




More information about the Aida mailing list