Chris,

Here's the code, I've stripped out some irrelevant bits.

*In the the controller I call UIRender(), and set the results in the event.*
*Controller: Security.cfc*

public void function generateUI(event){

local.renderedResult = UIRender();

arguments.event.setValue("RenderResults", local.renderedResult);

}
*
*

private string function UIRender(){

 return beans.UIService.getUIRender();

 }

*In this service, I call the render function on the library. It outputs 
HTML directly within the function, so I capture that using saveContent, and 
return it.*

*Service: UIService.cfc*

public string function getUIRender(){

 saveContent variable="local.renderedContent"{

// this.getUI() returns the library that renders the HTML. The library is 
injected into UIService via ColdSpring.

 writeOutput(this.getUI().render());

 };

 return local.renderedContent;

}

*Here is the library function that just outputs HTML. I can't change this 
function.*
*Library component: UI.cfc*

<cffunction name="render" output="yes">

Please sign in with your username, email address, or client number.

<div class="ui_diag" id="SignIn">

<form method="post" action="#createGetVariables(FormAction)#">

<legend>Sign In</legend>

<input name="username" type="text" id="username" value=""></input>

<input name="password" type="password" id="clear_pw" value=""></input>

<button type="submit" name="action" value="submit-signin"">Sign In</button>

</cffunction>

*And here is the view that outputs the rendered results stored in the event:
*
*View: Form.UI.cfc*
*
*
<cfset event.copyToScope(variables, "RenderResults") />
<cfif compare(variables.RenderResults,"")>
<cfoutput>
#variables.RenderResults#
</cfoutput>
</cfif>

Running this with ModelGlue reload set to true works flawlessly. When it is 
set to false for testing and production, the library service call to 
getUI.render() returns an empty string. If I call it with init=true, it 
will work.

I'm currently working around the problem by dropping the entire render 
method in an event and invoking it within my view. When I invoke it there 
(instead of within the controller) it works.

Does setting MG reload = false enable any whitespace management? Something 
about that setting seems to prevent direct HTML output within a CFC 
(probably not the best practice anyway, but that's the library I'm stuck 
with).

Any ideas?

-Joe

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

Reply via email to