# Code of a page inserted in a DFrame: Access the current DFrame

Goal: Access, from the code stored in a page inserted in a DFrame, the DFrame object containing the page.

Way: Use 'thisDFrame' keyword

The access to the DFrame object containing the page of the code can be made by the 'thisDFrame' keyword. This possibility allows writing the code included in the page without worrying about the name of the DFrame containing the page.

Example 1 :

In mainPage:

dFrame = new DFrame(parameters)

dFrame.setURL(url)

In a page defined by url and inserted in dFrame:

mainPage.dFrame.submitForm() will work

but

thisDFrame.submitForm() will produce the same result.

Note also that the first way will only work if dFrame has been declared as a global variable in mainPage.