4-Aug-03 (Created: 4-Aug-03) | More in 'CS-JavaScript'

Example java script 1

*********************************************************************************
* HTML page start
*********************************************************************************
-->
<html>

<head>
<title>Welcome to Aspire</title>
<link rel="stylesheet" type="text/css" href="/akc/style/style.css">
<script src="/akc/js/genericedits1.js"></script>

<!--
*********************************************************************************
* Java script functions
*********************************************************************************
-->
<script>
function search()
{

	fieldValues=getFieldValues(document.mainform,"EntityTypeListBox,NameTextField,DunsTextField");

	additionalWhereClause = getFieldValuesAsAWhereClause(document.mainform
			,"EntityTypeListBox,NameTextField"
			,"le.type_id,le.name"
			,"int,string"
			,"None");
			
	awc = " and " + additionalWhereClause;
	
	url = "/akc/servlet/DisplayServlet?url=dbLocationsURL"
		 + "&whereclause=" + escape(awc)
		 + "&fieldValues=" + escape(fieldValues)
		 
//	alert(fieldValues);
//	alert(url);
	document.location = url;	
}

function onloadFunction()
{
	var fieldValues = "<%=pageData.getValue("fieldValues")%>";
	if (fieldValues  != "")
	{
//		alert(fieldValues);
		setFieldValues(document.mainform,fieldValues);
	}
}

function gotoReport(reportId)
{
	url = eval("document.folderform.report" + reportId + ".value");
	relativeUrl = getRelativeURL(url);
	relativeUrl += "&reportId=" + reportId
	document.location=relativeUrl;
}

function gotoUpdateReport(rownum)
{
	url = eval("document.folderform.updateReport" + rownum + ".value");
	relativeUrl = getRelativeURL(url);
	document.location=relativeUrl;
}
function deleteReport(reportId, contentId)
{
	openFolderName = "<%=pageData.getValue("openFolderName")%>";
	
	finalUrl="";
	
	if (contentId == "")
	{
		finalUrl="/akc/servlet/UpdateServlet?request_name=DeleteReport"
				+ "&reportId=" + reportId 
				+ "&contentId=" + contentId
				+ "&openFolderName=" + escape(openFolderName);
	}
	else
	{
		finalUrl="/akc/servlet/UpdateServlet?request_name=DeleteReportWithContent"
				+ "&reportId=" + reportId 
				+ "&contentId=" + contentId
				+ "&openFolderName=" + escape(openFolderName);
	}
//	alert(finalUrl);			
	document.location=finalUrl;
		
}
function createFolder()
{
	folderName = document.folderform.NewFolderTextField.value;
	if (folderName == "")
	{
		alert("Folder name is required to create a new folder");
		return;
	}
	
	url = "/akc/servlet/UpdateServlet?request_name=CreateFolder&folderName=" +escape(folderName);
	document.location=url;
//	alert(folderName);
}

function moveToFolder()
{
	//get a list of reports
	// if the reports are null error and out
	reports = getSelectedCheckBoxValues(document.folderform,"ReportCheckBox",",")
	selFolderId = getValueString(document.folderform.FolderListBox);

	url="/akc/servlet/UpdateServlet?request_name=MoveReports";
	url += "&folderId=" + selFolderId;
	url += "&reportIds=" + reports;

//	alert(url);
	document.location = url;
}

function setFolderAccess(folderId,access)
{
	openFolderName = "<%=pageData.getValue("openFolderName")%>";
	finalUrl="/akc/servlet/UpdateServlet?request_name=SetFolderAccess"
				+ "&folderId=" + folderId
				+ "&access=" + access
				+ "&openFolderName=" + escape(openFolderName);
//	alert(finalUrl);			
	document.location=finalUrl;	
}
</script>
</head>


<!--
*********************************************************************************
* Body start
*********************************************************************************
-->
<body > </body></html>