FoxInCloud
Which code do you have in xxx.js?
Gravatar is a globally recognized avatar based on your email address. Which code do you have in xxx.js?
  FoxInCloud Support - Thierry N.
  All
  Oct 30, 2014 @ 04:54am
Hi,

Recently we realized that,
as FoxInCloud executes xxx.js before the form.js,
xxx.js can't override what the standard JavaScript in form.js does.

Questions:

1- what kind of code do you have in xxx.js?

2- if xxx.js executes after form.js, would it break something in your app?

thanks,

Gravatar is a globally recognized avatar based on your email address. Re: Which code do you have in xxx.js?
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Oct 30, 2014 @ 11:00pm
It would not break anything, it might be helpful. I am not sure what ramifications it might have though.


Hi,

Recently we realized that,
as FoxInCloud executes xxx.js before the form.js,
xxx.js can't override what the standard JavaScript in form.js does.

Questions:

1- what kind of code do you have in xxx.js?

2- if xxx.js executes after form.js, would it break something in your app?

thanks,

Gravatar is a globally recognized avatar based on your email address. Re: Which code do you have in xxx.js?
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Oct 31, 2014 @ 03:10pm
Another thought: we like to add js effects to various controls, which we do via wchtmlgen or by adding a script and class. It might be useful is xxx.js ran after form.js, we could override methods.


Hi,

Recently we realized that,
as FoxInCloud executes xxx.js before the form.js,
xxx.js can't override what the standard JavaScript in form.js does.

Questions:

1- what kind of code do you have in xxx.js?

2- if xxx.js executes after form.js, would it break something in your app?

thanks,

Gravatar is a globally recognized avatar based on your email address. Re: Which code do you have in xxx.js?
  FoxInCloud Support - Thierry N.
  Tuvia Vinitsky
  Nov 3, 2014 @ 04:08am
OK, looks fine, implemented, included in the next beta

you can test it now:

modi comm awServer

protected procedure wFormStandardPage_Output_

&& replace
tcScript = this.cawJSinc(c2Words(;
m.this.cApp + '.js';
, ',';
, m.tcScript;
))

&& by
tcScript = this.cawJSinc(c2Words(;
m.tcScript;
, ',';
, m.this.cApp + '.js';
))


Another thought: we like to add js effects to various controls, which we do via wchtmlgen or by adding a script and class. It might be useful is xxx.js ran after form.js, we could override methods.

Hi,

Recently we realized that,
as FoxInCloud executes xxx.js before the form.js,
xxx.js can't override what the standard JavaScript in form.js does.

Questions:

1- what kind of code do you have in xxx.js?

2- if xxx.js executes after form.js, would it break something in your app?

thanks,



-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: Which code do you have in xxx.js?
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Nov 3, 2014 @ 06:50am
Will try and report back.


OK, looks fine, implemented, included in the next beta

you can test it now:

modi comm awServer

protected procedure wFormStandardPage_Output_

&& replace
tcScript = this.cawJSinc(c2Words(;
m.this.cApp + '.js';
, ',';
, m.tcScript;
))

&& by
tcScript = this.cawJSinc(c2Words(;
m.tcScript;
, ',';
, m.this.cApp + '.js';
))


Another thought: we like to add js effects to various controls, which we do via wchtmlgen or by adding a script and class. It might be useful is xxx.js ran after form.js, we could override methods.

Hi,

Recently we realized that,
as FoxInCloud executes xxx.js before the form.js,
xxx.js can't override what the standard JavaScript in form.js does.

Questions:

1- what kind of code do you have in xxx.js?

2- if xxx.js executes after form.js, would it break something in your app?

thanks,



Gravatar is a globally recognized avatar based on your email address. Re: Which code do you have in xxx.js?
  FoxInCloud Support - Thierry N.
  Tuvia Vinitsky
  Nov 4, 2014 @ 04:54am
To override what the standard form.js does, one can also use awHTML.cScriptJSAdd_() in .wcHTMLgen():
.cScriptJSAdd_() appends JavaScript at the end of form.js rather that at current location in JavaScript generation flow:

procedure pgf.wcHTMLgen
LPARAMETERS toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTML && {en} awHTMLgen instance {fr} instance de awHTMLgen && [.F.] {en} render container's inner HTML {fr} Rendre l'intérieur du conteneur

local cJS

text to cJS textmerge noshow flags 1
if (window.location.href.endsWith('?alt')){
var ntop = 0;
$('<<this.wcID>>').aTabs.each(function(tab, idx){
tab.setStyle({left: 0, top: ntop + 'px'});
ntop += tab.measure('height');
});
}
endtext

m.toHTMLgen.cScriptJSadd_(m.cJS) && append JS after default form's JS



Will try and report back.


OK, looks fine, implemented, included in the next beta

you can test it now:

modi comm awServer

protected procedure wFormStandardPage_Output_

&& replace
tcScript = this.cawJSinc(c2Words(;
m.this.cApp + '.js';
, ',';
, m.tcScript;
))

&& by
tcScript = this.cawJSinc(c2Words(;
m.tcScript;
, ',';
, m.this.cApp + '.js';
))


Another thought: we like to add js effects to various controls, which we do via wchtmlgen or by adding a script and class. It might be useful is xxx.js ran after form.js, we could override methods.

Hi,

Recently we realized that,
as FoxInCloud executes xxx.js before the form.js,
xxx.js can't override what the standard JavaScript in form.js does.

Questions:

1- what kind of code do you have in xxx.js?

2- if xxx.js executes after form.js, would it break something in your app?

thanks,





-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: Which code do you have in xxx.js?
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Nov 4, 2014 @ 10:32am
I used that idea many times, but forgot about it. The problem is that FiC has so many great features, I cannot remember them all!


To override what the standard form.js does, one can also use awHTML.cScriptJSAdd_() in .wcHTMLgen():
.cScriptJSAdd_() appends JavaScript at the end of form.js rather that at current location in JavaScript generation flow:

procedure pgf.wcHTMLgen
LPARAMETERS toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTML && {en} awHTMLgen instance {fr} instance de awHTMLgen && [.F.] {en} render container's inner HTML {fr} Rendre l'intérieur du conteneur

local cJS

text to cJS textmerge noshow flags 1
if (window.location.href.endsWith('?alt')){
var ntop = 0;
$('').aTabs.each(function(tab, idx){
tab.setStyle({left: 0, top: ntop + 'px'});
ntop += tab.measure('height');
});
}
endtext

m.toHTMLgen.cScriptJSadd_(m.cJS) && append JS after default form's JS



Will try and report back.


OK, looks fine, implemented, included in the next beta

you can test it now:

modi comm awServer

protected procedure wFormStandardPage_Output_

&& replace
tcScript = this.cawJSinc(c2Words(;
m.this.cApp + '.js';
, ',';
, m.tcScript;
))

&& by
tcScript = this.cawJSinc(c2Words(;
m.tcScript;
, ',';
, m.this.cApp + '.js';
))


Another thought: we like to add js effects to various controls, which we do via wchtmlgen or by adding a script and class. It might be useful is xxx.js ran after form.js, we could override methods.

Hi,

Recently we realized that,
as FoxInCloud executes xxx.js before the form.js,
xxx.js can't override what the standard JavaScript in form.js does.

Questions:

1- what kind of code do you have in xxx.js?

2- if xxx.js executes after form.js, would it break something in your app?

thanks,





Gravatar is a globally recognized avatar based on your email address. Re: Which code do you have in xxx.js?
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Nov 4, 2014 @ 10:33am
The only thing I can find that changed is the xxx.js order, but now when rendering the pagerframe I get a "not found" error on this line:
<<a href="http://localhost/towplus/bin/wc.dll?IntuiCat~MethExec~&MethAddr=InitControlsInet&ObjAddr=tow1_scx&PageInit=true&UserID=&nReq=1&lastKey=0&sync=true&version=2.1" target="top" >>http://localhost/towplus/bin/wc.dll?IntuiCat~MethExec~&MethAddr=InitControlsInet&ObjAddr=tow1_scx&PageInit=true&UserID=&nReq=1&lastKey=0&sync=true&version=2.1<</a>>


To override what the standard form.js does, one can also use awHTML.cScriptJSAdd_() in .wcHTMLgen():
.cScriptJSAdd_() appends JavaScript at the end of form.js rather that at current location in JavaScript generation flow:

procedure pgf.wcHTMLgen
LPARAMETERS toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTML && {en} awHTMLgen instance {fr} instance de awHTMLgen && [.F.] {en} render container's inner HTML {fr} Rendre l'intérieur du conteneur

local cJS

text to cJS textmerge noshow flags 1
if (window.location.href.endsWith('?alt')){
var ntop = 0;
$('').aTabs.each(function(tab, idx){
tab.setStyle({left: 0, top: ntop + 'px'});
ntop += tab.measure('height');
});
}
endtext

m.toHTMLgen.cScriptJSadd_(m.cJS) && append JS after default form's JS



Will try and report back.


OK, looks fine, implemented, included in the next beta

you can test it now:

modi comm awServer

protected procedure wFormStandardPage_Output_

&& replace
tcScript = this.cawJSinc(c2Words(;
m.this.cApp + '.js';
, ',';
, m.tcScript;
))

&& by
tcScript = this.cawJSinc(c2Words(;
m.tcScript;
, ',';
, m.this.cApp + '.js';
))


Another thought: we like to add js effects to various controls, which we do via wchtmlgen or by adding a script and class. It might be useful is xxx.js ran after form.js, we could override methods.

Hi,

Recently we realized that,
as FoxInCloud executes xxx.js before the form.js,
xxx.js can't override what the standard JavaScript in form.js does.

Questions:

1- what kind of code do you have in xxx.js?

2- if xxx.js executes after form.js, would it break something in your app?

thanks,





Gravatar is a globally recognized avatar based on your email address. Re: Which code do you have in xxx.js?
  FoxInCloud Support - Thierry N.
  Tuvia Vinitsky
  Nov 5, 2014 @ 12:49am
Looks more like an opportunity than a problem, no?
;)


I used that idea many times, but forgot about it. The problem is that FiC has so many great features, I cannot remember them all!


-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: Which code do you have in xxx.js?
  FoxInCloud Support - Thierry N.
  Tuvia Vinitsky
  Nov 5, 2014 @ 12:51am
difficult to figure out what you mean ...
where do you get that error? browser, server?
what is the exact message?


The only thing I can find that changed is the xxx.js order, but now when rendering the pagerframe I get a "not found" error on this line:
<<span class="elements"><a href="http://localhost/towplus/bin/wc.dll?IntuiCat~MethExec~&MethAddr=InitControlsInet&ObjAddr=tow1_scx&PageInit=true&UserID=&nReq=1&lastKey=0&sync=true&version=2.1" target="top" >http://localhost/towplus/bin/wc.dll?IntuiCat~MethExec~&MethAddr=InitControlsInet&ObjAddr=tow1_scx&PageInit=true&UserID=&nReq=1&lastKey=0&sync=true&version=2.1<<span class="elements"></a>>


To override what the standard form.js does, one can also use awHTML.cScriptJSAdd_() in .wcHTMLgen():
.cScriptJSAdd_() appends JavaScript at the end of form.js rather that at current location in JavaScript generation flow:

procedure pgf.wcHTMLgen
LPARAMETERS toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTML && {en} awHTMLgen instance {fr} instance de awHTMLgen && [.F.] {en} render container's inner HTML {fr} Rendre l'intérieur du conteneur

local cJS

text to cJS textmerge noshow flags 1
if (window.location.href.endsWith('?alt')){
var ntop = 0;
$('').aTabs.each(function(tab, idx){
tab.setStyle({left: 0, top: ntop + 'px'});
ntop += tab.measure('height');
});
}
endtext

m.toHTMLgen.cScriptJSadd_(m.cJS) && append JS after default form's JS



Will try and report back.


OK, looks fine, implemented, included in the next beta

you can test it now:

modi comm awServer

protected procedure wFormStandardPage_Output_

&& replace
tcScript = this.cawJSinc(c2Words(;
m.this.cApp + '.js';
, ',';
, m.tcScript;
))

&& by
tcScript = this.cawJSinc(c2Words(;
m.tcScript;
, ',';
, m.this.cApp + '.js';
))


Another thought: we like to add js effects to various controls, which we do via wchtmlgen or by adding a script and class. It might be useful is xxx.js ran after form.js, we could override methods.

Hi,

Recently we realized that,
as FoxInCloud executes xxx.js before the form.js,
xxx.js can't override what the standard JavaScript in form.js does.

Questions:

1- what kind of code do you have in xxx.js?

2- if xxx.js executes after form.js, would it break something in your app?

thanks,







-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: Which code do you have in xxx.js?
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Nov 5, 2014 @ 10:56am
Sorry. Error in browser when pageframe instantiates, error is "http protocol error : not found". Firebug shows the "not found" is the url I gave you.


difficult to figure out what you mean ...
where do you get that error? browser, server?
what is the exact message?


The only thing I can find that changed is the xxx.js order, but now when rendering the pagerframe I get a "not found" error on this line:
<<span class="elements"><a href="http://localhost/towplus/bin/wc.dll?IntuiCat~MethExec~&MethAddr=InitControlsInet&ObjAddr=tow1_scx&PageInit=true&UserID=&nReq=1&lastKey=0&sync=true&version=2.1" target="top" >http://localhost/towplus/bin/wc.dll?IntuiCat~MethExec~&MethAddr=InitControlsInet&ObjAddr=tow1_scx&PageInit=true&UserID=&nReq=1&lastKey=0&sync=true&version=2.1<<span class="elements"></a>>


To override what the standard form.js does, one can also use awHTML.cScriptJSAdd_() in .wcHTMLgen():
.cScriptJSAdd_() appends JavaScript at the end of form.js rather that at current location in JavaScript generation flow:

procedure pgf.wcHTMLgen
LPARAMETERS toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTML && {en} awHTMLgen instance {fr} instance de awHTMLgen && [.F.] {en} render container's inner HTML {fr} Rendre l'intérieur du conteneur

local cJS

text to cJS textmerge noshow flags 1
if (window.location.href.endsWith('?alt')){
var ntop = 0;
$('').aTabs.each(function(tab, idx){
tab.setStyle({left: 0, top: ntop + 'px'});
ntop += tab.measure('height');
});
}
endtext

m.toHTMLgen.cScriptJSadd_(m.cJS) && append JS after default form's JS



Will try and report back.


OK, looks fine, implemented, included in the next beta

you can test it now:

modi comm awServer

protected procedure wFormStandardPage_Output_

&& replace
tcScript = this.cawJSinc(c2Words(;
m.this.cApp + '.js';
, ',';
, m.tcScript;
))

&& by
tcScript = this.cawJSinc(c2Words(;
m.tcScript;
, ',';
, m.this.cApp + '.js';
))


Another thought: we like to add js effects to various controls, which we do via wchtmlgen or by adding a script and class. It might be useful is xxx.js ran after form.js, we could override methods.

Hi,

Recently we realized that,
as FoxInCloud executes xxx.js before the form.js,
xxx.js can't override what the standard JavaScript in form.js does.

Questions:

1- what kind of code do you have in xxx.js?

2- if xxx.js executes after form.js, would it break something in your app?

thanks,







Gravatar is a globally recognized avatar based on your email address. Re: Which code do you have in xxx.js?
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Nov 5, 2014 @ 10:56am
Yes!


Looks more like an opportunity than a problem, no?
;)


I used that idea many times, but forgot about it. The problem is that FiC has so many great features, I cannot remember them all!


Gravatar is a globally recognized avatar based on your email address. Re: Which code do you have in xxx.js?
  FoxInCloud Support - Thierry N.
  Tuvia Vinitsky
  Nov 6, 2014 @ 12:54am
OK, then it's better to stick with awHTMLgen.cScriptJSAdd_()

Calling awHTMLgen.cScriptJSAdd_() from aw*.wcHTMLgen():
- adds JavaScript instructions at the end of form.js, after generated JavaScript,
- makes it easy to get objects HTML ids and classes dynamically,
- as it (re)executes at each form startup, this JavaScript is dynamic, eg. adapts to objects and/or class renaming,
- all JavaScript specific to a form is in a single location: the 'form.js' file

xxx.js should only be used for application-wide JavaScript, IOW JavaScript that does not depend on a specific form.

We've just updated FAS version 2.10beta; to download this update, just click on the notification email link.

Sorry. Error in browser when pageframe instantiates, error is "http protocol error : not found". Firebug shows the "not found" is the url I gave you.


-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: Which code do you have in xxx.js?
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Nov 6, 2014 @ 02:08am
Good reasons it is easier to use xxx.js: easier to debug, no need to regenerate HTML/JS or touch VFP form , can just change xxx.js and call form. also easier to debug in terms of reading and editing.

I am going to see what happens with this error if I put back xxx.js being called before form.js. Then I will try calling something from xxx.js but only after the form is loaded. The other option is to create an external js file, put what I would have put in xxx.js in there.


OK, then it's better to stick with awHTMLgen.cScriptJSAdd_()

Calling awHTMLgen.cScriptJSAdd_() from aw*.wcHTMLgen():
- adds JavaScript instructions at the end of form.js, after generated JavaScript,
- makes it easy to get objects HTML ids and classes dynamically,
- as it (re)executes at each form startup, this JavaScript is dynamic, eg. adapts to objects and/or class renaming,
- all JavaScript specific to a form is in a single location: the 'form.js' file

xxx.js should only be used for application-wide JavaScript, IOW JavaScript that does not depend on a specific form.

We've just updated FAS version 2.10beta; to download this update, just click on the notification email link.

Sorry. Error in browser when pageframe instantiates, error is "http protocol error : not found". Firebug shows the "not found" is the url I gave you.


Gravatar is a globally recognized avatar based on your email address. Re: Which code do you have in xxx.js?
  FoxInCloud Support - Thierry N.
  Tuvia Vinitsky
  Nov 6, 2014 @ 03:49am
Good reasons it is easier to use xxx.js: easier to debug, no need to regenerate HTML/JS or touch VFP form , can just change xxx.js and call form. also easier to debug in terms of reading and editing.

Personal preferences maybe,
note: with the latest version of firebug you can use 'pretty print' and set a break point in form.js; this break point survives a page reload:

I am going to see what happens with this error if I put back xxx.js being called before form.js. Then I will try calling something from xxx.js but only after the form is loaded. The other option is to create an external js file, put what I would have put in xxx.js in there.

To me, this error is due to a bin/wc.dll call while the 'bin' segment is hidden in IIS (default setting)


-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: Which code do you have in xxx.js?
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Nov 6, 2014 @ 08:17am
Thanks for the firebug tip, definitely a big help.


Good reasons it is easier to use xxx.js: easier to debug, no need to regenerate HTML/JS or touch VFP form , can just change xxx.js and call form. also easier to debug in terms of reading and editing.

Personal preferences maybe,
note: with the latest version of firebug you can use 'pretty print' and set a break point in form.js; this break point survives a page reload:

I am going to see what happens with this error if I put back xxx.js being called before form.js. Then I will try calling something from xxx.js but only after the form is loaded. The other option is to create an external js file, put what I would have put in xxx.js in there.

To me, this error is due to a bin/wc.dll call while the 'bin' segment is hidden in IIS (default setting)


© 1996-2024