Monday, March 28, 2011

Small bugfix in the CKEditor integration for XPages demoapp

When you tried to upload more than one file at once (e.g. one attachment and an image), only the first file uploaded successfully.

This bug has now been fixed.

The Domino part of the demo requires Dojo 1.4.1 (Domino 8.5.2 server), as it's hard coded in the HTML header. Modify it to suit your environment.

>> Download demoapp

Thursday, March 3, 2011

Repeat Controls and Multivalue fields

There was a small discussion over at Julian's blog regarding multivalue fields and repeat controls. I knew that it was possible to bind Javascript objects and arrays to input fields inside a repeat control using EL syntax.

I got a little curious, and decided to test if the same was possible for a multivalue field. It turns out it's just as easy.

Instead of my regular demoapps, I'll post source code for the test XPage I made. It's bound to a form with one field, named field (don't name any field field in real applications!!).

To test it, create a form named Test with a field named field. Create an XPage/paste the source code from the file below. Click the add-button to add an item in the multivalue field. Save the document to test if it works. Not sure how many versions back this works with.

Demo XPage source code

Wednesday, March 2, 2011

RepeatControls troubles - solution repeatControls

I've struggled more or less a working day trying to figure out why all of the properties I passed to a Custom Control inside a Repeat Control got nullified.

In afterPageLoad, in the Custom Control, I tried binding the compositeData values to a private variable for later use. I tried a lot of ways of making the properties survive, but whatever I tried, they ended up as null values before I could get a hold of them.

Components inside the control could "read" the composite data, but when the life cycle got as far as scripting, the values were nullified. The solution it turns out is setting the property repeatControls on the Repeat Control to true. I guess this results in a less agressive trash collector(?).

Anyways, my recommendation to IBM is to default set the option to true, unless the performance hit is big. I bet I'm not the only developer that has struggled/will struggle with this strange behaviour.