Search code examples
xpagespojo

Passing a POJO to a custom control property


I'm refactoring an XPages application which has five nested repeat controls repeating basically the same thing (an xp:panel). I thought, aha, here comes a custom control with properties!

I'm looping my repeat controls around properties of a managed bean, and I was hoping I could have set a property for the custom control to just accept the POJO I'm sending it (and then access it with EL within the custom control).

What should I do? Make the custom control receive only strings, numbers, etc and have the whole nested-control logic outside? Or is there a trick?


Solution

  • A custom control can easily accept a java object that's passed in via the custom properties. Just use the type: java.lang.Object