I generally won't put any view/html type code inside a cfc if I can help it.
There are several different frameworks that make the understanding of this relationship easier. Personally I prefer Fusebox. There are also Model-Glue and Machii. To make this basic though you would call the method of your data retrieval as part of your controller, then use the return (a query I assume?) to populate your view. > -----Original Message----- > From: Morten Kruse [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 10, 2007 1:57 AM > To: CF-Talk > Subject: Splitting UI and Data > > Iââ¬â¢m about to construct a new Coldfusion application and I want do use > an object orientated approach. > But I donââ¬â¢t know how I should do this. > > I have read the article written by David Friedel. Building an object > oriented user interface with Coldfusion MX > http://www.adobe.com/devnet/coldfusion/articles/oo_interface.html > He tells about the principles but not the actual development > > I have created a cfc library containing data retrievers. These cfcââ¬â¢s > should provide my UI with the necessary data. > > Now Iââ¬â¢m about to construct the User interface (UI) but I donââ¬â¢t > know > how I should combine the user interface with the data. > > I plan to split the UI in small function (Widget) just like in the > article. Maybe I will have a grid showing some employees The UI part I > would then insert into either a cfm or cfc. > > If I put it into a cfm and use CFINCLUDE to use it I canââ¬â¢t pass the > data query to it. > But then if I put into a cfc and use CFINVOKE I can pass the data to > it. But then the cfc will fail because it uses the CFGRID and I donââ¬â¢t > intent to insert a CFFORM into each cfc. > > > How do you do this? > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create robust enterprise, web RIAs. Upgrade to ColdFusion 8 and integrate with Adobe Flex http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290716 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4