Accessing advanced properties from an XPage component

A question from the business partner forum was asked how to access a components preference, the ones entered in the Advanced Preferences panel in the Composite Application Editor.  I got this tip from Padraic Edwards on the XPages team.  This should help anyone wanting to get an XPage component into a composite or an Eclipse based perspective.

I edited my XPage component to include a new property named “BobsValue” with a value of “The Value is RED”:

xpage-comp-props-1

What you have to do in the XPage application is access it using the context API’s.  First thing you need to do however is add a parameter with the same name in the component definition.

xpage-comp-props-2

Now when you access the property in your XPage event or page you simply call the method as follows:

context.getComponentParameter("BobsValue");

Here I just printed the value to a dynamic label on the XPage component:

xpage-comp-props-3

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s