Forum  General Visual ...  How do I...?  Javascript Main VWG functions redefinition are being renamed
Previous Previous
 
Next Next
New Post 12/12/2007 9:40 AM
Resolved
  victor
33 posts
No Ranking


Javascript Main VWG functions redefinition are being renamed 
Modified By roy.goffer  on 9/5/2010 7:38:37 AM)

For many reasons i've been reporting to the forum, i had the only way to override some VWG javascript core functions as Events_ExecuteRaiseEvents() in some especific custom control, mainly for a AJAX server poll. All was working OK and i've already done the 80% of the web applicatioin.

Now i've updated to 5.83 VWG version cause i need the OnKeyDown behaviour , and i've saw that issues are solved on 5.83.

For my surpise i've noted that my AJAX server polling wasn't working and checking out the javascript code for the aplication i've seen that my overrided functions have been renamed . in example Events_ExecuteRaiseEvents1() , so now i'm using the standard one's from VWG when i need mines.

is there any way to avoid this renaiming or any workarround to get my web application working with the newer version?

I already can modify the functions on the original VWG javascript source Code, but we chose this way (overriding one) cause we will easily update to the newer versions of VWG without making any adaptation on our application code.

Please let me know some way to solve my situation.

many thanks.

 

 
New Post 12/13/2007 6:08 AM
  Guy
2346 posts
1st Level Poster




Re: Javascript Main VWG functions redefinition are being renamed 

Hi,

To avoid the VWG compiler from scoping your methods you can simply use a non standard naming convention like EventsExecuteRaiseEvents. If you do want to override the function, you should use the following syntax which will not consider your function as a new instance:

window.Events_ExecuteRaiseEvents = function(){
    // do some code
}

You can also simulate override with base call by doing as following:

window.Events_ExecuteRaiseEventsBase = window.Events_ExecuteRaiseEvents;

window.Events_ExecuteRaiseEvents = function(){
    // do some code

   // Call the base method
   window.Events_ExecuteRaiseEventsBase();
}

Cheers,
Guy

 
New Post 12/17/2007 2:55 AM
  victor
33 posts
No Ranking


Re: Javascript Main VWG functions redefinition are being renamed 
Lot of thanks Guy,

I'm using firts method cause i want to rewrite, better than override with base call, the function. It works as before.

Great job for VWG team :)
 
New Post 1/30/2008 4:59 PM
  michael
49 posts
No Ranking


Re: Javascript Main VWG functions redefinition are being renamed 
Does everyone else also see the post at the top of the forum, seemingly forever? Is it stickied for some reason? Folder is red, whatever that means.
 
New Post 2/13/2008 4:33 AM
  nicorac
49 posts
coolsoft.altervista.org
No Ranking


Re: Javascript Main VWG functions redefinition are being renamed 
 michael wrote
Does everyone else also see the post at the top of the forum, seemingly forever? Is it stickied for some reason? Folder is red, whatever that means.

Same here.
Please unstick this post because it always appear as first...
 
Previous Previous
 
Next Next
  Forum  General Visual ...  How do I...?  Javascript Main VWG functions redefinition are being renamed
Azure banner
.NET Web, Cloud and Mobile application delivery platform | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2011 Visual WebGui®       Visual WebGui weblog on ASP.NET Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS