[aida] what's wrong, cannot get element hide

Janko Mivšek janko.mivsek at eranova.si
Tue Feb 17 14:48:07 CET 2009


Hilaire Fernandes pravi:
> In the following example, I expect the web element referenced by input
> temporary variable to be hidden at the first page rendering.
> But it is not, I don't see why. Toggling is working however
> 
> viewTerms
> 	|e input|
> 	e := WebElement new. 
> 	input := WebElement new addInputFieldAspect: #name for: Term new.

As every Smalltalk #add: method Aida also returns the argument, not the
receiver of this call, that's why in your case you get a WebInputField
and not WebElement in input local variable. Use therefore #yourself :

     input := WebElement new
		addInputFieldAspect: #name for: Term new;
		yourself


> 	input hide. 
> 	e addTextH1: 'Editer les termes de la nomenclature'.
> 	e addTextBold: 'Nom : '. e addText: self observee name.
> 	e addBreak.
> 	(e addTextBold: 'ajouter un terme') onClickToggle: input.
> 	e addSpace.
> 	e add: input.
> 	e addBreak.
> 	self pageFrameWith: e title: 'Editer les termes'.
> 

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


More information about the Aida mailing list