Child pages
  • Inheritance Model

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Form inheritance is to extend a form with a other form this will give the original form all the methods/variables/elements/properties of the extending form.
The inheritance is not limited to 1 level, for example if you have form a, form b and form c you can extend form b with a and c with b form c wil then have all the methods/variables/elements/properties of form a, b and c.

Overwrite methods

On the child form you will inherit all the methods of the super form. You can overwrite this method, when you do this servoy will generate a method for you with a call of the super in it. Image Added
Image Added
In the generated method you will see _super.newRecord(event) this will call the original method on the super form. You can remove this if you don't want to call this method anymore or you can put code before of after the call, if you put it after don't forget to move the 'return'.

Sample of code before:

Code Block

function newRecord(event) {
	vMode = 'new Record'
	return _super.newRecord(event)
}

Sample of code after:

Code Block

function newRecord(event) {
	_super.newRecord(event)
	city = 'Amersfoort'
	return 
}

other options

_super keyword

...