[aida] Newbie question

Janko Mivšek janko.mivsek at eranova.si
Thu Oct 18 17:09:42 CEST 2007


Nicolas,

nicolas petton wrote:

> I'm working on a small blog engine, mostly to learn AIDA/Web.
> 
> I've got a Blog, and some posts.
> In BlogApp>>viewMain, I want to display the posts :
> 
> BlogApp>>vewMain
> 	|e|
> 	e := WebElement new.
> 	self observee posts do: [:each |
> 		e add: (PostApp new observee: each)].
> 	self pageFrameWith: e title: self observee title. 
> 
> It does not work (return halt).
> What's wrong ?

e add: (PostApp new observee: each)

You don't need to make PostApp manually, it is automatically created 
when you access that domain object for a first time. What you need is to 
add a link to that domain object:

e addLinkTo: each text: eaxh title.

So, a whole viewMain would be:

BlogApp>>viewMain
  	|e|
  	e := WebElement new.
  	self observee posts do: [:each |
  		e addLinkTo: each text: each title.
		e addBreak].
  	self pageFrameWith: e title: self observee title.

Best regards
Janko

-- 
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si


More information about the Aida mailing list