[aida] Another question...(about WebUser)
janko.mivsek at eranova.si
Fri Oct 26 13:44:48 CEST 2007
nicolas petton a écrit :
>>> I want to add a new variable to WebUser. I added this :
>>> ^self otherValuesAt: 'website' ifAbsent: [self otherValuesAt: 'website'
>>> put: '']
>>> WebUser>>website: aString
>>> self otherValuesAt: 'website' put: aString
>>> in a custom category, so no problem.
>>> But what about views ? I would like to display the new feild in views
>>> (WebAdminApp>>viewRegistration and
>>> My first idea was to subclass this apps, and override MyWebSite>>admin
>>> and MyWebSite>>securityManager.
>>> But if I do it, I need to create empty subclasses of WebAdmin and
>>> WebSecurityManager too, and I really don't like it. Is there another way
>>> to do it without creating those empty subclasses ?
>> You are right, better avoid subclassing and rather use extensions. So on
>> Squeak, if you have a package MyPackage, add method category *MyPackage
>> in class WebUser and that's it! You don't need change any other classes
>> in that case, specially not WebSecurityManager etc.
> But if I don't suclass, there will be no field for website (in the
> registration form, and update form), right ? I didn't see the code for
> this in WebSecurityManagerApp>>userElementForm: or
Then override those methods too with your own ones in your package and
you'll have the same result but without subclasing.
More information about the Aida