Domino Upgrade

VersionSupport end
5.0
6.0
6.5
7.0
Upgrade to 8.5x now!
(see the full Lotus lifcyle) To make your upgrade a success use the Upgrade Cheat Sheet. Contemplating to replace Notes? You have to read this!

Search

Reference

1. Learn XPages online
2. Communicate with IBMers and Lotus Experts using Sametime

About Me

I am the "IBM Collaboration & Productivity Advisor" for IBM Asia Pacific. I'm based in Singapore.
Reach out to me via:
Follow notessensei on Twitter
(posts)
Skype
Sametime
IBM
Facebook
LinkedIn
XING
Amazon Store
Amazon Kindle

Mobile tag

Twitter

Languages

Other languages on request.

Visitors

Useful Tools

Get Firefox
Use OpenDNS
The support for Windows XP is coming to an end and has . Time to consider an alternative to move on. sounds like a lot of time, but, like an object in a mirror, it is closer than you think.

« Upcoming XPages workshops in AP | Main| XPages Workshop Impressions from Bangkok »

XPages Custom controls parameter definitions

One of the very cool features in XPages is the ability to create your own custom controls. While on the first look one could say "well, they are just subforms with a new name" the second look shows bigger differences:
  • Custom controls can appear more than once on a page, subforms only once (yes there was the possibility to add a subform twice if it didn't contain any fields, but that was not intended)
  • Custom controls are self aware: they "know" what is inside and what is outside
  • Custom controls have parameters. You can define parameters that the custom control will address as CompositeData.[parameterName] and the hosting pages address as [controlName].[parameterName]
When you look at the source code of a page you can clearly see the parameters you might have set for a custom control. However when you look at the source code of your custom control, you won't see any definition. Puzzled me for a moment, so I asked the master. At the very end XPages is a JFS application. In JFS a custom control has 2 files (at least): the code and the definition. XPages shields you from the complexity by allowing you to edit everything in one UI. But if you *really* want to have a look, add the Navigator window to your Domino Designer perspective and navigate to the custom control directory. Here you will find MyControl.xsp as well as MyControl.xsp-config. If you want to understand what the containing XML is all about, take a peek at a JSF tutorial

Comments

Gravatar Image1 - any idea where I can get my hands on a definitive guide to the XSP EL? I'm sick of trying to guess what's allowed and what's not...

Gravatar Image2 - Nice post Stephen. However, can you expand on how to add the Navigator window from the designer?

Thanks

Gravatar Image3 - Thanks for your help.

Gravatar Image4 - @ Jim:
Window - Show Eclipse Views ... Others (or Alt+Shift+Q Q)
Emoticon stw

Gravatar Image5 - Thank you Stephan. I had stumbled upon it.

The article was great. however still making sense of the JSF knowledge being useful for xpages.

Have you found the EL expressions inside xpages beneficial? Anywhere I can find more information on what can be done with EL that might be better than server side javascript. I am familiar with EL from the JSP world using them with the scope variables.

Thanks

Gravatar Image6 - Hi Stephan

I'm struggling a bit with the final method you outlined.
I have a custom control that allows a property to be set from a list of values.
If I put a computed field on the custom control I can display the property using CompositeData.period as you have said. (period is the name of the property.)
If however I drop this Custom Control onto either another Custom Control or straight onto an Xpage I struggle. I give the Custom Control and ID of periodSelector. If I then try and give a computed field a value of periodSelector.period I get a runtime error 'Reference error: 'periodSelector' not found'

Hope you can help

Nick

Gravatar Image7 - @Nick: Working eMail required! Emoticon

Post A Comment

Please note: Comments without a valid and working eMail address will be removed. This is my site, so I decide what stays here and what goes.

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::rolleyes:;-)

Disclaimer

This site is in no way affiliated, endorsed, sanctioned, supported, nor enlightened by Lotus Software nor IBM Corporation. I may be an employee, but the opinions, theories, facts, etc. presented here are my own and are in now way given in any official capacity. In short, these are my words and this is my site, not IBM's - and don't even begin to think otherwise. (Disclaimer shamelessly plugged from Rocky Oliver)
© 2003 - 2012 Stephan H. Wissel - all rights reserved as listed here: Creative Commons License
Unless otherwise labeled by its originating author, the content found on this site is made available under the terms of an Attribution/NonCommercial/ShareAlike Creative Commons License, with the exception that no rights are granted -- since they are not mine to grant -- in any logo, graphic design, trademarks or trade names of any type.