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:
- Check the Domino Designer Help
- 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()
- 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.