PDA

View Full Version : Passing tAjaxRequestSet as a parameter to VDF function.



Hitesh
30-Oct-2007, 05:58 AM
Hello All,

I am working on the VDF 12.0 and Ajax Library 1.0.
I have created one ajax webobject as, 'oPayee' and in that I have written
one function as,
"DoFindPayee".

For this I have written one code, which I have attached with this mail.
In that code, on click of search button, I am calling one javascript
function as, ' validateAddress() ' In that function I am generating a
tAjaxRequestSet as sXML .

Then using following code I am calling a function "DoFindPayee" which is in
oPayee ajax webobject,

oRequest = new comm.XmlRequest(false, "DoFindPayee", sXML, null, null,
"<%=vdfWEbServiceUrl%>");
oRequest.request();

But it is giving me an error as, "No such a method: 'DoFindPayee'."

Can anyone tell me where I am going wrong ?

--
Warm Regards,
Hitesh N.Kulkarni.
Epura India.
Itrix Inc.

Anders Ohrt
30-Oct-2007, 12:22 PM
> I am working on the VDF 12.0 and Ajax Library 1.0.
> I have created one ajax webobject as, 'oPayee' and in that I have written
> one function as,
> "DoFindPayee".
>
> For this I have written one code, which I have attached with this mail.
> In that code, on click of search button, I am calling one javascript
> function as, ' validateAddress() ' In that function I am generating a
> tAjaxRequestSet as sXML .
>
> Then using following code I am calling a function "DoFindPayee" which is
> in oPayee ajax webobject,
>
> oRequest = new comm.XmlRequest(false, "DoFindPayee", sXML, null, null,
> "<%=vdfWEbServiceUrl%>");
> oRequest.request();
>
> But it is giving me an error as, "No such a method: 'DoFindPayee'."
>
> Can anyone tell me where I am going wrong ?

Outlook won't let me see your code, so I don't know the specific problem,
but it sounds like you are doing too. You don't need to create a
TAjaxRequestSet, if you publish DoFindPayee and it has normal parameters you
can call it using VdfRemoteMethodInvocation like this:

oRMI = new VdfRemoteMethodInvocation(true, "oSessionManager",
"get_UserLogin", null, HandleLogin);
oRMI.addParameter(browser.cookie.get("vdfSessionKey"));
oRMI.addParameter(document.getElementById("LoginId").value);
oRMI.addParameter(document.getElementById("Password").value);
oRMI.sendCall();

This is asynchronous (callback is HandleLogin), but you can do it
synchronous too.

// Anders

Bob Worsley
30-Oct-2007, 02:56 PM
I think you said you are using library 1.0. That one is case sensitive with
the remote function calls, so make sure everything agrees.
Bob

"Hitesh" <hitesh@itrixinc.com> wrote in message
news:fn9mCPuGIHA.752@dacmail.dataaccess.com...
> Hello All,
>
> I am working on the VDF 12.0 and Ajax Library 1.0.
> I have created one ajax webobject as, 'oPayee' and in that I have written
> one function as,
> "DoFindPayee".
>
> For this I have written one code, which I have attached with this mail.
> In that code, on click of search button, I am calling one javascript
> function as, ' validateAddress() ' In that function I am generating a
> tAjaxRequestSet as sXML .
>
> Then using following code I am calling a function "DoFindPayee" which is
in
> oPayee ajax webobject,
>
> oRequest = new comm.XmlRequest(false, "DoFindPayee", sXML, null, null,
> "<%=vdfWEbServiceUrl%>");
> oRequest.request();
>
> But it is giving me an error as, "No such a method: 'DoFindPayee'."
>
> Can anyone tell me where I am going wrong ?
>
> --
> Warm Regards,
> Hitesh N.Kulkarni.
> Epura India.
> Itrix Inc.
>
>
>
>

Hitesh
31-Oct-2007, 01:05 AM
Hi Anders,

First, thanks for help :)
But actually I want to pass TAjaxRequestSet structure as a parameter, and
yes using RMI we can do that but I want to use(try) with structure.

Here I am sending my code which was in Oxygen_Search1.asp.

<%
' Revision notes:
' Currently the names of tables and columns used on the html side
' are case sensitive. Best is to use only lowercase names.

Dim vdfMainTable, vdfWebServiceURL, oWbo, Err

' Let this variable point to the actual Web Business Object you are
using.
Set oWbo = oPayee

' Let this variable point to the main table of the Web Business Object
you are using.
vdfMainTable = "Payee"

' Let this variable point to the name of the webservice interface
vdfWEbServiceUrl = "webservice.wso"

'Clear the buffer of the WBO to make sure we start clean
Err = oWbo.RequestClear(vdfMainTable, 1)
%>

<!--#Include File="./Inc/Oxygen_ModalTop.inc"-->
<!-- Include all necessary Java Script libraries for the source code -->
<!-- #Include File="./VdfAjaxLib/1.0/includes.inc.asp" -->
<script type="text/javascript">
var aAddresses;

//
// Send the request for addresses to the published AddressJSON
// function in the oContact WO on the server. The field values are
// given as parameters.
//
// (Request is asynchrone so a waiting thingy could be displayed
here)
function validateAddress()
{
var oVdfForm = getVdfControl("Payee_form");
var sXML;

sXML = "<tRequestData>\n";
sXML += "<sSessionKey>" + browser.cookie.get("vdfSessionKey") +
"</sSessionKey>\n";
sXML += "<sWebObject>oPayee</sWebObject>\n";
sXML += "<aDataSets>\n";
sXML += "<TAjaxRequestSet>\n";
sXML += "<sName>Payee_form_</sName>\n";
sXML += "<sRequestType>DoFindPayee</sRequestType>\n";
sXML += "<iMaxRows>1</iMaxRows>\n";
sXML += "<sMainTableName>Payee</sMainTableName>\n";
sXML += "<sIndex>4</sIndex>\n";
sXML += "<sFindMode></sFindMode>\n";
sXML += "<bReturnCurrent>false</bReturnCurrent>\n";
sXML += "<bNoClear>false</bNoClear>\n";
sXML += "<aRows>\n";
sXML += "<TAjaxRequestRow>\n";
sXML += "<aCols>\n";
sXML += "<TAjaxRequestCol>\n";
sXML += "<sName>Payee.FIRSTNAME</sName>\n";
sXML += "<sType>D</sType>\n";
sXML += "<bChangedState>false</bChangedState>\n";
sXML += "<sValue><![CDATA[]]></sValue>\n";
sXML += "</TAjaxRequestCol>\n";
sXML += "<TAjaxRequestCol>\n";
sXML += "<sName>Payee.ADRESS</sName>\n";
sXML += "<sType>D</sType>\n";
sXML += "<bChangedState>false</bChangedState>\n";
sXML += "<sValue><![CDATA[Thoravej]]></sValue>\n";
sXML += "</TAjaxRequestCol>\n";
sXML += "<TAjaxRequestCol>\n";
sXML += "<sName>Payee.ZIPCODE</sName>\n";
sXML += "<sType>D</sType>\n";
sXML += "<bChangedState>false</bChangedState>\n";
sXML += "<sValue><![CDATA[2400]]></sValue>\n";
sXML += "</TAjaxRequestCol>\n";
sXML += "</aCols>\n";
sXML += "</TAjaxRequestRow>\n";
sXML += "</aRows>\n";
sXML += "<aUserData>\n";
sXML += "</aUserData>\n";
sXML += "</TAjaxRequestSet>\n";
sXML += "</aDataSets>\n";
sXML += "<aUserData>\n";
sXML += "</aUserData>\n";
sXML += "</tRequestData>\n";

oRequest = new comm.XmlRequest(false, "DoFindPayee", sXML, null, null,
"<%=vdfWEbServiceUrl%>");
oRequest.request();
//oRMI = new VdfRemoteMethodInvocation(true, "oPayee", "DoFindPayee",
sXML, null);
//oRMI.sendCall();
}

</script>

</head>
<body onload="document.getElementById('Service').focus();">
<form action="none" id="<%=vdfMainTable%>_form" autocomplete="off"
name="<%=vdfMainTable%>_form" vdfControlName="<%=vdfMainTable%>_form"
vdfWebServiceUrl="<%=vdfWebServiceUrl%>" vdfControlType="form"
vdfMainTable="<%=vdfMainTable%>" vdfWebObject="<%=oWbo.Name%>">
<table id="SearchTable" cellspacing="3" cellpadding="0" border="0">
<tr>
<td>&nbsp;</td>
</tr>

<tr>
<td class="FieldTitle">Service:</td>
<td>
<select class="InputText" id="Service" name="Service">
<option value ="volvo">Film Fare 2005</option>
<option value ="volvo">Film Fare 2006</option>
</select>
</td>
</tr>
<tr>
<td class="FieldTitle">Subscriber No:</td>
<td><input type="text" class="InputText" id="Payee__PAYEENUM"
name="Payee__PAYEENUM" size="30" value=""/></td>
</tr>
<tr>
<td class="FieldTitle">First Name:</td>
<td><input type="text" class="InputText" id="Payee__FIRSTNAME"
name="Payee__FIRSTNAME" size="50" value=""/></td>
</tr>
<tr>
<td class="FieldTitle">Last Name:</td>
<td><input type="text" class="InputText" id="Payee__LASTNAME"
name="Payee__LASTNAME" size="50" value=""/></td>
</tr>
<tr>
<td class="FieldTitle">Address:</td>
<td><input type="text" class="InputText" id="Payee__ADRESS"
name="Payee__ADRESS" size="50" value=""/></td>
</tr>
<tr>
<td class="FieldTitle">Zip:</td>
<td><input type="text" class="InputText" id="Payee__ZIPCODE"
name="Payee__ZIPCODE" size="15" value=""/></td>
</tr>
<tr>
<td class="FieldTitle">City:</td>
<td><input type="text" class="InputText" id="Payee__CITY1"
name="Payee__CITY1" size="50" value=""/></td>
</tr>
<tr>
<td class="FieldTitle">Email:</td>
<td><input type="text" class="InputText" id="Payee__EMAIL"
name="Payee__EMAIL" size="50" value=""/></td>
</tr>
<tr>
<td class="FieldTitle">Phone No:</td>
<td><input type="text" class="InputText" id="Payee__PHONE"
name="Payee__PHONE" size="20" value=""></td>
</tr>
</table>

<div id="ButtonDiv">
<input type="button" class="BlueButton" id="Search" name="Search"
value="Search" onclick="validateAddress();"/>
<input type="reset" class="GrayButton" id="Clear" name="Clear"
value="Clear"/>
<input type="button" class="GrayButton" id="Cancel" name="Cancel"
value="Cancel" onclick="window.top.JModalDialog_Hide();"/>
</div>

<br/>

<div id="Result" style="overflow:auto;">

</div>
</form>

</body>
</html>

Warm Regards,
Hitesh N.Kulkarni.
Epura India.
Itrix Inc.

Anders Ohrt
31-Oct-2007, 03:23 AM
> oRequest = new comm.XmlRequest(false, "DoFindPayee", sXML, null, null,
> "<%=vdfWEbServiceUrl%>");

I think it should be "get_DoFindPayee" (assuming DoFindPayee is a function)
since VDF adds "msg_", "get_" and "set_".

// Anders

Harm Wibier
31-Oct-2007, 05:05 AM
Hello Hitech,

The com.XmlRequest prototype is the lower level object that contains several
functionality for sending the AJAX requests. It can be used to send requests
to a published web-service method and not to any published method like the
VdfRemoteMethodInvocation.

The error no such method 'DoFindPayee' seems to be caused by the fact that
this isn't an published webservice method!

--
Regards,


Harm Wibier
Data Access Europe B.V.
http://www.dataaccess.nl/


"Hitesh" <hitesh@itrixinc.com> wrote in message
news:fn9mCPuGIHA.752@dacmail.dataaccess.com...
> Hello All,
>
> I am working on the VDF 12.0 and Ajax Library 1.0.
> I have created one ajax webobject as, 'oPayee' and in that I have written
> one function as,
> "DoFindPayee".
>
> For this I have written one code, which I have attached with this mail.
> In that code, on click of search button, I am calling one javascript
> function as, ' validateAddress() ' In that function I am generating a
> tAjaxRequestSet as sXML .
>
> Then using following code I am calling a function "DoFindPayee" which is
> in oPayee ajax webobject,
>
> oRequest = new comm.XmlRequest(false, "DoFindPayee", sXML, null, null,
> "<%=vdfWEbServiceUrl%>");
> oRequest.request();
>
> But it is giving me an error as, "No such a method: 'DoFindPayee'."
>
> Can anyone tell me where I am going wrong ?
>
> --
> Warm Regards,
> Hitesh N.Kulkarni.
> Epura India.
> Itrix Inc.
>
>
>
>