Skip to main content link. Accesskey S

The useful resource for IBM Lotus Domino XPages development

Submit Search

Available in the Appstore!All the content of xpageswiki.com for iPhone or iPad for offline access.

Home > Controls > Work with custom controls

Work with custom controls

ShowTable of Contents

Use a custom control as container for your layout


For example, create a panel wich some elements. Assume you want this panel in every page, but you want to place your actual content inside that panel:

- Place an "editable area" control in your panel.
- Make a custom control out of the panel.
- Create a new XPage.
- Place your custom control on it.
- And in the editable area, you can add stuff without touching the centrally stored custom control.

Parameterize the custom control


In the custom control's properties you can define parameters in the "property definition" section.
In the XPage where you embed the control, you can set values for these properties.

In the custom control you can access the parameters by using "compositeData.parameterName" in a server side javascript (mind the case!).

Example: you have a custom control which acts as header for each XPage. You include the custom control in each XPage, but you want to display a different header text for each page:

- define a parameter "title" of type "string" in the custom control -> property defintion
- in the custom control, place a label and compute it's value with "compositeData.title"
- place the custom control in your XPage, click on it, go to "custom properties" and set a value for the "title" property

Control your custom control with parameters


- You can send parameters from your page to a control by using controlName.parameterName = "something".
- In your control you can get parameters with compositeData.ParameterName.
Created by Cristian D'Aloisio on Jan 10, 2012 4:47:17 PM

at the end of the page, section "Control your custom control with parameters",the sentence

You can send parameters from your page to a control by using controlName.parameterName = "something"

seems not true. I did a test with a button using SSJS setting a custom control text property, and it's not working.

I had to use a scoped variable to "pass" the value to the custom control.


Add Comment

Name:
Comments:
Use  searchlotus.com  for news in the Web related to Lotus Notes and Domino,
and to search those sites.
Check  youatnotes.com  for great Lotus Notes, Domino and XPages software.
Did this information help you?
Please honor our efforts and flattr this!