PDA

View Full Version : Problem with displaying the values in form



Hitesh
15-Nov-2007, 02:23 AM
Hi All,

I am working on the VDF 12.1 and Ajax Library 1.1
In my application, I have one table as "Payee".

I want to find the payee details according to rowid for that I have used
"doFindByRowId" method and it is working correctly.
After this, when I copied whole "AjaxFindByRowId" method in web object
"Payee.wo". Just changing the name of that method as "Payee_Get_Row" and I
have called this method using xmlRequest. It is generating a response set at
server side but it is not displaying that values in perticular form.
I have attached the sample code with this mail.

Can anyone help me where I am going wrong?
Thanks in advance.

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

Hitesh
15-Nov-2007, 02:27 AM
If there is problem with attachment then here I am sending a sample code.

<%
' 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"
'vdfWEbServiceUrl =
"http://front-it.endofinternet.net:8080/oxygen2/OxAPIService.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 File="./VdfAjaxLib/1-1/includes.inc.asp" -->
<script type="text/javascript">
var aPayeeRow;
function Payee_Get_Row()
{
var oVdfForm = getVdfControl("MainFunction_form");
oVdfForm.doClear("payee");

var sRowId = window.top.document.getElementById('PayeeRowId').v alue;
var sColumnSet = "";
var sRequestSet = "";

sColumnSet += VdfGlobals.soap.getFieldXml("payee__rowid", sRowId, true);
sColumnSet += VdfGlobals.soap.getFieldXml("Payee__FIRSTNAME", "", false);
sColumnSet += VdfGlobals.soap.getFieldXml("Payee__ADRESS", "", false);
sColumnSet += VdfGlobals.soap.getFieldXml("Payee__CITY1", "", false);
sColumnSet += VdfGlobals.soap.getFieldXml("Payee__COUNTRY", "", false);

sRequestSet = VdfGlobals.soap.getRequestSet("MainFunction_form_",
"Payee_Get_Row", "Payee", "", sColumnSet, 1, "3", 1, "", false, "", false);

sXML = "<tRequestData>\n";
sXML += "<sSessionKey>" + browser.cookie.get("vdfSessionKey") +
"</sSessionKey>\n";
sXML += "<sWebObject>oPayee</sWebObject>\n";
sXML += "<aDataSets>\n";
sXML += sRequestSet;
sXML += "</aDataSets>\n";
sXML += "<aUserData>\n";
sXML += "</aUserData>\n";

sXML += "</tRequestData>\n";

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


/*oVdfForm.doClear("payee");
oVdfForm.doFindByRowId("payee", sRowId);*/
}

function diplayPayeeInformation(oRMI)
{

if (oRMI.iErrorNumber == 0)
{
aPayeeRow = eval("(" + oRMI.sReturnValue + ")");
for (var iCount=0; iCount<aPayeeRow.length; iCount++)
{
document.getElementById('Payee__FIRSTNAME').value =
aPayeeRow[iCount].sFIRSTNAME;
document.getElementById('Payee__ADRESS').value =
aPayeeRow[iCount].sADDRESS;
document.getElementById('Payee__CITY1').value =
aPayeeRow[iCount].sCITY;
document.getElementById('Payee__COUNTRY').value =
aPayeeRow[iCount].sCOUNTRY;
}
}
else
{
alert(oRMI.iErrorNumber + " : " + oRMI.sErrorText);
}
}
</script>
</head>
<body>
<form id="MainFunction" autocomplete="off" name="MainFunction"
vdfControlName="MainFunction_form" vdfWebServiceUrl="<%=vdfWebServiceUrl%>"
vdfControlType="form" vdfMainTable="<%=vdfMainTable%>"
vdfWebObject="<%=oWbo.Name%>">
<br/>
<table id="MainFunctionTable" cellpadding="2" cellspacing="0" border="0"
align="center">
<tr>
<th class="Header">Details</th>
<th class="Header">Payee</th>
<th class="Header">Recipient</th>
</tr>
<tr>
<th class="HeaderDetails">Name</th>

<td class="PayeeTdColor">
<input type="text" class="PayeeInputText" id="Payee__FIRSTNAME"
name="Payee__FIRSTNAME" size="30" value="" readonly />
</td>

<td class="RecipientTdColor">
<input type="text" class="RecepientInputText" id="Recepient_Name"
name="Recepient_Name" size="30" value="" readonly />
</td>
</tr>

<tr>
<th class="HeaderDetails">Address</th>

<td class="PayeeTdColor">
<input type="text" class="PayeeInputText" id="Payee__ADRESS"
name="Payee__ADRESS" size="30" value="" readonly />
</td>

<td class="RecipientTdColor">
<input type="text" class="RecepientInputText" id="Recepient_Address"
name="Recepient_Address" size="30" value="" readonly />
</td>

</tr>

<tr>
<th class="HeaderDetails">City</th>

<td class="PayeeTdColor">
<input type="text" class="PayeeInputText" id="Payee__CITY1"
name="Payee__CITY1" size="30" value="" readonly />
</td>

<td class="RecipientTdColor">
<input type="text" class="RecepientInputText" id="Recepient_City"
name="Recepient_City" size="30" value="" readonly />
</td>

</tr>

<tr>
<th class="HeaderDetails">Country</th>

<td class="PayeeTdColor">
<input type="text" class="PayeeInputText" id="Payee__COUNTRY"
name="Payee__COUNTRY" size="30" value="" readonly />
</td>

<td class="RecipientTdColor">
<input type="text" class="RecepientInputText" id="Recepient_Country"
name="Recepient_Country" size="30" value="" readonly />
</td>

</tr>
</table>

<br/>

<table id="CampaignTable" cellspacing="0" cellpadding="2" border="0"
align="center">
<tr>
<td class="CampaignFieldTitle">Campaign</td>
<td>
<input type="text" class="CampaignText" id="campaign" name="campaign"
size="30" value="VB009 3 issues out of 99" readonly />
</td>
</tr>
<tr>
<td class="CampaignFieldTitle">Follow Camp</td>
<td>
<input type="text" class="CampaignText" id="followcampaign"
name="followcampaign" size="30" value="Camp at CBS" readonly />
</td>
</tr>
</table>

<br/>

<table id="MagzineInfoTable" cellspacing="0" cellpadding="2" border="0"
align="center">
<tr>
<th class="MagzineTd">No Of Magazines Per Issue:</th>
<td>
<input type="text" class="MagzineInputText" size="4" id="Issues"
name="Issues" value="" />
</td>

<th class="MagzineTd">Force Delivery by postdanmark:</th>
<td>
<input type="checkbox">
</td>
</tr>
</table>
</form>
<script type="text/javascript">
VdfInitControls();
Payee_Get_Row();
</script>
</body>
</html>


Warm Regards,
Hitesh N.Kulkarni

Harm Wibier
15-Nov-2007, 02:58 AM
Hello Hitesh,

First of all, why do you want to send this request manually?

If I skim through your code I notice that you never handle the result of the
request, if you send a request by yourself you will have to handle it by
yourself too.

--
Regards,


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

