Forms.getFormByName() This page was last modified over 30 day(s) ago and has 1 comment(s)


Back to Forms Class Summary

Availability
Windows, Mac OSX

Usage
mdm.Forms.getFormByName(formName:String):Object

Parameters
formName:String [required] the name of form as given in Zinc builder or as given when using mdm.Application.createForm method

Returns
instance of object that represents application window (form) at runtime

Description
IMPORTANT: getFormByName(...) method is the only possible programmatic way to get access to {mdm} script form instance. AS1/AS2 old syntax like mdm.Forms["FORM_NAME"] or mdm.Forms.thisForm are not supported at this release

Notes
You could handle situation when getFormByName( ) do not return refence to object, that is:

var form = mdm.Forms.getFormByName("SomeFormName");

as handling point for error:

if(!form)
{
// handle error
// e.g. misspelled form name
}

Example Code
mdm.Forms.getFormByName("MainForm").minimize();

//
var form = mdm.Forms.getFormByName("OtherForm")
if(form) form.maximize();

mdm.Forms Class Example Downloads
No Example Downloads Available


User Comment by Jens Eckervogt on 28th July 2014 - 18:40
Wait! I see like they have tested under Linux, It works fine like post from http://www.mdmforum.com/forum/index.php?showtopic=29693&view=findpost&p=126711

Is it document issus?
mdm.Forms.getFormByName("sampleForm") works fine under Linux yet.

Registered Users must be logged in to 'MyAccount' to add a Comment - Log In Here
  After Logging In, Click Here to Refresh This Page