PDA

View Full Version : illegal XML Character



Steven Lemarr
13-Jul-2007, 06:07 PM
I have an ASP page that has a button that calls a javascript, which then
call a WBO Function and I am getting an illegal XML character when the ASP
is loaded before the operator is allowed to do anything. The web bowser is
Firefox. Below is the code I am using:

This is the Firefox Error:

illegal XML character
<% sCount = oYmFreeListing.Call("Get_DoCountSelection",srowid)%> ;\n
script07.js (line 10)
JavaScript:
function Run_RecordCount(){
var sCount, srowid;
srowid =
getVdfControl("flwbtchq_form").getStatusField("flwbtchq__rowid").getValue();
alert("RowId="+srowid);
<% sCount =
oYmFreeListing.Call("Get_DoCountSelection",srowid)%> ; <-- this line is
giving the error
alert("RowId="+srowid+" Count="+sCount);
}

I have also tried sCount = <%
oYmFreeListing.Call("Get_DoCountSelection",srowid)%> ; I get the same error
If I use sCount = oYmFreeListing.Call("Get_DoCountSelection",srowid; I get
"oYmFreeListing is not defined"

ASP Button that Calls Javascript:

<input type='button' onclick="Run_RecordCount();" value='Selection
Count of Records'>

WBO Function:

Function DoCountSelection String lsRowId Returns String
RowID riRowId
Integer vQuery vMaxCursor iBusCount iColCount bFound
String sData sSelectType sCount
String sState
String sSelect1 sSelect2 sSelect3 sSelect4
String sSelect5 sSelect6 sSelect7 sSelect8

Move (DeserializeRowid(lsRowId)) to riRowId

Function_Return "aa"
End_Function

The WBO function works because when I put the following code in the ASP page
I get the value returnd:

<td>
<%= oYmFreeListing.Call("Get_DoCountSelection",srowid)%>
</td>

Bob Worsley
13-Jul-2007, 07:01 PM
Maybe instead try the AJAX function call to the back end, it works great.
Don't know if it will be any different, but maybe.
VdfRemoteMethodInvocation
Bob

"Steven Lemarr" <steve@jahl.com> wrote in message
news:v1dngJaxHHA.5472@dacmail.dataaccess.com...
> I have an ASP page that has a button that calls a javascript, which then
> call a WBO Function and I am getting an illegal XML character when the ASP
> is loaded before the operator is allowed to do anything. The web bowser
is
> Firefox. Below is the code I am using:
>
> This is the Firefox Error:
>
> illegal XML character
> <% sCount = oYmFreeListing.Call("Get_DoCountSelection",srowid)%> ;\n
> script07.js (line 10)
> JavaScript:
> function Run_RecordCount(){
> var sCount, srowid;
> srowid =
>
getVdfControl("flwbtchq_form").getStatusField("flwbtchq__rowid").getValue();
> alert("RowId="+srowid);
> <% sCount =
> oYmFreeListing.Call("Get_DoCountSelection",srowid)%> ; <-- this line is
> giving the error
> alert("RowId="+srowid+" Count="+sCount);
> }
>
> I have also tried sCount = <%
> oYmFreeListing.Call("Get_DoCountSelection",srowid)%> ; I get the same
error
> If I use sCount = oYmFreeListing.Call("Get_DoCountSelection",srowid; I
get
> "oYmFreeListing is not defined"
>
> ASP Button that Calls Javascript:
>
> <input type='button' onclick="Run_RecordCount();"
value='Selection
> Count of Records'>
>
> WBO Function:
>
> Function DoCountSelection String lsRowId Returns String
> RowID riRowId
> Integer vQuery vMaxCursor iBusCount iColCount bFound
> String sData sSelectType sCount
> String sState
> String sSelect1 sSelect2 sSelect3 sSelect4
> String sSelect5 sSelect6 sSelect7 sSelect8
>
> Move (DeserializeRowid(lsRowId)) to riRowId
>
> Function_Return "aa"
> End_Function
>
> The WBO function works because when I put the following code in the ASP
page
> I get the value returnd:
>
> <td>
> <%= oYmFreeListing.Call("Get_DoCountSelection",srowid)%>
> </td>
>
>
>
>

Edwin van der Velden
16-Jul-2007, 02:41 AM
Ok, from what I understand you're trying to do is dynamically call a VDF
function which is not possible the way you try to do it, like Bob I would
suggest looking into the RemoteMethodInvocation example of usage can be
found in the AJAX Order Entry example).

Nonetheless I will go over the why a bit.

The javascript error you get contains the entire ASP line? This would
indicate that you have included this code in a type of file that is not
known to be an ASP file and the ASP code is not executed serverside. Which
brings me to the second point, the ASP code is executed server side, so even
if it would be executed it would perform <% sCount =
oYmFreeListing.Call("Get_DoCountSelection",srowid)%> serverside only once
the moment you load the page.

So in short, ASP is executed first at serverside before the page even loads,
JavaScript is executed clientside after/during page load. You can't call ASP
functions once the page has been loaded, in traditional web applications you
would do this by posting the variables needed and reloading the page
executing the asp functions. With the AJAX Library you can use the Remote
Method Invocation.

-Edwin


"Steven Lemarr" <steve@jahl.com> wrote in message
news:v1dngJaxHHA.5472@dacmail.dataaccess.com...
>I have an ASP page that has a button that calls a javascript, which then
>call a WBO Function and I am getting an illegal XML character when the ASP
>is loaded before the operator is allowed to do anything. The web bowser is
>Firefox. Below is the code I am using:
>
> This is the Firefox Error:
>
> illegal XML character
> <% sCount = oYmFreeListing.Call("Get_DoCountSelection",srowid)%> ;\n
> script07.js (line 10)
> JavaScript:
> function Run_RecordCount(){
> var sCount, srowid;
> srowid =
> getVdfControl("flwbtchq_form").getStatusField("flwbtchq__rowid").getValue();
> alert("RowId="+srowid);
> <% sCount =
> oYmFreeListing.Call("Get_DoCountSelection",srowid)%> ; <-- this line is
> giving the error
> alert("RowId="+srowid+" Count="+sCount);
> }
>
> I have also tried sCount = <%
> oYmFreeListing.Call("Get_DoCountSelection",srowid)%> ; I get the same
> error
> If I use sCount = oYmFreeListing.Call("Get_DoCountSelection",srowid; I
> get "oYmFreeListing is not defined"
>
> ASP Button that Calls Javascript:
>
> <input type='button' onclick="Run_RecordCount();"
> value='Selection Count of Records'>
>
> WBO Function:
>
> Function DoCountSelection String lsRowId Returns String
> RowID riRowId
> Integer vQuery vMaxCursor iBusCount iColCount bFound
> String sData sSelectType sCount
> String sState
> String sSelect1 sSelect2 sSelect3 sSelect4
> String sSelect5 sSelect6 sSelect7 sSelect8
>
> Move (DeserializeRowid(lsRowId)) to riRowId
>
> Function_Return "aa"
> End_Function
>
> The WBO function works because when I put the following code in the ASP
> page I get the value returnd:
>
> <td>
> <%= oYmFreeListing.Call("Get_DoCountSelection",srowid)%>
> </td>
>
>
>

Steven Lemarr
17-Jul-2007, 06:21 PM
I have the Function call working by using the VdfRemoteMethodInvocation and
it works and displays the results thru an "Alert" command, but now I would
like to display the results and on the ASP page in a after the operator
clicks on the Count Button.

function Run_RecordCount(){
var srowid;
srowid =
getVdfControl("flwbtchq_form").getStatusField("flwbtchq__rowid").getValue();
oCount = new
VdfRemoteMethodInvocation(true,"oYmFreeListing","get_DoCountSelection",null,DoShowCount)
;
oCount.addParameter(srowid);
oCount.sendCall();
}

function DoShowCount(){
var sCount = null;
sCount=oCount.sReturnValue;
alert("Count="+sCount);
return sCount;
}

"Bob Worsley" <bworsley@comcast.net> wrote in message
news:xJjrpnaxHHA.5536@dacmail.dataaccess.com...
> Maybe instead try the AJAX function call to the back end, it works great.
> Don't know if it will be any different, but maybe.
> VdfRemoteMethodInvocation
> Bob
>
> "Steven Lemarr" <steve@jahl.com> wrote in message
> news:v1dngJaxHHA.5472@dacmail.dataaccess.com...
>> I have an ASP page that has a button that calls a javascript, which then
>> call a WBO Function and I am getting an illegal XML character when the
>> ASP
>> is loaded before the operator is allowed to do anything. The web bowser
> is
>> Firefox. Below is the code I am using:
>>
>> This is the Firefox Error:
>>
>> illegal XML character
>> <% sCount = oYmFreeListing.Call("Get_DoCountSelection",srowid)%> ;\n
>> script07.js (line 10)
>> JavaScript:
>> function Run_RecordCount(){
>> var sCount, srowid;
>> srowid =
>>
> getVdfControl("flwbtchq_form").getStatusField("flwbtchq__rowid").getValue();
>> alert("RowId="+srowid);
>> <% sCount =
>> oYmFreeListing.Call("Get_DoCountSelection",srowid)%> ; <-- this line is
>> giving the error
>> alert("RowId="+srowid+" Count="+sCount);
>> }
>>
>> I have also tried sCount = <%
>> oYmFreeListing.Call("Get_DoCountSelection",srowid)%> ; I get the same
> error
>> If I use sCount = oYmFreeListing.Call("Get_DoCountSelection",srowid; I
> get
>> "oYmFreeListing is not defined"
>>
>> ASP Button that Calls Javascript:
>>
>> <input type='button' onclick="Run_RecordCount();"
> value='Selection
>> Count of Records'>
>>
>> WBO Function:
>>
>> Function DoCountSelection String lsRowId Returns String
>> RowID riRowId
>> Integer vQuery vMaxCursor iBusCount iColCount bFound
>> String sData sSelectType sCount
>> String sState
>> String sSelect1 sSelect2 sSelect3 sSelect4
>> String sSelect5 sSelect6 sSelect7 sSelect8
>>
>> Move (DeserializeRowid(lsRowId)) to riRowId
>>
>> Function_Return "aa"
>> End_Function
>>
>> The WBO function works because when I put the following code in the ASP
> page
>> I get the value returnd:
>>
>> <td>
>> <%= oYmFreeListing.Call("Get_DoCountSelection",srowid)%>
>> </td>
>>
>>
>>
>>
>
>
>

Edwin van der Velden
18-Jul-2007, 07:49 AM
Somehow I get the feeling something is missing in that sentence, you want to
display the results how\where exactly?
I'll just assume you want to update some field with the value and need to
change the line: alert("Count="+sCount);

to something like
getVdfControl("flwbtchq_form").getField("flwbtchq__count").setValue(iCount);

Of course names may be different or I may have assumed totally wrong and you
want to display somewhere else.

-Edwin



"Steven Lemarr" <steve@jahl.com> wrote in message
news:4kA$GkMyHHA.5536@dacmail.dataaccess.com...
>I have the Function call working by using the VdfRemoteMethodInvocation and
>it works and displays the results thru an "Alert" command, but now I would
>like to display the results and on the ASP page in a after the operator
>clicks on the Count Button.
>
> function Run_RecordCount(){
> var srowid;
> srowid =
> getVdfControl("flwbtchq_form").getStatusField("flwbtchq__rowid").getValue();
> oCount = new
> VdfRemoteMethodInvocation(true,"oYmFreeListing","get_DoCountSelection",null,DoShowCount)
> ;
> oCount.addParameter(srowid);
> oCount.sendCall();
> }
>
> function DoShowCount(){
> var sCount = null;
> sCount=oCount.sReturnValue;
> alert("Count="+sCount);
> return sCount;
> }
>
> "Bob Worsley" <bworsley@comcast.net> wrote in message
> news:xJjrpnaxHHA.5536@dacmail.dataaccess.com...
>> Maybe instead try the AJAX function call to the back end, it works great.
>> Don't know if it will be any different, but maybe.
>> VdfRemoteMethodInvocation
>> Bob
>>
>> "Steven Lemarr" <steve@jahl.com> wrote in message
>> news:v1dngJaxHHA.5472@dacmail.dataaccess.com...
>>> I have an ASP page that has a button that calls a javascript, which then
>>> call a WBO Function and I am getting an illegal XML character when the
>>> ASP
>>> is loaded before the operator is allowed to do anything. The web bowser
>> is
>>> Firefox. Below is the code I am using:
>>>
>>> This is the Firefox Error:
>>>
>>> illegal XML character
>>> <% sCount = oYmFreeListing.Call("Get_DoCountSelection",srowid)%> ;\n
>>> script07.js (line 10)
>>> JavaScript:
>>> function Run_RecordCount(){
>>> var sCount, srowid;
>>> srowid =
>>>
>> getVdfControl("flwbtchq_form").getStatusField("flwbtchq__rowid").getValue();
>>> alert("RowId="+srowid);
>>> <% sCount =
>>> oYmFreeListing.Call("Get_DoCountSelection",srowid)%> ; <-- this line is
>>> giving the error
>>> alert("RowId="+srowid+" Count="+sCount);
>>> }
>>>
>>> I have also tried sCount = <%
>>> oYmFreeListing.Call("Get_DoCountSelection",srowid)%> ; I get the same
>> error
>>> If I use sCount = oYmFreeListing.Call("Get_DoCountSelection",srowid; I
>> get
>>> "oYmFreeListing is not defined"
>>>
>>> ASP Button that Calls Javascript:
>>>
>>> <input type='button' onclick="Run_RecordCount();"
>> value='Selection
>>> Count of Records'>
>>>
>>> WBO Function:
>>>
>>> Function DoCountSelection String lsRowId Returns String
>>> RowID riRowId
>>> Integer vQuery vMaxCursor iBusCount iColCount bFound
>>> String sData sSelectType sCount
>>> String sState
>>> String sSelect1 sSelect2 sSelect3 sSelect4
>>> String sSelect5 sSelect6 sSelect7 sSelect8
>>>
>>> Move (DeserializeRowid(lsRowId)) to riRowId
>>>
>>> Function_Return "aa"
>>> End_Function
>>>
>>> The WBO function works because when I put the following code in the ASP
>> page
>>> I get the value returnd:
>>>
>>> <td>
>>> <%= oYmFreeListing.Call("Get_DoCountSelection",srowid)%>
>>> </td>
>>>
>>>
>>>
>>>
>>
>>
>>
>
>