Hi,
I created two applications. One is using the Form and the other is using the Calendar for the same table. I noticed when I try
to save a record from the Calendar Application it refreshes the Calender page but does not actually save the record. And I also created tasks from the Form application but they are not showing up on the calendar.
Debugging the the page in Firebug for Firefox shows the following error:
ReferenceError: $ is not defined
var $oElem = $(document.getElementById(sElem)),
And here is the response from one of the ajax requests
<DIV id="id_error_display_fixed" style="position: absolute"><TABLE class="scFormErrorTable" align="center">
<TR>
<td style="padding: 0px" rowspan="2"><img src="/scriptcase/app/myTasks/_lib/img/scriptcase__NM__icnMensagemAlerta.png" style="border-width: 0px" align="top"></td>
<TD class="scFormErrorTitle" align="left">
<table style="border-collapse: collapse; border-width: 0px; width: 100%">
<tr>
<td class="scFormErrorTitleFont" style="padding: 0px; width: 100%">
Error </td>
<td><a title="Close" style="vertical-align: middle; display:inline-block;" onClick="document.getElementById('id_error_display_fixed').style.display = 'none'; document.getElementById('id_error_message_fixed').innerHTML = ''; return false; return false;"><img src="/scriptcase/app/myTasks/_lib/img/scriptcase__NM__nm_ScriptCase6_BlueSoft_berrm_clse.gif" style="border-width: 0; cursor: pointer" /></a>
</td> </tr>
</table>
</TD>
</TR>
<TR>
<TD class="scFormErrorMessage" align="center"><span id="id_error_message_fixed"></span></TD>
</TR>
</TABLE></DIV>
<script type="text/javascript">
function scCenterFixedElement(sElem)
{
if (!document.getElementById(sElem))
{
return;
}
var $oElem = $(document.getElementById(sElem)),
$oWindow = $(this),
iElemTop = Math.round(($oWindow.height() - $oElem.height()) / 2),
iElemLeft = Math.round(($oWindow.width() - $oElem.width()) / 2);
$oElem.offset({top: iElemTop, left: iElemLeft});
}
var iFixedErrorSqlId = 1;
function scAjaxFixedErrorSql(sErrorMsg)
{
var iTmpPos = sErrorMsg.indexOf("{SC_DB_ERROR_INI}"),
sTmpId;
while (-1 < iTmpPos)
{
sTmpId = "sc_id_fixed_error_sql_" + iFixedErrorSqlId;
sErrorMsg = sErrorMsg.substr(0, iTmpPos) + "<br /><span style=\"text-decoration: underline\" onClick=\"$('#" + sTmpId + "').show(); scCenterElement(document.getElementById('" + sTmpId + "'))\">" + sErrorMsg.substr(iTmpPos + 17);
iTmpPos = sErrorMsg.indexOf("{SC_DB_ERROR_MID}");
sErrorMsg = sErrorMsg.substr(0, iTmpPos) + "</span><table class=\"scFormErrorTable\" id=\"" + sTmpId + "\" style=\"display: none; position: absolute\"><tr><td>" + sErrorMsg.substr(iTmpPos + 17);
iTmpPos = sErrorMsg.indexOf("{SC_DB_ERROR_CLS}");
sErrorMsg = sErrorMsg.substr(0, iTmpPos) + "<br /><br /><span onClick=\"$('#" + sTmpId + "').hide()\">" + sErrorMsg.substr(iTmpPos + 17);
iTmpPos = sErrorMsg.indexOf("{SC_DB_ERROR_END}");
sErrorMsg = sErrorMsg.substr(0, iTmpPos) + "</span></td></tr></table>" + sErrorMsg.substr(iTmpPos + 17);
iTmpPos = sErrorMsg.indexOf("{SC_DB_ERROR_INI}");
iFixedErrorSqlId++;
}
return sErrorMsg;
}
document.getElementById("id_error_message_fixed").innerHTML += scAjaxFixedErrorSql("Error inserting:<BR>Unknown column 'N' in 'field list'<BR>{SC_DB_ERROR_INI}View SQL{SC_DB_ERROR_MID}INSERT INTO tasks (folder_id, task_type_id, priority_id, importance_type_id, title, contents, progress, start_date, end_date, due_date, start_time, end_time, recurrence, period) VALUES (1, 2, 1, 1, '1111', '<p>1111</p>', 0, '2013-07-02', '2013-07-02', null, null, null, N, 'D'){SC_DB_ERROR_CLS}Close{SC_DB_ERROR_END}");
scCenterFixedElement("id_error_display_fixed");
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<script type="text/javascript" src="/scriptcase/prod/third/jquery/js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
self.parent.calendar_reload();
self.parent.tb_remove();
});
</script>
</head>
<body>
</body>
</html>
Let me know if you need more information.