The Domino agent receives EXTJS post-submitted data through the Request_content domain __js

Source: Internet
Author: User
Tags goto in domain

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.