close

Authors


Quick XPages Tip: Use view as variable with caution

chatFrank van der Linden   8 December 2011 17:38:42
Yesterday I was doing some enhancements for the OpenNTF XSnippets project
I encounterd a small problem, who I want to share here.

In the XPages world there are some object always available such as context, database and view.
For my code enhancement I was in need to get the page title.

That should not be a problem, just do: view.getPageTitle()

When I reload the XPage I got an error:
Image:Quick XPages Tip: Use view as variable with caution

So I returned to my XPage in the Domino designer and searched for 'view' and I found the cause.
At the top of the Xpage there was some SSJS code to get the UniversalID of the Snippet document.
Image:Quick XPages Tip: Use view as variable with caution

After I renamed the view variable to view1 and reload the Xpage it works again.

So use the variable view with caution