function update() {
/* Function: update
Creation Date: May 5, 2003
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to apply bound Data
Island changes to the full Data Island. This is
accomplished by matching line numbers in both Data
Islands. Once this has been completed the full Data
Island is sent to the server via XMLHTTP.
Update Date: Programmer: Description:
*/
var objXMLHTTP;
// XMLHTTP request object
var reWork = new RegExp('internet explorer','gi');
document.body.style.cursor = 'wait'; // Set cursor
function setEvents() {
/* Function: setEvents
Creation Date: April 25, 2003
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to create an instance
of the xmlPage object, initialize the object and
perform page initialization.
function update() {
/* Function: update
Creation Date: May 5, 2003
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to apply bound Data
Island changes to the full Data Island. This is
accomplished by matching line numbers in both Data
Islands. Once this has been completed the full Data
Island is sent to the server via XMLHTTP.
Update Date: Programmer: Description:
*/
var objXMLHTTP; // XMLHTTP request object
var reWork = new RegExp('internet explorer','gi');
document.body.style.cursor = 'wait'; // Set cursor
function ieBusTable(objTable) {
/* Function: ieBusTable
Creation Date: April 30, 2003
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to remove the garbage
that Microsoft Internet Explorer displays when a table's
cell contains null. This porblem only applies to div
and span tags.
Update Date: Programmer: Description:
*/
var reWork = new RegExp('internet explorer','gi');
function xmlPage() {
/* Function: xmlPage
Creation Date: April 25, 2003
Programmer: Edmond Woychowsky
Purpose: The purpose of this class is to define the cross-browser
(Mozill & IE) paging object.
Update Date: Programmer: Description:
*/
// Variables
var objCommonAncestor = null; // datafld common ancestor
var objInitialTable = null;
var strBound = null; // XML window data island
var strXML = null; // XML full data island
var strTable = null; // Bound HTML/XHTML table
var intAbsolutePosition = 0; // Window item index
var intPage = 1; // Logical page number
var intLength = 15; // Logical page length
var blnInitialize = false; // Initialize binds
// Properties
this.bound = null; // XML window data island
this.full = null; // XML full data island
this.table = null; // Bound HTML/XHTML table
function m_showPage() {
/* Function: m_showPage
Creation Date: April 25, 2003
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to show the
current page's information. This is accomplished
by cloning the applicable nodes from the "full"
Data Island to the "bound" Data Island.
Update Date: Programmer: Description:
May 13, 2003 Edmond Woychowsky Modified to invoke m_recordCount()
to compute current record count.
*/
var objRoot = document.createElement('root');
var objXML = null; // XML DOM for IE
function m_showFirst() {
/* Function: m_showFirst
Creation Date: April 25, 2003
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to show the
first logical page.
Update Date: Programmer: Description:
*/
intAbsolutePosition = 0; // Set absolute position
m_showPage(); // Show page
}
function m_showLast() {
/* Function: m_showLast
Creation Date: April 25, 2003
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to show the
last logical page.
function m_showNext() {
/* Function: m_showNext
Creation Date: April 25, 2003
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to show the
next logical page.
Update Date: Programmer: Description:
*/
if(m_page() < m_pageCount())
intAbsolutePosition += intLength; // Set absolute position
m_showPage(); // Show page
}
function m_showPrevious() {
/* Function: m_showPrevious
Creation Date: April 25, 2003
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to show the
previous logical page.
Update Date: Programmer: Description:
*/
if(m_page() > 1)
intAbsolutePosition -= intLength; // Set absolute position
m_showPage(); // Show page
}
function m_length() {
/* Function: m_length
Creation Date: April 25, 2003
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to set or get
the logical page length.
function m_page() {
/* Function: m_page
Creation Date: April 25, 2003
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to compute the
current logical page number.
function m_recordCount() {
/* Function: m_recordCount
Creation Date: April 25, 2003
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to compute the
return the total number of "records" in the
"full" XML Data Island.
Update Date: Programmer: Description:
May 13, 2003 Edmond Woychowsky Modified to recompute due
to possible deletes.
*/
function m_pageCount() {
/* Function: m_pageCount
Creation Date: April 25, 2003
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to compute the
return the total number of logical pages.
Update Date: Programmer: Description:
May 13, 2003 Edmond Woychowsky Modified to invoke m_recordCount()
to compute current record count.
*/
function initialize(objBound,objXML,objTable) {
/* Function: initialize
Creation Date: April 25, 2003
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to perform the
necessary housekeeping before paging can occur.
Update Date: Programmer: Description:
*/
var objNodeName = new collection();
var arrNodeName;
switch(true) {
case((objBound == null) && (objXML == null) && (objTable == null)):
alert('Error: bound, xml and table not set.');
break;
case((objBound == null) && (objXML == null)):
alert('Error: bound and xml not set.');
break;
case((objBound == null) && (objTable == null)):
alert('Error: bound and table not set.');
break;
case((objXML == null) && (objTable == null)):
alert('Error: xml and table not set.');
break;
case(objBound == null):
alert('Error: bound not set.');
break;
case(objXML == null):
alert('Error: xml not set.');
break;
case(objTable == null):
alert('Error: table not set.');
// Store initial table
objInitialTable = objTable.cloneNode(true);
break;
}
}
}
function MozillaDSO() {
/* Function: MozillaDSO
Creation Date: April 16, 2003
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to perform binding of
XML Data Islands for Mozilla. The logic herein is bypassed
for Microsoft Internet Explorer.
Update Date: Programmer: Description:
*/
// Global variables
objXMLDI = new collection(); // XML data island collection
objBound = new collection(); // Bound XHTML object collection
// Local variables
var objDatafld; // Table datafld collection
var objRow; // Table row
var reWork = new RegExp('internet explorer','gi');
var arrKeys = new Array();
var intKey = 0; // objBound collection key
var intRows; // Row count
break;
default:
alert('Error: Unsupported HTML Element - ' + objBound.item(arrKeys).nodeName.toLowerCase());
break;
}
}
function boundXML() {
var datasrc = null; // Data source (string)
var datafld = null; // Data field (string)
var node = null; // XHTML node (object)
var nodeName = null; // Node name (string)
}
}
function collection() {
/* Function: collection
Creation Date: August 16, 2002
Programmer: Edmond Woychowsky
Purpose: The purpose of this class is to define the collection
object associative array.
Update Date: Programmer: Description:
*/
// Properties
this.objcollection = new Object; // Associative array
this.count = 0; // Total numbers of items
function colAdd(strKey,strItem) {
/* Function: colAdd
Creation Date: August 16, 2002
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to add an item to
the collection object.
function colExists(strKey) {
/* Function: colExists
Creation Date: August 16, 2002
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to return a boolean
indicating where or not a key exists in the
collection object.
function colItem(strKey,strItem) {
/* Function: colItem
Creation Date: August 16, 2002
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to either set or get
an item to or from the collection object.
function colRemoveAll() {
/* Function: colRemoveAll
Creation Date: August 16, 2002
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to remove all keys
and items from the collection object and set the
item count to zero.
Update Date: Programmer: Description:
*/
this.objcollection = new Object;
this.count = 0;
}
function colRemove(strKey) {
/* Function: colRemove
Creation Date: August 16, 2002
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to remove a single
item and it's associated key from the collection
object and decrement the count by one.
function colKeys() {
/* Function: colKeys
Creation Date: August 16, 2002
Programmer: Edmond Woychowsky
Purpose: The purpose of this function is to return an array
consisting of the collection object's keys.
Update Date: Programmer: Description:
*/
var arrWork = new Array();
var strKey;
for(strKey in this.objcollection)
if(this.objcollection[strKey] != 'undefined')
arrWork.push(strKey);