Hello all, I am creating a “leave feedback” Bootstrap modal from a link in header.cfm view like this:
`
`In my main layout (which calls header.cfm) I have the basic bootstrap modal stuff at the bottom:
`
In views/modals/feedback I have a form to collect feedback data. In this form, I wish to populate a “feedback type” select from a query. When I call the model code in the view itself, it works fine:
<cfset feedbackTypes = getinstance('feedback').getFeedbackTypes()>
The query runs and the select populates, no problems. However, when I try to do that via my handler, the modal does not get created. Or rather, layout goes to create the modal, but the content view itself is not rendered. Here is the handler:
`
component{
property name=“feedbackService” inject=“feedback”;
function index( event, rc, prc ){
prc.feedbackTypes = feedbackService.getFeedbackTypes();
event.setView(name=“modals/feedback”,layout=“Modal”);
}
}
`
Likewise, this also causes the modal view to not render:
component{ function index( event, rc, prc ){ var prc.feedbackTypes = getinstance('feedback').getFeedbackTypes(); event.setView(name="modals/feedback",layout="Modal"); } }
It seems as if the only way the modal view can use methods in the feedback model is if the view itself calls them directly. What am I doing wrong?
Many thanks in advance!
Oh btw, calling the modal using href="/feedback" works. But using href="#event.buildLink(‘feedback’)#" does not – the modal content does not load. Don’t know if that is any help or not.``