Calling parent onLoad()

Questions and answers for designing and implementing forms in Servoy

Calling parent onLoad()

Postby caroline.j » Tue Mar 06, 2012 8:52 pm

Hi I'm having a problem calling a forms inherited onLoad method.

Code: Select all
function onLoad(event) {
   databaseManager.setAutoSave(false);
   forms._frmBaseTrains.onLoad(event);
}


This flags the error "method onLoad is undefined", does anyone know how I should do this.

Ok I suspect I'm getting confused - what I'm actually trying to do is trigger the inherited forms onLoad event - can that be done??
Many thanks in anticipation.
Caroline
caroline.j
 
Posts: 81
Joined: Wed Feb 08, 2012 9:25 pm

Re: Calling parent onLoad()

Postby Joas » Thu Mar 08, 2012 2:06 pm

You can use the "_super" keyword for that:
Code: Select all
function onLoad(event) {
   databaseManager.setAutoSave(false);
  _super.onLoad(event);
}
Joas de Haan
Yield Software Development
Need help on your project? yieldsd.com
User avatar
Joas
Site Admin
 
Posts: 842
Joined: Mon Mar 20, 2006 4:07 pm
Location: Leusden, NL

Re: Calling parent onLoad()

Postby caroline.j » Fri Mar 09, 2012 12:20 pm

Many thanks Joas - sorry for the silly question.
caroline.j
 
Posts: 81
Joined: Wed Feb 08, 2012 9:25 pm


Return to Forms

Who is online

Users browsing this forum: No registered users and 5 guests