1. What will you learn
You will become familiar with conditional display of information in XPages.
You will learn the difference between full and partial refresh.
2. Task Description
Change your custom control to contain an input field to collect the users
name and a button to update the page to show “Hello [Name entered]“.
3. Detailed Steps
1. Add a panel to the hwControl Custom Control,
name it “helloPanel”
a label to the panel: “Your Name please”
an Edit Box, name it yourName
a button label it “Say Hello”
a custom property to the custom control: (click on an empty part of the
Call it iknowyou
code to the button's onClick event:
- Add Action
Basic: Execute Script
var txtControlValue = getComponent("yourName").getValue();
compositeData.iknowyou = true;
the “Visible” properties of the input box and the button to computed:
Use the following formula:
10. Preview the result
NOTE To preview the result you will need to change the focus to the
hwPage, as you can't preview a custom control.
Be sure to save both before you hit the preview button.
the server option for the button event from “Full Update” to “Partial
Update” and select the helloPanel
some text above and below the panel
the result in the browser
4. The Result