betasec
02-18-2011, 11:06 AM
Hi ,
i develop some pages with LS and i need to create on the same page many tables with data , i use servlet to print my table the tab OverwriteTable and pushPage
as here everything is ok, only if i use formatValues function inside the servlet on the same <Script> </Script> tags
when i put the formatValues on a separate <Script> </Script> tags then its not working
i need to print my tables from servlet and use format functions from js
so to use the same format.js for all pages
SOME EXAMPLE
****************************************************************************
THIS WORKING
<Script Language="JavaScript">
//////////////// Stock Table Management
// create an OverwriteTable; item and field names will be grabbed from
// the corresponding HTML divs
var table = new OverwriteTable(null, null, "MERGE");
table.setDataAdapter("My_Adapter");
table.setSnapshotRequired(true);
table.onChangingValues = formatValues;
// bind the table to the corresponding HTML divs
pushPage.addTable(table, tableID);
function formatValues(itemPos, visualUpdateInfo, itemName) {
if (visualUpdateInfo != null) {
var cold = (itemPos % 2 == 1) ? "#eeeeee" : "#ddddee";
visualUpdateInfo.setRowAttribute("yellow", cold, "backgroundColor");
}
}
</script>
*********************************************
THIS NOT WORKING
<Script Language="JavaScript">
//////////////// Stock Table Management
// create an OverwriteTable; item and field names will be grabbed from
// the corresponding HTML divs
var table = new OverwriteTable(null, null, "MERGE");
table.setDataAdapter("My_Adapter");
table.setSnapshotRequired(true);
table.onChangingValues = formatValues;
// bind the table to the corresponding HTML divs
pushPage.addTable(table, tableID);
</script>
SOME CODE HERE
<Script Language="JavaScript">
function formatValues(itemPos, visualUpdateInfo, itemName) {
if (visualUpdateInfo != null) {
var cold = (itemPos % 2 == 1) ? "#eeeeee" : "#ddddee";
visualUpdateInfo.setRowAttribute("yellow", cold, "backgroundColor");
}
}
</script>
THANKS
i develop some pages with LS and i need to create on the same page many tables with data , i use servlet to print my table the tab OverwriteTable and pushPage
as here everything is ok, only if i use formatValues function inside the servlet on the same <Script> </Script> tags
when i put the formatValues on a separate <Script> </Script> tags then its not working
i need to print my tables from servlet and use format functions from js
so to use the same format.js for all pages
SOME EXAMPLE
****************************************************************************
THIS WORKING
<Script Language="JavaScript">
//////////////// Stock Table Management
// create an OverwriteTable; item and field names will be grabbed from
// the corresponding HTML divs
var table = new OverwriteTable(null, null, "MERGE");
table.setDataAdapter("My_Adapter");
table.setSnapshotRequired(true);
table.onChangingValues = formatValues;
// bind the table to the corresponding HTML divs
pushPage.addTable(table, tableID);
function formatValues(itemPos, visualUpdateInfo, itemName) {
if (visualUpdateInfo != null) {
var cold = (itemPos % 2 == 1) ? "#eeeeee" : "#ddddee";
visualUpdateInfo.setRowAttribute("yellow", cold, "backgroundColor");
}
}
</script>
*********************************************
THIS NOT WORKING
<Script Language="JavaScript">
//////////////// Stock Table Management
// create an OverwriteTable; item and field names will be grabbed from
// the corresponding HTML divs
var table = new OverwriteTable(null, null, "MERGE");
table.setDataAdapter("My_Adapter");
table.setSnapshotRequired(true);
table.onChangingValues = formatValues;
// bind the table to the corresponding HTML divs
pushPage.addTable(table, tableID);
</script>
SOME CODE HERE
<Script Language="JavaScript">
function formatValues(itemPos, visualUpdateInfo, itemName) {
if (visualUpdateInfo != null) {
var cold = (itemPos % 2 == 1) ? "#eeeeee" : "#ddddee";
visualUpdateInfo.setRowAttribute("yellow", cold, "backgroundColor");
}
}
</script>
THANKS