[gen] BPX bugfixes.

This commit is contained in:
Gaetan Delannay 2013-09-11 22:11:44 +02:00
parent 7f88c7cca8
commit 383af4a687
5 changed files with 22 additions and 19 deletions

View file

@ -483,6 +483,18 @@ function generatePodDocument(contextUid, fieldName, podFormat, queryData,
}
theForm.submit();
}
function protectAppyForm() {
window.onbeforeunload = function(e){
theForm = document.getElementById("appyForm");
if (theForm.button.value == "") {
var e = e || window.event;
if (e) {e.returnValue = warn_leave_form;}
return warn_leave_form;
}
}
}
// Functions for opening and closing a popup
function openPopup(popupId, msg) {
// Put the message into the popup

View file

@ -562,16 +562,7 @@ class AbstractWrapper(object):
groupedFields=zobj.getGroupedFields(layoutType,page, cssJs=cssJs)">
<x>:tool.pxPagePrologue</x>
<!-- Warn the user that the form should be left via buttons -->
<script type="text/javascript"><![CDATA[
window.onbeforeunload = function(e){
theForm = document.getElementById('appyForm');
if (theForm.button.value == "") {
var e = e || window.event;
if (e) {e.returnValue = warn_leave_form;}
return warn_leave_form;
}
}]]>
</script>
<script type="text/javascript">protectAppyForm()</script>
<form id="appyForm" name="appyForm" method="post"
enctype="multipart/form-data" action=":zobj.absolute_url()+'/do'">
<input type="hidden" name="action" value="Update"/>