"Hitesh" <hitesh@itrixinc.com> wrote in message
news:FkIWvj1JIHA.4932@dacmail.dataaccess.com...
> If there is problem with attachment then here I am sending a sample code.
>
> <%
> ' 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"
> 'vdfWEbServiceUrl =
> "http://front-it.endofinternet.net:8080/oxygen2/OxAPIService.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 File="./VdfAjaxLib/1-1/includes.inc.asp" -->
> <script type="text/javascript">
> var aPayeeRow;
> function Payee_Get_Row()
> {
> var oVdfForm = getVdfControl("MainFunction_form");
> oVdfForm.doClear("payee");
>
> var sRowId = window.top.document.getElementById('PayeeRowId').v alue;
> var sColumnSet = "";
> var sRequestSet = "";
>
> sColumnSet += VdfGlobals.soap.getFieldXml("payee__rowid", sRowId, true);
> sColumnSet += VdfGlobals.soap.getFieldXml("Payee__FIRSTNAME", "",
> false);
> sColumnSet += VdfGlobals.soap.getFieldXml("Payee__ADRESS", "", false);
> sColumnSet += VdfGlobals.soap.getFieldXml("Payee__CITY1", "", false);
> sColumnSet += VdfGlobals.soap.getFieldXml("Payee__COUNTRY", "", false);
>
> sRequestSet = VdfGlobals.soap.getRequestSet("MainFunction_form_",
> "Payee_Get_Row", "Payee", "", sColumnSet, 1, "3", 1, "", false, "",
> false);
>
> sXML = "<tRequestData>\n";
> sXML += "<sSessionKey>" + browser.cookie.get("vdfSessionKey") +
> "</sSessionKey>\n";
> sXML += "<sWebObject>oPayee</sWebObject>\n";
> sXML += "<aDataSets>\n";
> sXML += sRequestSet;
> sXML += "</aDataSets>\n";
> sXML += "<aUserData>\n";
> sXML += "</aUserData>\n";
>
> sXML += "</tRequestData>\n";
>
> oRequest = new comm.XmlRequest(false, "Oxygen_Request", sXML, null,
> null, "<%=vdfWEbServiceUrl%>");
> oRequest.request();
>
>
> /*oVdfForm.doClear("payee");
> oVdfForm.doFindByRowId("payee", sRowId);*/
> }
>
> function diplayPayeeInformation(oRMI)
> {
>
> if (oRMI.iErrorNumber == 0)
> {
> aPayeeRow = eval("(" + oRMI.sReturnValue + ")");
> for (var iCount=0; iCount<aPayeeRow.length; iCount++)
> {
> document.getElementById('Payee__FIRSTNAME').value =
> aPayeeRow[iCount].sFIRSTNAME;
> document.getElementById('Payee__ADRESS').value =
> aPayeeRow[iCount].sADDRESS;
> document.getElementById('Payee__CITY1').value =
> aPayeeRow[iCount].sCITY;
> document.getElementById('Payee__COUNTRY').value =
> aPayeeRow[iCount].sCOUNTRY;
> }
> }
> else
> {
> alert(oRMI.iErrorNumber + " : " + oRMI.sErrorText);
> }
> }
> </script>
> </head>
> <body>
> <form id="MainFunction" autocomplete="off" name="MainFunction"
> vdfControlName="MainFunction_form"
> vdfWebServiceUrl="<%=vdfWebServiceUrl%>" vdfControlType="form"
> vdfMainTable="<%=vdfMainTable%>" vdfWebObject="<%=oWbo.Name%>">
> <br/>
> <table id="MainFunctionTable" cellpadding="2" cellspacing="0" border="0"
> align="center">
> <tr>
> <th class="Header">Details</th>
> <th class="Header">Payee</th>
> <th class="Header">Recipient</th>
> </tr>
> <tr>
> <th class="HeaderDetails">Name</th>
>
> <td class="PayeeTdColor">
> <input type="text" class="PayeeInputText" id="Payee__FIRSTNAME"
> name="Payee__FIRSTNAME" size="30" value="" readonly />
> </td>
>
> <td class="RecipientTdColor">
> <input type="text" class="RecepientInputText" id="Recepient_Name"
> name="Recepient_Name" size="30" value="" readonly />
> </td>
> </tr>
>
> <tr>
> <th class="HeaderDetails">Address</th>
>
> <td class="PayeeTdColor">
> <input type="text" class="PayeeInputText" id="Payee__ADRESS"
> name="Payee__ADRESS" size="30" value="" readonly />
> </td>
>
> <td class="RecipientTdColor">
> <input type="text" class="RecepientInputText" id="Recepient_Address"
> name="Recepient_Address" size="30" value="" readonly />
> </td>
>
> </tr>
>
> <tr>
> <th class="HeaderDetails">City</th>
>
> <td class="PayeeTdColor">
> <input type="text" class="PayeeInputText" id="Payee__CITY1"
> name="Payee__CITY1" size="30" value="" readonly />
> </td>
>
> <td class="RecipientTdColor">
> <input type="text" class="RecepientInputText" id="Recepient_City"
> name="Recepient_City" size="30" value="" readonly />
> </td>
>
> </tr>
>
> <tr>
> <th class="HeaderDetails">Country</th>
>
> <td class="PayeeTdColor">
> <input type="text" class="PayeeInputText" id="Payee__COUNTRY"
> name="Payee__COUNTRY" size="30" value="" readonly />
> </td>
>
> <td class="RecipientTdColor">
> <input type="text" class="RecepientInputText" id="Recepient_Country"
> name="Recepient_Country" size="30" value="" readonly />
> </td>
>
> </tr>
> </table>
>
> <br/>
>
> <table id="CampaignTable" cellspacing="0" cellpadding="2" border="0"
> align="center">
> <tr>
> <td class="CampaignFieldTitle">Campaign</td>
> <td>
> <input type="text" class="CampaignText" id="campaign" name="campaign"
> size="30" value="VB009 3 issues out of 99" readonly />
> </td>
> </tr>
> <tr>
> <td class="CampaignFieldTitle">Follow Camp</td>
> <td>
> <input type="text" class="CampaignText" id="followcampaign"
> name="followcampaign" size="30" value="Camp at CBS" readonly />
> </td>
> </tr>
> </table>
>
> <br/>
>
> <table id="MagzineInfoTable" cellspacing="0" cellpadding="2" border="0"
> align="center">
> <tr>
> <th class="MagzineTd">No Of Magazines Per Issue:</th>
> <td>
> <input type="text" class="MagzineInputText" size="4" id="Issues"
> name="Issues" value="" />
> </td>
>
> <th class="MagzineTd">Force Delivery by postdanmark:</th>
> <td>
> <input type="checkbox">
> </td>
> </tr>
> </table>
> </form>
> <script type="text/javascript">
> VdfInitControls();
> Payee_Get_Row();
> </script>
> </body>
> </html>
>
>
> Warm Regards,
> Hitesh N.Kulkarni
>