Question
· Jun 10, 2017

How to Make a CSP Page With %CSP.Page Class?

Hi!

In the below code for cls with csp i have passed the output to a global but after i give the content in the text box it is getting stored, but when i check the global it is empty.

Class User.zkqr Extends %CSP.Page
{

ClassMethod OnPage() As %Status
{
&html<<html>
<head>
</head>
<script type="text/javascript">
function EmpTable(){
var EmployeeName=document.getElementById("ename").value;
var EmployeeNumber=document.getElementById("enumber").value;
var EmployeeDOB=document.getElementById("edob").value;
var EmployeeDOJ=document.getElementById("edoj").value;
alert(EmployeeName+"^"+EmployeeNumber+"^"+EmployeeDOB+"^"+EmployeeDOJ);
//var st=#server(..cmEmpTable())#;
var st=#(..cmEmpTable(EmployeeName,EmployeeNumber,EmployeeDOB,EmployeeDOJ))#;
alert("status:");
}
</script>
<body>
<table border="1">
<tr>
<th>Employee Name</th>
<th>Employee Number</th>
<th>Employee DOB</th>
<th>Employee DOJ</th>
</tr>
<tr>
<td>Kishan R</td>
<td>kr15064</td>
<td>30/FEB/1994</td>
<td>19/SEP/2017</td>
</tr>
</table>
<br/>
Employee Name:<input type="text" id="ename">
<br/>
<br/>
Employee Number:<input type="text" id="enumber">
<br/>
<br/>
Employee DOB:<input type="date" id="edob">
<br/>
<br/>
Employee DOJ:<input type="date" id="edoj">
<br/>
<br/>
<form action='User.zkqr.cls'>
<button type='button' onclick='EmpTable();'>Submit</button>
<!--button type="button">Save</button-->
</form>

<!--script language='cache' method='cmEmpTable' runat='server'> //<arguments="ename:%String='', enumber:%String='', edob:%String='', edoj:%String=''" returntype="%String">
i ename=""||(enumber="")||(edob="")||(edoj="") q 0
s ^xkqr="test" //ename_"^"_enumber_"^"_edob_"^"_edoj
q "welcome"
q 1
</script-->

</body>


</html>>
Quit $$$OK
}

ClassMethod cmEmpTable(ename As %String, enumber As %String, edob As %String, edoj As %String) As %String
{
ename=""||(enumber="")||(edob="")||(edoj="") 0
^xkqr=ename_"^"_enumber_"^"_edob_"^"_edoj
1
}

}
 

Discussion (4)1
Log in or sign up to continue