Showing posts with label development tools. Show all posts
Showing posts with label development tools. Show all posts

Monday, February 1, 2010

Another small update on the XPages API Inspector

I've added a clear-button, and a subheader with the toString-value that's visible if the expression corresponds with a server side object.

@Now()


>> Download tool

>> Original post with description

Wednesday, January 13, 2010

XPages: Developer Tool - Deep dive into the XPages API

If you work on XPages, and are going to download only one demoapp from me in your life, this is the one you should download (at least compared to my earlier apps).

On several occasions, Domino Designer falls short when it comes to developing XPages. On those occasions I try to dive into the XPages API. I used to create a computed field with the value of typeof getComponent( 'component-id' ). This gave me the class name of the object. Then I declared a variable with the type of the class. This gave me the methods available for the component type. E.g.
var field:com.ibm.xsp.component.xp.XspInputText = new com.ibm.xsp..
Today, working on inspecting an Exception object, trying to find a way to print ServerSide JavaScript stack trace (you only get the Java stack trace), I came up with an idea that will save me a lot of time in the future of XPage development. I didn't find a pay to get the JS stack trace, if you're wondering.

It started with a simple field that you put a class name into. This gave you the properties and methods of the class.

Then I added the functionality to type the name of a global object (e.g. facesContext), and it printed the properties/methods of that object.

Then, while writing/preparing this blog post, I remembered my client side getClientId/getComponent. After a little bit of copy/paste/modify, I ended up with a custom control that lets you select any control (including event handlers/etc) on the page from a combobox (just add the custom control to the XPage you're developing), and get the methods and properties of the corresponding class in the XPages API.

A couple of screen captures (animated gif):


>> Download Demoapp with custom control (28K zip)

In theory, the custom control lets you post commands to the server, so remember to modify the ACL after you download!

Share and enjoy!