[aida] How to set the #addLinkTo:

Germán Arduino garduino at gmail.com
Thu Jan 15 16:45:38 CET 2009


I'm working with a model that has a main collection and other instvar
to store choices for the main collection.

Such #choices is a Dictionary that can have differente things as
elements, by example:

* A simple preloaded array:

	^self choices at: #brands ifAbsentPut: [Array with: 'IBM' with:
'Hewlett Packard' with: 'Clon']

* A collection of full objects, as:

	^self choices at: #serverTypes ifAbsentPut: [Set new]

ServerType in this case is an object with several instvars (name,
brand, machine model, etc)

Then, on server collection of the main class (the system) each server
have an instvar named #serverType
who has the #name of the server type object of the serverTypes
collection stored on the dictionary

I'm adding server types on the serverTypes collection on the way:

addServerType: aServerType
	^self serverTypes add: aServerType

The main view of the system is as follow:


	| e entryList |

	e := WebElement new.
	e addTextH1: 'Server List'.
	entryList := WebGrid new.
	entryList columnNames: #('' 'Name' 'Role' 'Company' 'Status' 'Server Type');
		columnFilters: #(nil nil nil true true nil);
		sortOn: 2;
		collection: self observee servers;
		columnAspects: #(nil #name #role #company #status #serverTypeName);
		column: 6 addBlock: [ :each |
			(WebElement new) addLinkTo: each text: each serverTypeName].
	e add: entryList.
	e addBreak.
	e addButtonText: 'Add a new server'.
        self pageFrameWith: e title: 'Server List'.

My goal is provide a link on server type column that show all the data
of such server type.

The text I show is #serverTypeName because I must to show the name of
server type object, as follow:

	^ serverType name

The question is what should code at addLinkTo: (on the column 6 of
above text) to link the ServerTypeApp
that shows the server type data which name is #serverTypeName?

May be that I'm not setting a #parent: on #addServerType above? I'm
not sure neither of the proper
use of parent.

I hope the mail be clear and sorry by the long post.


Germán S. Arduino

More information about the Aida mailing list