mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-24 17:30:44 +02:00
onsuccess suport for form loading
This commit is contained in:
@@ -112,9 +112,17 @@ Poco::WebWidgets::JSDelegate FormRenderer::createReloadFunction(const std::strin
|
|||||||
out << "theForm.load({" << std::endl;
|
out << "theForm.load({" << std::endl;
|
||||||
out << "url:uri,method:'GET'" << std::endl;
|
out << "url:uri,method:'GET'" << std::endl;
|
||||||
if (!onSuccess.empty())
|
if (!onSuccess.empty())
|
||||||
out << ",success: " << onSuccess << std::endl;
|
{
|
||||||
|
out << ",success: function(form, action){" << std::endl;
|
||||||
|
out << "form.addListener('actioncomplete', " << onSuccess << ");" << std::endl;
|
||||||
|
out << "}" << std::endl;
|
||||||
|
}
|
||||||
if (!onFailure.empty())
|
if (!onFailure.empty())
|
||||||
out << ",failure: " << onFailure << std::endl;
|
{
|
||||||
|
out << ",failure: function(form, action){" << std::endl;
|
||||||
|
out << "form.addListener('actionfailed', " << onFailure << ");" << std::endl;
|
||||||
|
out << "}" << std::endl;
|
||||||
|
}
|
||||||
out << "});" << std::endl; // success, failure handlers
|
out << "});" << std::endl; // success, failure handlers
|
||||||
out << "}" << std::endl;
|
out << "}" << std::endl;
|
||||||
return jsDelegate(out.str());
|
return jsDelegate(out.str());
|
||||||
|
|||||||
Reference in New Issue
Block a user