dominoGuru.com

Your Development & Design Resource

Themes syntax for XPage Controls

Those of us who have jumped feet-first into the wonderful world of Domino Web Application Development with XPages may or may not have gotten into Themes. See - while XPages allows for RAD Developers to quickly and easily create up-to-date web application user interfaces for NotesDatabases - those of us (and yes, I'm certainly one of those people) who want complete and absolute control over the Domino-rendered markup have finally gotten their wish with the advent of Themes.

By using Themes in our XPage application endeavors, we can control not only which Resources (Stylesheets, Client JavaScript Libraries, etc.) are included in our XPage, but we can control each attribute for an XPage Control object.

Yeah - that sounds cool, but "but what does that mean" right? Well, after defining a Theme for your NotesApplication, we can either create custom ThemeIDs across multiple Control object types or target specific Controls and modify XPage Control attributes like styleClass. Best part - application of Theme overwrites can be conditional via the JavaScript Expression Language!!!

Okay... this might still be a little fuzzy. Let's go with an example:

Let's say we wanted to state that all Computed Field Objects in our XPage will have the styleClass (which renders as the class attribute in the web browser client) set to "computed".

Your Theme code entry might look something like this:

<control target="xsp" override="true">
 <name>Text.ComputedField</name>
 <property mode='override'>
  <name>styleClass</name>
  <value>computed</value>
 </property>
</control>

This will take a Computed Field and force the styleClass to "computed". When rendered, the XHTML markup sent to the browser will have a SPAN element with it's class set to "computed"!

Some of you might be wondering where I came up with the XPage Control name Text.ComputedField. Well, outside of the Domino Designer in Eclipse Help Contents (which can be a pain for those used to the Domino Help files), a complete list of XPage Control objects is located on your system!

The wedstandard.theme Theme - which can be found in your <Lotus Notes Client Installation Directory>\xsp\nsf\themes Directory - contains a complete list of all XPage Control objects. Simply open this file with your preferred XML editor or create a copy of this file and rename the copy's extension to either xml or txt.

So go through the webstandard.theme and start using Themes - the application of controlled usage via the JavaScript Expressions language and the ability to define cross-Control ThemeIDs may finally be that perfect marriage of RAD Web Development + Complete Control that a lot of us have been begging for (or hacking around) for years now!


About the author: Chris Toohey

Thought Leadership, Web & Mobile Application Development, Solutions Integration, Technical Writing & Mentoring

A published developer and webmaster of dominoGuru.com, Chris Toohey specializes in platform application development, solutions integration, and evangelism of platform capabilities and best practices.



More from dominoGuru.com


dominoGuru.com is powered by IBM Notes Domino XPages & hosted by Prominic.NET

Contact Us

Use our Contact / Feedback form or one of these email addresses:

Creative Commons License

Except where otherwise noted, dominoGuru.com by Chris Toohey is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.