mirror of
https://github.com/pocoproject/poco.git
synced 2025-05-03 15:58:23 +02:00
fixes to dynamic codegen
This commit is contained in:
parent
a0392bbd64
commit
e12ca44470
@ -66,7 +66,7 @@ public:
|
|||||||
void renderBody(const Renderable* pRenderable, const RenderContext& context, std::ostream& ostr);
|
void renderBody(const Renderable* pRenderable, const RenderContext& context, std::ostream& ostr);
|
||||||
/// Emits code for the page body to the given output stream.
|
/// Emits code for the page body to the given output stream.
|
||||||
|
|
||||||
void renderVariables(const DynamicCodeLoader* pLoader, const RenderContext& context, std::ostream& ostr);
|
static void renderVariables(const DynamicCodeLoader* pLoader, const RenderContext& context, std::ostream& ostr);
|
||||||
// You must first call renderVariables then renderHead
|
// You must first call renderVariables then renderHead
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -119,7 +119,6 @@ void DynamicCodeLoaderRenderer::renderHead(const Renderable* pRenderable, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// write loadAll
|
// write loadAll
|
||||||
str << "function " << pLoader->loadAllFunctionName() << "(){" << std::endl;
|
|
||||||
|
|
||||||
std::vector<const DynamicCodeLoader*>::const_iterator it = deps.begin();
|
std::vector<const DynamicCodeLoader*>::const_iterator it = deps.begin();
|
||||||
str << "function " << pLoader->loadAllFunctionName() << "(){" << std::endl;
|
str << "function " << pLoader->loadAllFunctionName() << "(){" << std::endl;
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "Poco/WebWidgets/ExtJS/PageRenderer.h"
|
#include "Poco/WebWidgets/ExtJS/PageRenderer.h"
|
||||||
#include "Poco/WebWidgets/ExtJS/Utility.h"
|
#include "Poco/WebWidgets/ExtJS/Utility.h"
|
||||||
#include "Poco/WebWidgets/ExtJS/PanelRenderer.h"
|
#include "Poco/WebWidgets/ExtJS/PanelRenderer.h"
|
||||||
|
#include "Poco/WebWidgets/ExtJS/DynamicCodeLoaderRenderer.h"
|
||||||
#include "Poco/WebWidgets/Page.h"
|
#include "Poco/WebWidgets/Page.h"
|
||||||
#include "Poco/WebWidgets/Panel.h"
|
#include "Poco/WebWidgets/Panel.h"
|
||||||
#include "Poco/WebWidgets/RenderContext.h"
|
#include "Poco/WebWidgets/RenderContext.h"
|
||||||
@ -146,13 +147,20 @@ void PageRenderer::renderHead(const Renderable* pRenderable, const RenderContext
|
|||||||
ostr << "oHead.appendChild(oScript);" << std::endl;
|
ostr << "oHead.appendChild(oScript);" << std::endl;
|
||||||
ostr << "}" << std::endl;
|
ostr << "}" << std::endl;
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
std::set<DynamicCodeLoader::Ptr>::const_iterator itDC = dcls.begin();
|
||||||
|
for (; itDC != dcls.end(); ++itDC)
|
||||||
|
{
|
||||||
|
DynamicCodeLoaderRenderer::renderVariables((*itDC), context, ostr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
std::set<DynamicCodeLoader::Ptr>::const_iterator itDC = dcls.begin();
|
std::set<DynamicCodeLoader::Ptr>::const_iterator itDC = dcls.begin();
|
||||||
for (; itDC != dcls.end(); ++itDC)
|
for (; itDC != dcls.end(); ++itDC)
|
||||||
{
|
{
|
||||||
(*itDC)->renderHead(context, ostr);
|
(*itDC)->renderHead(context, ostr);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ostr << "Ext.onReady(function() {";
|
ostr << "Ext.onReady(function() {";
|
||||||
ostr << "var " << VAR_LOCALTMP << ";"; // tmp variable needed for table renderer
|
ostr << "var " << VAR_LOCALTMP << ";"; // tmp variable needed for table renderer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user