views:

136

answers:

2

I'm given a task to develop a couple of applications in ColdFusion that will share some of the data - same data but different presentation.

The first solution that comes in mind is to create a ColdFusion widget that as I understand breaks some MVC rules within ColdBox I am currently using. I need more of a view within another view with its own controller and model (all in CFML, no Ajax). My understanding is that MVC does not support such hierarchy whilst its inherent in HMVC.

Any suggestion on the graceful workaround and/or alternative HMVC framework?

A: 

I am not sure I am understanding your question correctly, but with mvc, you should be able to have two views using the same model. Or, you could split the model out into a different place using webservices or something like that, and then have your model in your two different apps connect to it to retrieve your data. Or am I misunderstanding?

Ryan Guill
+2  A: 

Hi Alex,

You can use ColdBox Viewlets, which basically makes the views self sufficient when rendered. This means that you basically render the widget "renderView("widgets/myWidget")" Then inside of your widget, you will broadcast an event for data retrieval. Basically, calling the view's controller layer.

Then your widget will be ready for use and be bound only to its announced event.

Luis Majano