Mega Search
23.2 Million


Sign Up

Make a donation  
After using a components ScriptEvents the components async e  
News Group: embarcadero.public.delphi.thirdpartytools.intraweb

Hi All,

I have an application that mostly uses async evnts (to avoid too much overhead with reloading page etc).

I use some javascript that is fired from the components ScriptEvents (e.g. onClick). This all works as expected, except that once the scriptsEvent is fired the controls async events does not update the components on the form. The ScriptEvents onClick event has code like this:

checkIfPlaceValid();
return true;

the javascript function checkIfPlaceValid(); does a google geocode look up of the string the user has entered in an edit control and updates the same edit control with a valid place name using:

var edtAddress = document.getElementById("EDTPLACETEXT");
edtAddress.value = countryText;

and other similar code in javascript

this works, but

Once it has done this, the next asyn event I try to do on the form does not update the components on the form (i.e. does not work). In debugging I see the async event is called, (e.g. in the EDTPLACETEXTAsyncKeyPress, this gets fired EDTALLOWPOST.Caption := '';) but the component is not updated on the form.

Why is this, what am I doing wrong?

brgds
Justin

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 20-Jan-2015, at 1:49 AM EST
From: Justin Philobrow
 
Re: After using a components ScriptEvents the components asy  
News Group: embarcadero.public.delphi.thirdpartytools.intraweb
Thanks Alexandre, that did it.

Any chance of you asking the people in sales to look at my license request?

brgds
Justin



> {quote:title=Alexandre Machado wrote:}{quote}
> > {quote:title=Justin Philobrow wrote:}{quote}
> > Hi All,
> > 
> > I have an application that mostly uses async evnts (to avoid too much overhead with reloading page etc).
> > 
> > I use some javascript that is fired from the components ScriptEvents (e.g. onClick). This all works as expected, except that once the scriptsEvent is fired the controls async events does not update the components on the form. The ScriptEvents onClick event has code like this:
> > 
> > checkIfPlaceValid();
> > return true;
> > 
> > the javascript function checkIfPlaceValid(); does a google geocode look up of the string the user has entered in an edit control and updates the same edit control with a valid place name using:
> > 
> > var edtAddress = document.getElementById("EDTPLACETEXT");
> > edtAddress.value = countryText;
> > 
> > and other similar code in javascript
> > 
> > this works, but
> > 
> > Once it has done this, the next asyn event I try to do on the form does not update the components on the form (i.e. does not work). In debugging I see the async event is called, (e.g. in the EDTPLACETEXTAsyncKeyPress, this gets fired EDTALLOWPOST.Caption := '';) but the component is not updated on the form.
> > 
> > Why is this, what am I doing wrong?
> 
> After setting the value of some control via JavaScript, call IW JavaScript function AddChangedControl(), to indicate that this control has changed, like this:
> 
> AddChangedControl(edtAddress.id); (or AddChangedControl("EDTPLACETEXT"))
> 
> This should fix this issue.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 20-Jan-2015, at 9:08 AM EST
From: Justin Philobrow
 
Re: After using a components ScriptEvents the components asy  
News Group: embarcadero.public.delphi.thirdpartytools.intraweb
> {quote:title=Justin Philobrow wrote:}{quote}
> Hi All,
> 
> I have an application that mostly uses async evnts (to avoid too much overhead with reloading page etc).
> 
> I use some javascript that is fired from the components ScriptEvents (e.g. onClick). This all works as expected, except that once the scriptsEvent is fired the controls async events does not update the components on the form. The ScriptEvents onClick event has code like this:
> 
> checkIfPlaceValid();
> return true;
> 
> the javascript function checkIfPlaceValid(); does a google geocode look up of the string the user has entered in an edit control and updates the same edit control with a valid place name using:
> 
> var edtAddress = document.getElementById("EDTPLACETEXT");
> edtAddress.value = countryText;
> 
> and other similar code in javascript
> 
> this works, but
> 
> Once it has done this, the next asyn event I try to do on the form does not update the components on the form (i.e. does not work). In debugging I see the async event is called, (e.g. in the EDTPLACETEXTAsyncKeyPress, this gets fired EDTALLOWPOST.Caption := '';) but the component is not updated on the form.
> 
> Why is this, what am I doing wrong?

After setting the value of some control via JavaScript, call IW JavaScript function AddChangedControl(), to indicate that this control has changed, like this:

AddChangedControl(edtAddress.id); (or AddChangedControl("EDTPLACETEXT"))

This should fix this issue.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 20-Jan-2015, at 8:33 AM EST
From: Alexandre Machado
 
Re: After using a components ScriptEvents the components asy  
News Group: embarcadero.public.delphi.thirdpartytools.intraweb
Hi,

No, I want to avoid updating at the moment as I am in the middle of deployment.
IntraWeb Version: 14.0.32

Unless this specific issue has been dealt with in an update?



> {quote:title=Alexandre Machado wrote:}{quote}
> > {quote:title=Justin Philobrow wrote:}{quote}
> > Delphi XE6 and IW XIV (bundled version)
> 
> XIV bundled, ok, but do you have the exact version number? Did you upgrade to latest IW 14.0.37?

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 20-Jan-2015, at 8:20 AM EST
From: Justin Philobrow
 
Re: After using a components ScriptEvents the components asy  
News Group: embarcadero.public.delphi.thirdpartytools.intraweb
> {quote:title=Justin Philobrow wrote:}{quote}
> Delphi XE6 and IW XIV (bundled version)

XIV bundled, ok, but do you have the exact version number? Did you upgrade to latest IW 14.0.37?

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 20-Jan-2015, at 8:06 AM EST
From: Alexandre Machado
 
Re: After using a components ScriptEvents the components asy  
News Group: embarcadero.public.delphi.thirdpartytools.intraweb
Delphi XE6 and IW XIV (bundled version)

By the way I have sent an email to sales to see how I can get my bundled licence version updated to ulitmate, hope they will answer soon.

> {quote:title=Alexandre Machado wrote:}{quote}
> Hi Justin,
> 
> before trying it, can you please tell me your IntraWeb and Delphi versions?
> 
> Best regards

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 20-Jan-2015, at 3:44 AM EST
From: Justin Philobrow
 
Re: After using a components ScriptEvents the components asy  
News Group: embarcadero.public.delphi.thirdpartytools.intraweb
Hi Justin,

before trying it, can you please tell me your IntraWeb and Delphi versions?

Best regards

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 20-Jan-2015, at 3:05 AM EST
From: Alexandre Machado