how to do keyword initialization of WAComponent children.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how to do keyword initialization of WAComponent children.

Bakki Kudva
I trying a trivial example where I am doing this....

WAComponent subclass: LHFileClass  subclass: LHFileCabinet

Other children of LHFileClass are LHFileDrawer, LHFileFolder etc.
LHFileClass is an abstract class which holds  methods common to all. I
want the initializer for children like, LHCabinet to be a keyword
method (which I adapted from classes such as Point x:y:)which  is
simply name: aName which sets the name of the filing cabinet in its
instance var name. It does this by actually calling a calss method
setName: in LHFileClass

name: aName
 "initialize new Filing Cabinet"
        ^self new setName: aName.

But when I try to instantiate the class in the workspace I get:
UndefinedObject(Object)>>doesNotUnderstand: registerObjectForBacktacking.

I tried adding super intialize to both children but still got the msg.

TIA,
bakki
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: how to do keyword initialization of WAComponent children.

Philippe Marschall
2006/9/15, Bakki Kudva <[hidden email]>:

> I trying a trivial example where I am doing this....
>
> WAComponent subclass: LHFileClass  subclass: LHFileCabinet
>
> Other children of LHFileClass are LHFileDrawer, LHFileFolder etc.
> LHFileClass is an abstract class which holds  methods common to all. I
> want the initializer for children like, LHCabinet to be a keyword
> method (which I adapted from classes such as Point x:y:)which  is
> simply name: aName which sets the name of the filing cabinet in its
> instance var name. It does this by actually calling a calss method
> setName: in LHFileClass
>
> name: aName
>  "initialize new Filing Cabinet"
>         ^self new setName: aName.
>
> But when I try to instantiate the class in the workspace I get:
> UndefinedObject(Object)>>doesNotUnderstand: registerObjectForBacktacking.
>
> I tried adding super intialize to both children but still got the msg.

You try to register your components somewhere in the initialization
code for backtracking. You can only do that if a session is around and
that's not the case in the workspace. It should work fine, in a normal
webapplication context. The whole session lookup is a bit annoying in
the debugger too. Time that someone writes a session aware debugger
;).

Philippe
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside