[Seaside] Ajax and decomposition views

VAM fattigra at mail.ru
Fri Aug 1 08:25:16 UTC 2008



Sebastian Sastre-2 wrote:
> 
> ... what do you mean by decomposition? You can try reprhasing your
> question
> 

I try do it.

For example, a seaside application has some organizations. A page displays a
list of organizations in the left side. An user can select an organization
in the list (and the selected organization must renders highlighted). On
right side of the page displays details of the selected organization.
And the application has goods, messages, and others. They must display in
the same way.

For reusing code may create next classes: ListView and DetailsView.
ListView renders a collection and respons for selecting an object from this
collection. DetailsView renders a concrete object. And I want use in some
cases only ListView without a DetailsView.

Better way use triggerEvent or announcement. ListView send announce and
interested components process it. But for rendering need instance of a
Renderer.

For non-Ajax applications it simple, because each user action renders all
page, but how be in Ajax app?

I may write next code in onClick handler

ListView>>renderContent: html
	super renderContentOn: html.
	(html unorderedList)
		id: self listId;
		with: [self renderItemsOn: html]

ListView>>renderItemsOn: html
	selectionInList list do:
			[:each | 
			| listItem |
			listItem := html listItem.
			each = selectionInList selection ifTrue: [listItem class: 'selected'].
			listItem
				onClick:
						((html updater)
								id: 'list';
								callback:
										[:renderer | 
											selectionInList selection: each.
											self renderItemsOn: renderer.
											!!! Here we need render detailsView. How? ListView don't know
about its id and rendering methods!!!]);
				onMouseOver: (html element toggleClassName: 'bounded');
				onMouseOut: (html element toggleClassName: 'bounded');
				with: each]


Using SUEvaluator ,IMHO, not resolves problem.


-- 
View this message in context: http://www.nabble.com/Ajax-and-decomposition-views-tp18730184p18770177.html
Sent from the Squeak - Seaside mailing list archive at Nabble.com.



More information about the seaside mailing list