html

How to add non breaking spaces to your XPages

Often when you’re designing a web page, you’ll need a space between elements (such as two field labels for example). Most of the time you should solve your UI issues with CSS, but sometimes that is not the correct answer. Enter   this is a the classic non breaking space that you can use in HTML.

Unfortunately you cannot use that in your XPages source because it is not valid XML, so instead, we just have to use:

 

160 is the decimal character code for the non breaking space and use of character code markup like this is valid in XML.

A very simple tip, but a useful one none the less.

Thing learned for the day

I’m sure this is well known already, but it was a new one on me.

I have a web form that has a tabular layout of fields. But at the end of each row is a field that mustn’t ever get focus (for reasons that are to boring to go into), so I have an onFocus Javascript event in those fields that immediately blurs the focus if the user tries to get into it. All fine and dandy until you try and tab your way around the table, when you reach the end of each row, we end up with no field having focus.

The thing I learned (was told by an exasperated web designer) is that you can set the “tabindex” of a field to -1. If you do this then it is effectively excluded from the tab order of the form as you use the keyboard to navigate around.

Cue much punching of the sky as we knock another bug off the list for the application I’m working on at the moment. It’s the little victories that count!