ExtJS sends data to server side by post
var conn = new Ext.data.Connection ();
Conn.request ({
URL: '/test/ajaxdemo.nsf/agentwebimsendmsg?openagent ',
Method: ' POST ',
Params: {
Fromuseraccount:fromusername,
Touseraccount:tousername,
Message:encodeuricomponent (Message)
},
Success:function (Responseobject) {},
Failure:function (Responseobject) {
Ext.Msg.alert (' failure ', responseobject.statustext);
}
});
//domino agents: Receiving and processing data
Sub Initialize
on Error Goto errorhandle
Dim session as New notessession< br> Dim Curdb as notesdatabase
Dim curdoc as notesdocument
&nbs p; Dim tdoc as notesdocument
dim Strformular as String
Dim vdata as As Variant
Dim sqry as String
&nbs P Dim Sfrom as String
Dim sto as String
Dim smsg ; As String
Set Curdb = session. CurrentDatabase
Set curdoc = session.documentcontext
'--using Domino built-in domain Request_ Content to receive post-submitted data
'--Transfer data format: fromuseraccount= John &touseraccount= Dick &message=hello
Strformular= "@URLDecode (' Domino '; Request_content) "
Vdata=evaluate (Strformular,curdoc)
Sqry=vdata (0)
Sfrom=webgetparameter (Sqry, "Fromuseraccount")
Sto=webgetparameter (Sqry, "Touseraccount")
Smsg=webgetparameter (sqry, "message")
'----------Use data information----------------------
... ...
Exit Sub
Errorhandle:
Msgbox "error occurred in the +CSTR (ERL) +" line, the error is: "+error
End Sub
//functions with parameter values
public function Webgetparameter (Byval strsearch$, Byval strvar$) as String
const web_arg_sep = "&"
on Error Goto Errors
Webgetpara meter = ""
Dim tmp$, posvar%, possep%
posvar = Instr (Strsearch, St Rvar & "=")
if posvar = 0 Then Goto theend
posvar = Posvar + Len (strvar) + 1
&nb Sp
&NBSP;POSSEP = Instr (Posvar, Strsearch, web_arg_sep)
if (possep = 0) Then
&NBSP;&NBSP;&NB Sp; webgetparameter = mid$ (Strsearch, Posvar)
else
webgetparameter = mid$ (Strsearch, Posvar, Possep-posvar)
end If
& nbsp
theend:
Exit Function
Errors:
webgetparameter = ""
&nbs P Resume theend
End Function