Wrapping parts of model objects in divs for display purposes?

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

Wrapping parts of model objects in divs for display purposes?

Rick Flower
Hi all..

Just curious as a Magritte newbie.. If I've got a domain model object
that has 10 fields (name, address,etc) and want some of them wrapped in
div's when the form is displayed, what's the best way to achieve that?

Ideally, I use the divs to apply css and might have for a user record
a box drawn (in css) around the person's address info and perhaps a
different box drawn around other attributes such as account info, etc.
Anyway, I figure I should probably be subclassing something to do this
but thought I'd ask first before I start going down that path..

Thanks!

-- Rick

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

Re: Wrapping parts of model objects in divs for display purposes?

Thomas Koschate-2
On 7/14/07, Rick Flower <[hidden email]> wrote:

> Ideally, I use the divs to apply css and might have for a user record
> a box drawn (in css) around the person's address info and perhaps a
> different box drawn around other attributes such as account info, etc.
> Anyway, I figure I should probably be subclassing something to do this
> but thought I'd ask first before I start going down that path..

My inclination would be to create separate classes for the groups of
attributes that you wish to display differently.  You'll be glad of it
later for reasons beyond your immediate display needs.  And, really,
it's just another code smell telling you that there's objects there
wanting to escape.
--
============================================================
Thomas Koschate

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

Re: Wrapping parts of model objects in divs for display purposes?

Rick Flower
Thomas Koschate wrote:

> On 7/14/07, Rick Flower <[hidden email]> wrote:
>
>> Ideally, I use the divs to apply css and might have for a user record
>> a box drawn (in css) around the person's address info and perhaps a
>> different box drawn around other attributes such as account info, etc.
>> Anyway, I figure I should probably be subclassing something to do this
>> but thought I'd ask first before I start going down that path..
>
> My inclination would be to create separate classes for the groups of
> attributes that you wish to display differently.  You'll be glad of it
> later for reasons beyond your immediate display needs.  And, really,
> it's just another code smell telling you that there's objects there
> wanting to escape.

Thanks Thomas!  One last question (for now) -- If I use two classes
to separate the groups for a single class model, how do I tell Magritte
that I want the first 4 attributes as part of Class #1 and the second
group of 6 attributes as part of Class #2?  Thanks!


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

Re: Wrapping parts of model objects in divs for display purposes?

Stephan Eggermont-3
On Sat, Jul 14, 2007 at 11:12:04PM -0700, Rick Flower wrote:
> Thanks Thomas!  One last question (for now) -- If I use two classes
> to separate the groups for a single class model, how do I tell Magritte
> that I want the first 4 attributes as part of Class #1 and the second
> group of 6 attributes as part of Class #2?  Thanks!

Take a look at:
http://www.iam.unibe.ch/pipermail/smallwiki/2007-March/002663.html
for a somewhat similar problem.

Stephan


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

Re: Wrapping parts of model objects in divs for display purposes?

Rick Flower
Stephan Eggermont wrote:
> On Sat, Jul 14, 2007 at 11:12:04PM -0700, Rick Flower wrote:
>> Thanks Thomas!  One last question (for now) -- If I use two classes
>> to separate the groups for a single class model, how do I tell Magritte
>> that I want the first 4 attributes as part of Class #1 and the second
>> group of 6 attributes as part of Class #2?  Thanks!
>
> Take a look at:
> http://www.iam.unibe.ch/pipermail/smallwiki/2007-March/002663.html
> for a somewhat similar problem.

Thanks Stephan.. I'll take a look at it!


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