[gen] BPX bugfixes.
This commit is contained in:
parent
7f88c7cca8
commit
383af4a687
|
@ -36,7 +36,7 @@ class Boolean(Field):
|
|||
onclick=":'toggleCheckbox(%s, %s); updateSlaves(this)' % \
|
||||
(q(name), q('%s_hidden' % name))"/>
|
||||
<input type="hidden" name=":name" id=":'%s_hidden' % name"
|
||||
value=":isChecked and 'True' or 'False')"/>
|
||||
value=":isChecked and 'True' or 'False'"/>
|
||||
</x>''')
|
||||
|
||||
pxSearch = Px('''
|
||||
|
|
|
@ -31,8 +31,8 @@ class Date(Field):
|
|||
<option value="">-</option>
|
||||
<option for="day in days"
|
||||
var2="zDay=str(day).zfill(2)" value=":zDay"
|
||||
selected="field.isSelected(zobj, 'day', day, \
|
||||
rawValue)">:zDay</option>
|
||||
selected=":field.isSelected(zobj, 'day', day, \
|
||||
rawValue)">:zDay</option>
|
||||
</select>
|
||||
|
||||
<!-- Month -->
|
||||
|
@ -41,16 +41,16 @@ class Date(Field):
|
|||
<option value="">-</option>
|
||||
<option for="month in months"
|
||||
var2="zMonth=str(month).zfill(2)" value=":zMonth"
|
||||
selected="field.isSelected(zobj, 'month', month, \
|
||||
rawValue)">:zMonth</option>
|
||||
selected=":field.isSelected(zobj, 'month', month, \
|
||||
rawValue)">:zMonth</option>
|
||||
</select>
|
||||
|
||||
<!-- Year -->
|
||||
<select name=":'%s_year' % name" id=":'%s_year' % name">
|
||||
<option value="">-</option>
|
||||
<option for="year in years" value=":year"
|
||||
selected="field.isSelected(zobj, name, 'year', year, \
|
||||
rawValue)">:year</option>
|
||||
selected=":field.isSelected(zobj, name, 'year', year, \
|
||||
rawValue)">:year</option>
|
||||
</select>
|
||||
|
||||
<!-- The icon for displaying the calendar popup -->
|
||||
|
|
|
@ -246,8 +246,8 @@ class Ref(Field):
|
|||
uids=[o.UID() for o in \
|
||||
field.getLinkedObjects(zobj).objects];
|
||||
isBeingCreated=zobj.isTemporary()"
|
||||
name=":name" size="isMultiple and field.height or ''"
|
||||
multiple="isMultiple and 'multiple' or ''">
|
||||
name=":name" size=":isMultiple and field.height or ''"
|
||||
multiple=":isMultiple">
|
||||
<option value="" if="not isMultiple">:_('choose_a_value')</option>
|
||||
<option for="ztied in zobjects" var2="uid=ztied.o.UID()"
|
||||
selected=":inRequest and (uid in requestValue) or \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"/>
|
||||
|
|
Loading…
Reference in a new issue