[aida] Using WebComponent for input objects

nico petton.nicolas at gmail.com
Sun Jul 6 15:56:32 CEST 2008


Le dimanche 06 juillet 2008 à 15:34 +0200, Janko Mivšek a écrit :
> Hi Rob,
> 
> Rob Rothwell wrote:
> 
> > I'm trying to get back to finishing WebRadioButtonGroup, and thought it 
> > would be best to create a WebComponent.  However, I can't seem to get 
> > any values back into my objects when I use it.  I am using Aida5.6-np58.
> 
> WebComponent is meant to be used for more complex, standalone, ajaxified 
> components and not elements as simple as radio button is.
> 
> About #build method: it is used to build a component, but of course 
> someone must call it. It can be called from #initialize, from 
> #printWebPageFor: or even #printHTMLPageOn:for: .

Janko,

In recent aida versions, at least for Squeak, WebComponent new call
#build method.

Cheers!

Nico
> 
> When it is called depends on how late you'd like to build a component. 
> Sometimes it is good to be build as early as possible, sometimes there 
> are needs to build as late as possible, that is just before the 
> component is rendered to the HTML.
> 
> It can also be called from Ajax calls to rebuild the component and that 
> was the main reason it is implemented as separate #build method and not 
> in #prinWwebPageFor: as usual.
> 
> Janko
> 
> 
> > For example, I have a simple
> > 
> > 
> > WebComponent subclass: #WebInputComponent
> > instanceVariableNames: 'object aspect'
> > classVariableNames: ''
> > poolDictionaries: ''
> > category: 'Aida-Components'
> > 
> > with accessors for object and aspect so I can pass them on to the 
> > underlying WebFormElement.
> > 
> > Then, as an example, try creating
> > 
> > WebInputComponent subclass: #WebTextComponent
> > instanceVariableNames: ''
> > classVariableNames: ''
> > poolDictionaries: ''
> > category: 'Aida-Components'
> > 
> > with
> > 
> > WebTextComponent>>#build
> > |e|
> > e := WebElement new.
> > e addInputFieldAspect: self aspect for: self object size: 50.
> > self add: e
> > 
> > and if you #add this component to an application, enter some text, 
> >  press a submit button, and inspect the "bound" object, it remains nil.
> > 
> > Any advice on using WebComponent(s) for this purpose?  I can make 
> > everything work fine by simply creating WebElement(s) instead of 
> > WebComponent(s), but then you lose the built-in #build functionality and 
> > have to resort to special constructors, etc...  It would be much more 
> > elegant to understand why WebComponents are not posting their changes to 
> > the model the way I am using them!
> > 
> > Also, what would be the best way to publish an individual component to 
> > be added to Aida by an end user?  Should it just go into a package that 
> > places the component in the Aida-Components category, or should it be a 
> > new category like Aida-Third Party Components to distinguish them from 
> > built-in components?
> > 
> > Thanks,
> > 
> > Rob
> > 
> > 
> >  
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > _______________________________________________
> > Aida mailing list
> > Aida at aidaweb.si
> > http://lists.aidaweb.si/mailman/listinfo/aida
> 
-------------- section suivante --------------
Une pi�ce jointe non texte a �t� nettoy�e...
Nom: non disponible
Type: application/pgp-signature
Taille: 189 octets
Desc: Ceci est une partie de message
	=?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=
Url: http://lists.aidaweb.si/pipermail/aida/attachments/20080706/f40f8da7/attachment.sig 


More information about the Aida mailing list