mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-16 18:56:52 +02:00
form fixes
This commit is contained in:
@@ -118,6 +118,10 @@ void ComboBoxCellRenderer::renderHead(const Renderable* pRenderable, const Rende
|
||||
ostr << "})";
|
||||
pCell->beforeLoad += Poco::delegate(&ComboBoxCellRenderer::onLoad);
|
||||
WebApplication::instance().registerAjaxProcessor(Poco::NumberFormatter::format(pOwner->id()), pCell);
|
||||
if (!pOwner->getName().empty())
|
||||
{
|
||||
WebApplication::instance().registerFormProcessor(pOwner->getName(), const_cast<ComboBoxCell*>(pCell));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -39,6 +39,7 @@
|
||||
#include "Poco/WebWidgets/ExtJS/FormRenderer.h"
|
||||
#include "Poco/WebWidgets/ExtJS/Utility.h"
|
||||
#include "Poco/WebWidgets/DateFieldCell.h"
|
||||
#include "Poco/WebWidgets/WebApplication.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
@@ -67,6 +68,10 @@ void DateFieldCellRenderer::renderHead(const Renderable* pRenderable, const Rend
|
||||
DateFieldCellRenderer::writeCellProperties(pCell, ostr);
|
||||
|
||||
ostr << "})";
|
||||
if (pCell->getOwner() && !pCell->getOwner()->getName().empty())
|
||||
{
|
||||
WebApplication::instance().registerFormProcessor(pCell->getOwner()->getName(), const_cast<DateFieldCell*>(pCell));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -67,13 +67,14 @@ void FormRenderer::renderHead(const Renderable* pRenderable, const RenderContext
|
||||
if (pForm->getMethod() == Form::METHOD_POST)
|
||||
ostr << "method:'POST',";
|
||||
ostr << "title:'" << pForm->getName() << "',autoHeight:true,autoWidth:true,url:'" << pForm->getURI().toString() << "',frame:true,items:[";
|
||||
//we need to add a hidden entry that contains the Form::FORM_ID plus its id
|
||||
ostr << "new Ext.form.Hidden({name:'" << Form::FORM_ID << "', value:" << pForm->id() << "})";
|
||||
|
||||
ContainerView::ConstIterator it = pForm->begin();
|
||||
ContainerView::ConstIterator itEnd = pForm->end();
|
||||
for (; it != itEnd; ++it)
|
||||
{
|
||||
if (it != pForm->begin())
|
||||
ostr << ",";
|
||||
ostr << ",";
|
||||
// it points to a view pointer
|
||||
(*it)->renderHead(context, ostr);
|
||||
|
||||
|
@@ -39,6 +39,7 @@
|
||||
#include "Poco/WebWidgets/ExtJS/FormRenderer.h"
|
||||
#include "Poco/WebWidgets/ExtJS/Utility.h"
|
||||
#include "Poco/WebWidgets/NumberFieldCell.h"
|
||||
#include "Poco/WebWidgets/WebApplication.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
@@ -67,6 +68,10 @@ void NumberFieldCellRenderer::renderHead(const Renderable* pRenderable, const Re
|
||||
|
||||
TextFieldCellRenderer::writeCellProperties(pCell, ostr);
|
||||
ostr << "})";
|
||||
if (pCell->getOwner() && !pCell->getOwner()->getName().empty())
|
||||
{
|
||||
WebApplication::instance().registerFormProcessor(pCell->getOwner()->getName(), const_cast<NumberFieldCell*>(pCell));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -39,6 +39,7 @@
|
||||
#include "Poco/WebWidgets/ExtJS/FormRenderer.h"
|
||||
#include "Poco/WebWidgets/ExtJS/Utility.h"
|
||||
#include "Poco/WebWidgets/PasswordFieldCell.h"
|
||||
#include "Poco/WebWidgets/WebApplication.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
@@ -67,6 +68,10 @@ void PasswordFieldCellRenderer::renderHead(const Renderable* pRenderable, const
|
||||
|
||||
TextFieldCellRenderer::writeCellProperties(pCell, ostr);
|
||||
ostr << "})";
|
||||
if (pCell->getOwner() && !pCell->getOwner()->getName().empty())
|
||||
{
|
||||
WebApplication::instance().registerFormProcessor(pCell->getOwner()->getName(), const_cast<PasswordFieldCell*>(pCell));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user