473,379 Members | 1,257 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

ClientCallback a step behind...

Hello,

I am using a client callback routine that seems to mostly work, except
that program flow doesn't seem to continue from the point the function is
called after the Receive function finishes...

....paraphrasing....

var X = "";

button_Click
{
var sTest = ListBox1.value;
DoCallBack(sTest);
------ ReceiveCallback executes fine ------
alert(X);
}

function ReceiveCallback(rValue, context)
{
textbox1.text = rValue;
X = rValue
}

When alert(X) happens, it is always a step behind. For instance, say there
are 5 rows in the list box and the values are 1,2,3,4 and 5. When I click
1, the textbox shows 1, but alert(X) shows an empty string, then I click 2 -
the textbox shows 2, but alert(X) shows 1. If I skip values the alert
always shows th previous value. alert(X) will show the right value if fired
in ReceiveCallback.

How can I continue program flow wirh the current rValue in the button_Click
function?

Thanks

--
Matthew.Wells
Ma***********@FirstByte.net
Jun 27 '08 #1
3 1041
client callbacks are async. the receive callback will not be called
until after the button click completes.

-- bruce (sqlwork.com)

Matthew Wells wrote:
Hello,

I am using a client callback routine that seems to mostly work, except
that program flow doesn't seem to continue from the point the function is
called after the Receive function finishes...

...paraphrasing....

var X = "";

button_Click
{
var sTest = ListBox1.value;
DoCallBack(sTest);
------ ReceiveCallback executes fine ------
alert(X);
}

function ReceiveCallback(rValue, context)
{
textbox1.text = rValue;
X = rValue
}

When alert(X) happens, it is always a step behind. For instance, say there
are 5 rows in the list box and the values are 1,2,3,4 and 5. When I click
1, the textbox shows 1, but alert(X) shows an empty string, then I click 2 -
the textbox shows 2, but alert(X) shows 1. If I skip values the alert
always shows th previous value. alert(X) will show the right value if fired
in ReceiveCallback.

How can I continue program flow wirh the current rValue in the button_Click
function?

Thanks
Jun 27 '08 #2
I finally caught that. I thought the ReceiveCallback alert was firing AFTER
the btnClick alert, but it turns out that the btnClick alert fired first,
then thr ReceiveCallback alert fired and the msgbox appeared on top of the
first so the illusion was that I clicked OK on the first then the second
appeared, but in reality, I clicked OK on the second leaving the first one.

I know the intent is to be async, but is there a way to "pause" the btnClick
until the Receive callback finishes? I'm setting a variable in
ReceiveCallBack that I need in btnClick.

Thanks.

"bruce barker" <no****@nospam.comwrote in message
news:OJ**************@TK2MSFTNGP03.phx.gbl...
client callbacks are async. the receive callback will not be called until
after the button click completes.

-- bruce (sqlwork.com)

Matthew Wells wrote:
>Hello,

I am using a client callback routine that seems to mostly work,
except that program flow doesn't seem to continue from the point the
function is called after the Receive function finishes...

...paraphrasing....

var X = "";

button_Click
{
var sTest = ListBox1.value;
DoCallBack(sTest);
------ ReceiveCallback executes fine ------
alert(X);
}

function ReceiveCallback(rValue, context)
{
textbox1.text = rValue;
X = rValue
}

When alert(X) happens, it is always a step behind. For instance, say
there are 5 rows in the list box and the values are 1,2,3,4 and 5. When
I click 1, the textbox shows 1, but alert(X) shows an empty string, then
I click 2 - the textbox shows 2, but alert(X) shows 1. If I skip values
the alert always shows th previous value. alert(X) will show the right
value if fired in ReceiveCallback.

How can I continue program flow wirh the current rValue in the
button_Click function?

Thanks

Jun 27 '08 #3
No, there wouldn't be a way to "Pause" the button click, because it is the
button's click event handler itself that is actually generating the
callback. So you'll need to revisit your logic to see if you can get what
you need.
Peter

"Matthew Wells" <Ma***********@FirstByte.netwrote in message
news:nd******************************@comcast.com. ..
>I finally caught that. I thought the ReceiveCallback alert was firing
AFTER the btnClick alert, but it turns out that the btnClick alert fired
first, then thr ReceiveCallback alert fired and the msgbox appeared on top
of the first so the illusion was that I clicked OK on the first then the
second appeared, but in reality, I clicked OK on the second leaving the
first one.

I know the intent is to be async, but is there a way to "pause" the
btnClick until the Receive callback finishes? I'm setting a variable in
ReceiveCallBack that I need in btnClick.

Thanks.

"bruce barker" <no****@nospam.comwrote in message
news:OJ**************@TK2MSFTNGP03.phx.gbl...
>client callbacks are async. the receive callback will not be called until
after the button click completes.

-- bruce (sqlwork.com)

Matthew Wells wrote:
>>Hello,

I am using a client callback routine that seems to mostly work,
except that program flow doesn't seem to continue from the point the
function is called after the Receive function finishes...

...paraphrasing....

var X = "";

button_Click
{
var sTest = ListBox1.value;
DoCallBack(sTest);
------ ReceiveCallback executes fine ------
alert(X);
}

function ReceiveCallback(rValue, context)
{
textbox1.text = rValue;
X = rValue
}

When alert(X) happens, it is always a step behind. For instance, say
there are 5 rows in the list box and the values are 1,2,3,4 and 5. When
I click 1, the textbox shows 1, but alert(X) shows an empty string, then
I click 2 - the textbox shows 2, but alert(X) shows 1. If I skip values
the alert always shows th previous value. alert(X) will show the right
value if fired in ReceiveCallback.

How can I continue program flow wirh the current rValue in the
button_Click function?

Thanks

Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Neverlyn | last post by:
Has anyone got the “How to: ClientCallback.aspx (C#)” code from the msdn doco that comes with VS.NET 2005 Beta 2 working? I keep getting multiple “no suitable method to override” error...
0
by: Robert Millman | last post by:
under ASP.NET, single stepping in debug mode appears not to stop within event procedures. i.e. 1) Create web page with submit button and event procedure for the click event in the code behind...
3
by: R Millman | last post by:
under ASP.NET, single stepping in debug mode appears not to stop within event procedures. i.e. 1) Create web page with submit button and event procedure for the click event in the code behind...
3
by: Leo J. Hart IV | last post by:
OK, here's another question for the experts: I am building a multi-step (3 steps actually) form using a panel for each step and hiding/displaying the appropriate panel/panels depending on which...
171
by: tshad | last post by:
I am just trying to decide whether to split my code and uses code behind. I did it with one of my pages and found it was quite a bit of trouble. I know that most people (and books and articles)...
6
by: John Salerno | last post by:
Ok, this might look familiar. I'd like to use regular expressions to change this line: self.source += '<p>' + paragraph + '</p>\n\n' to read: self.source += '<p>%s</p>\n\n' % paragraph ...
1
by: JJ | last post by:
I want to make one or other display panel visible on the 'complete' step of a createuserwizard. I've customised the complete step and have the id's of the panels. I've tried: Control...
3
by: Bob | last post by:
Hi, i want to use ajax in my application, but i saw there are a lot of possibilities. What to choose among clientcallback, atlas or ajax.net (anthem, magicajax) ? Thanks for advice (pro's /...
4
by: Bob | last post by:
Hi, i want to use ajax in my application, but i saw there are a lot of possibilities. What to choose among clientcallback, atlas or ajax.net (anthem, magicajax) ? It seems that ajax.net is easy...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.