Tip: Finding All Properties and Methods Available for XPages Components

As any XPages developer (especially one with a history of Notes development) knows, the documentation isn’t as – (ahem) – thorough as it could be. However, there are two great resources that you may not be aware of that are very helpful in finding out the available properties and methods of XPages components.

XPages Controls Documentation

The XPages Controls Documentation on openNTF is an excellent way to find out about properties of XPages components, including Extension Library components. It even includes a hierarchical structure so you can see what properties are inherited.

When I’m looking for a method to access a property value, I generally follow these steps:

  1. Check the Domino Designer Help
  2. Check the XPages Controls Documentation and start guessing what corresponding method names might be, because they’re often consistent. For a property called foo, I’d try getFoo()
  3. Dig into the Java source for the component and review it’s provided and inherited methods via the class hierarchy

Using F4 to Locate Java Class Hierarchy

In this excellent NotesIn9 video (episode 34), Paul Withers shows an invaluable technique for locating the underlying Java objects generated by XPages components and how to track down the source to find the methods that are available.

You can open Package Explorer, review the source of an XPage and look for a reference to creating your component. Then look for the name of the Java class being created, highlight it, and hit F4, which opens that class in the hierarchy view. There, you can view the methods that it implements; you can also go up the hierarchy to find what it inherits from other classes.

It also shows how to use the class name that you’ve located in order to set a variable type so you can get content assist for that object.


4 responses to “Tip: Finding All Properties and Methods Available for XPages Components”

  1. Mark Leusink says :

    Hi Brad,

    Here’s another way: install the XPage Debug Toolbar from OpenNTF. Then, when you’re on an XPage, open the “Inspector” tab, select the component you want to inspect from the dropdown and you’ll be presented with a list of all properties/ methods for that component. The list allows you to drilldown into child elements and contains link to more information. Demo here: http://demo.linqed.eu/debugToolbar/debugToolbar.nsf

    Using the method above you can also inspect any Java beans or global objects like context and facesContext by entering their name directly in the expression field and hitting enter.


  2. Keith Strickland says :

    Another method is to install jd-eclipse into DDE, and then F3 will open a decompiled version of the class.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: