Hey Guys,
My real world example is that I am building a very dynamic application
and need to loop through objects to build forms. So there are
currently multiple problems.
1. A form in wheels expects to interact with an object. So if I have a
query returned to me and would like loop through that query to create
form fields, the framework breaks because it is expecting to find an
object to interact with.
2. My models store information in themselves that is specific to the
model. The example is that I have an object "Layout" and it has a file
associated with it. I keep a variable in the Model for the file path
to all layout files as they are associated with an account and
accounts have different storage paths. I can correct this in some
instances and save the file path in the column, but this is not best
practice as paths are hard coded into saved records.
James
On Jul 11, 11:06 am, Chris Peters <
ch...@clearcrystalmedia.com> wrote:
> Either that or rename
arguments.name to something else, like
> arguments.partial?
>
> Oh yeah, the Partials chapter is posted live. Holding back on the blog
> announcement until I update the rest of the chapters.
http://www.cfwheels.org/docs/chapter/partials
>
> On Sat, Jul 11, 2009 at 5:54 AM, Per Djurner <
per.djur...@gmail.com> wrote:
> > On 2nd thought,
arguments.name (as an object property) would clash with
> > the name argument used to decide what file to include. Maybe it would be
> > better if the object properties and/or record values were made available in
> > arguments.properties (as a struct)?
>
> > On Sat, Jul 11, 2009 at 9:43 AM, Per Djurner <
per.djur...@gmail.com>wrote:
>
> >> Actually, you should be able to use the same partial for both queries and
> >> objects.All object properties / record values are passed in as arguments
> >> On Sat, Jul 11, 2009 at 9:22 AM, Russ Johnson <
russ.cfco...@gmail.com>wrote:
>
> >>> I think what James is getting at is this...
> >>> If I have a partial that displays a single user record, I have to
> >>> reference all of the users attributes like
user.name, user.email...
>
> >>> Well, if I do a findAll() on my users, we cant include that partial and
> >>> pass the query to it do display each user because of the way your reference
> >>> your variables for the object vs. a query... so I would have to create 2
> >>> identical partials, one for rendering a single object and one for rendering
> >>> a single record from a query.
>
> >>> Does that make sense? This may or may not be what James is alluding to,
> >>> just my interpretation...
>
> >>> - Russ
>
> >>> On Jul 11, 2009, at 3:17 AM, Per Djurner wrote:
>
> >>> James, can you give me a real-world code example of where you are feeling
> >>> this pain?Would make it easier for me to think of alternatives.
> >>> Thanks.
>
> >>> On Sat, Jul 11, 2009 at 5:54 AM, Chris Peters <
> >>>
ch...@clearcrystalmedia.com> wrote:
>
> >>>> The problem that everyone is describing is that even having an array of
> >>>> objects to begin with is where the performance issues are.
>
> >>>> It looks like the Hibernate support in CF9/Railo could *potentially*
> >>>> solve this problem. (I think I heard that Railo will be working on adding
> >>>> Hibernate to their engine too.) Read Ben Forta's recent blog entry about CF9
> >>>> ORM. Apparently it returns an array of objects, and one would think that
> >>>> this would be at good performance...
>
> >>>>
http://forta.com/blog/index.cfm/2009/7/7/ORM-Rethinking-ColdFusion-Da...