form fixes

This commit is contained in:
Peter Schojer
2008-08-28 06:02:11 +00:00
parent cdab287496
commit 716d71c833
10 changed files with 90 additions and 3 deletions

View File

@@ -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));
}
}

View File

@@ -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));
}
}

View File

@@ -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);

View File

@@ -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));
}
}

View File

@@ -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));
}
}