Lapas

Friday 16 October 2009

How to add computed custom control to XPAGE at runtime

Very simple technique:
You need to know, that "include page" control could include not only page elements, but also custom control elements, but you should write then by Your hands.
So @1st create a repeater on page.
Then add include page control in repeater.
As repeater values set array of controls to add ex. ["ccontrol1.xsp", "ccontrol2.xsp",...]
use those values to compute page.

2 comments:

  1. Hi Vitalijs,

    this is what im looking for but im new to XPages and i don't really know what do you mean by "You need to know, that "include page" control could include not only page elements, but also custom control elements, but you should write then by Your hands." It would be really nice if you could write a code example of how do you include custom control elements with the "Include Page" control.

    Thank you very much!

    ReplyDelete
  2. Good day, Robby.
    I meant that page and custom constrol has the same naming in xpages environment. So pages called likke MyXpagesForm.xsp, and custom control also called MyXpagesCustomControl.xsp. When You're writing includable custom control name in repeater control, then You should add extension to control name, see the array example.

    ReplyDelete