Pages

Thursday, November 7, 2013

Get class name of Components in XPage

Its very easy to obtain the class name of components in Xpages. The only issue is that, its difficult if you dont know how :P

Well for starters (like me) drag and drop a control on to an XPage. Give it a name say "MyControl"

Now add a label to the XPage where you performed the above mentioned difficult steps and use the following code to compute its label

getComponent("MyControl").getClass().getName()

In my case I tried it with a link object and got the following stuffs on my screen




If you feel curious about understanding (most likely about simply knowing) controls better you can refer to the control documentation. Following post speaks about its where abouts.

http://xcellerant.net/2013/09/17/tip-finding-all-properties-and-methods-available-for-xpages-components/

No comments:

Post a Comment