whats the best way to access the object data when doing custom rendering..?

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

whats the best way to access the object data when doing custom rendering..?

Rick Flower
I'm trying to follow "Possibility 3" from the Magritte tutorial (page  
54) where I subclass MAContainerComponent and create my own  
#renderContentOn: and override #descriptionContainer to point to my  
new subclass.. The tutorial didn't really indicate how to get the  
component data or other general usage -- so I figured I'd ask..

Also -- for future reference.. Is there an example or two that might  
be good to use as references for this sort of questioning that doesn't  
require pier since I'm on the VW platform?  I'm a Magritte newbie and  
examples are very helpful.. Thx!

-- Rick


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: whats the best way to access the object data when doing custom rendering..?

Rick Flower
I should have mentioned that I'm asking about accessing the memento  
(proxied) data specifically.. Thx!

-- Rick

On Jul 27, 2008, at 8:31 AM, Richard E. Flower wrote:

> I'm trying to follow "Possibility 3" from the Magritte tutorial (page
> 54) where I subclass MAContainerComponent and create my own
> #renderContentOn: and override #descriptionContainer to point to my
> new subclass.. The tutorial didn't really indicate how to get the
> component data or other general usage -- so I figured I'd ask..
>
> Also -- for future reference.. Is there an example or two that might
> be good to use as references for this sort of questioning that doesn't
> require pier since I'm on the VW platform?  I'm a Magritte newbie and
> examples are very helpful.. Thx!
>
> -- Rick
>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: whats the best way to access the object data when doing custom rendering..?

Rick Flower
Ok.. In  thinking about it further, I believe I may not need direct  
access to all elements of a description but
I would like to be able to wrap divs around certain object  
descriptions for formatting purposes.. Is this the
best way to achieve that goal?  TIA!

-- Rick

On Jul 27, 2008, at 9:13 AM, Richard E. Flower wrote:

> I should have mentioned that I'm asking about accessing the memento
> (proxied) data specifically.. Thx!
>
> -- Rick
>
> On Jul 27, 2008, at 8:31 AM, Richard E. Flower wrote:
>
>> I'm trying to follow "Possibility 3" from the Magritte tutorial (page
>> 54) where I subclass MAContainerComponent and create my own
>> #renderContentOn: and override #descriptionContainer to point to my
>> new subclass.. The tutorial didn't really indicate how to get the
>> component data or other general usage -- so I figured I'd ask..
>>
>> Also -- for future reference.. Is there an example or two that might
>> be good to use as references for this sort of questioning that  
>> doesn't
>> require pier since I'm on the VW platform?  I'm a Magritte newbie and
>> examples are very helpful.. Thx!
>>
>> -- Rick
>>
>>
>> _______________________________________________
>> SmallWiki, Magritte, Pier and Related Tools ...
>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>>
>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: whats the best way to access the object data when doing custom rendering..?

Lukas Renggli-2
In reply to this post by Rick Flower

On Jul 27, 2008, at 17:31 , Richard E. Flower wrote:

> I'm trying to follow "Possibility 3" from the Magritte tutorial (page
> 54) where I subclass MAContainerComponent and create my own
> #renderContentOn: and override #descriptionContainer to point to my
> new subclass.. The tutorial didn't really indicate how to get the
> component data or other general usage -- so I figured I'd ask..

Have a look at the implementation of MAContainerComponent, it already  
does what you want.

     anObject readUsing: aDescription "reading"
     anObject write: aValue using: aDescription "writing"

Essentially you always use the above two constructs, no matter if  
anObject is a memento or a real object. You just need to know the  
description.

> Also -- for future reference.. Is there an example or two that might
> be good to use as references for this sort of questioning that doesn't
> require pier since I'm on the VW platform?  I'm a Magritte newbie and
> examples are very helpful.. Thx!

There are several open-source examples on squeaksource.com (Conrad,  
ical, ...) and source.lukas-rengli.ch (Pier, Audioscrobbler, MSE File  
Format, Magritte Add-Ons, Magritte Tutorial, More Magritte Add  
Ons, ...) that use Magritte, but I guess that doesn't help you much if  
you are on VW. You might still want to have a look at the code though  
(through the web interface).

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: whats the best way to access the object data when doing custom rendering..?

Lukas Renggli-2
In reply to this post by Rick Flower
> Ok.. In  thinking about it further, I believe I may not need direct
> access to all elements of a description but
> I would like to be able to wrap divs around certain object
> descriptions for formatting purposes.. Is this the
> best way to achieve that goal?  TIA!

What goal?

If this is just about styling specific descriptions when using the  
default Seaside renderer you might want to use

        aDescription cssClass: 'foo'

This adds the CSS CLASS .foo to the description aDescription.

Cheers,
Lukas

>
>
> -- Rick
>
> On Jul 27, 2008, at 9:13 AM, Richard E. Flower wrote:
>
>> I should have mentioned that I'm asking about accessing the memento
>> (proxied) data specifically.. Thx!
>>
>> -- Rick
>>
>> On Jul 27, 2008, at 8:31 AM, Richard E. Flower wrote:
>>
>>> I'm trying to follow "Possibility 3" from the Magritte tutorial  
>>> (page
>>> 54) where I subclass MAContainerComponent and create my own
>>> #renderContentOn: and override #descriptionContainer to point to my
>>> new subclass.. The tutorial didn't really indicate how to get the
>>> component data or other general usage -- so I figured I'd ask..
>>>
>>> Also -- for future reference.. Is there an example or two that might
>>> be good to use as references for this sort of questioning that
>>> doesn't
>>> require pier since I'm on the VW platform?  I'm a Magritte newbie  
>>> and
>>> examples are very helpful.. Thx!
>>>
>>> -- Rick
>>>
>>>
>>> _______________________________________________
>>> SmallWiki, Magritte, Pier and Related Tools ...
>>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>>>
>>
>>
>> _______________________________________________
>> SmallWiki, Magritte, Pier and Related Tools ...
>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>>
>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki

--
Lukas Renggli
http://www.lukas-renggli.ch


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: whats the best way to access the object data when doing custom rendering..?

Rick Flower
In reply to this post by Lukas Renggli-2
Thanks Lukas.. I looked in the class you mentioned but didn't see any  
of the code you
show below.. Perhaps my version is older or whatever.. I did poke  
around on your
site at a handful of projects but didn't see anything doing the same  
sort of thing I'm
trying to do (I was specifically looking for code that subclasses  
MAContainerComponent
and goes from there..  Perhaps I'm going about it wrong..

I've got a glorified user record that has the typical address info but  
also has other
fields such as security questions and other stuff.. What I've got in  
my old (non-Magritte)
code was to wrap divs around certain areas of the layout (address info  
is wrapped
in a div and then other areas are wrapped in another div) to get the  
formatting I want via
css.. Is there some other way?  Sorry for being a pain in the rear,  
but I feel a bit lost on
how to proceed.. Thx!


On Jul 27, 2008, at 12:45 PM, Lukas Renggli wrote:

>
> On Jul 27, 2008, at 17:31 , Richard E. Flower wrote:
>
>> I'm trying to follow "Possibility 3" from the Magritte tutorial (page
>> 54) where I subclass MAContainerComponent and create my own
>> #renderContentOn: and override #descriptionContainer to point to my
>> new subclass.. The tutorial didn't really indicate how to get the
>> component data or other general usage -- so I figured I'd ask..
>
> Have a look at the implementation of MAContainerComponent, it already
> does what you want.
>
>     anObject readUsing: aDescription "reading"
>     anObject write: aValue using: aDescription "writing"
>
> Essentially you always use the above two constructs, no matter if
> anObject is a memento or a real object. You just need to know the
> description.
>
>> Also -- for future reference.. Is there an example or two that might
>> be good to use as references for this sort of questioning that  
>> doesn't
>> require pier since I'm on the VW platform?  I'm a Magritte newbie and
>> examples are very helpful.. Thx!
>
> There are several open-source examples on squeaksource.com (Conrad,
> ical, ...) and source.lukas-rengli.ch (Pier, Audioscrobbler, MSE File
> Format, Magritte Add-Ons, Magritte Tutorial, More Magritte Add
> Ons, ...) that use Magritte, but I guess that doesn't help you much if
> you are on VW. You might still want to have a look at the code though
> (through the web interface).
>
> Cheers,
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: whats the best way to access the object data when doing custom rendering..?

Lukas Renggli-2
> Thanks Lukas.. I looked in the class you mentioned but didn't see any
> of the code you
> show below.. Perhaps my version is older or whatever.. I did poke
> around on your
> site at a handful of projects but didn't see anything doing the same
> sort of thing I'm
> trying to do (I was specifically looking for code that subclasses
> MAContainerComponent
> and goes from there..  Perhaps I'm going about it wrong..

MAContainerComponent only triggers (see renderContentOn:) the  
component renderer (MAComponentRenderer). The component renderer knows  
how to layout the components of the individual descriptions  
(subclasses of MAElementComponent). This is the actual place where the  
data is read and written, according to the displayed editor.

> I've got a glorified user record that has the typical address info but
> also has other
> fields such as security questions and other stuff.. What I've got in
> my old (non-Magritte)
> code was to wrap divs around certain areas of the layout (address info
> is wrapped
> in a div and then other areas are wrapped in another div) to get the
> formatting I want via
> css.. Is there some other way?  Sorry for being a pain in the rear,
> but I feel a bit lost on
> how to proceed.. Thx!

Yes, I understand. That's what #cssClass: is used for. It is not an  
extra DIV that is wrapped around the description, but it is enough to  
do anything to the layout.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki