FORM INHERITANCE

Questions and answers for designing and implementing forms in Servoy

FORM INHERITANCE

Postby dlclark » Tue Jan 25, 2022 11:17 pm

Currently working on using Form Inheritance to reduce code complexity in existing application for our Sailing Magazine as a part of eliminating DEPRECATED METHODS, in this case in regards to the use of //application.showFormInDialog(forms.frm_web_resources,-1,-1,-1,-1,'Resource on Web',false,false,'',false )

I created a new form: baseModalDialog.frm and created a creation method:

/**
* public
* @param {JSRecord | JSFoundSet} requestedFoundset
* @param {String} windowTitle
* @properties={typeid:24,uuid:"EDAE4C99-CF9A-481E-9F98-3E2E24016683"}
*/
function openModal(requestedFoundset, windowTitle ) {
// ABSTRACT FORM

if(requestedFoundset) {

foundset: requestedFoundset ;
}
// OPEN MODAL

var win = application.createWindow( controller.getName(), JSWindow.MODAL_DIALOG);
win.title = windowTitle;

win.show(this);

// Note: Execution halts here until after return from modal dialog


win.hide();

}

Then set forms.frm_web_resources to be extended from the new form. This all seems to look good.
But when I create a reference this from another form. The method openModal() does not CODE COMPLETE.

I can only get it to CODE COMPLETE, by creating a method in the CHILD FORM and calling _super.openModal( foundset, windowTItle) from it. That seems to make inheritance useless.


Any ideas - perhaps I have not done something that is required to make this work properly.

Daryl()
dlclark
 
Posts: 38
Joined: Sat Jan 08, 2022 5:39 pm

Re: FORM INHERITANCE

Postby dlclark » Tue Jan 25, 2022 11:44 pm

Now that is ODD, not sure what changed, but it started working when I added another FORM and set its inheritance to baseModalDialog ...
dlclark
 
Posts: 38
Joined: Sat Jan 08, 2022 5:39 pm


Return to Forms

Who is online

Users browsing this forum: No registered users and 8 guests