1.Create an XPage and go to the Source panel.
2. Select all the xml code that you see there and replace the same with the following code,
<?xml version="1.0" encoding="UTF-8"?>
<xp:button value="Label" id="button1">
<xp:eventHandler event="onclick" submit="true"
3. Now go to the Design Panel of the XPage.
4. There you go, you will see a Button and a Label as you see in the following screen shot,
sessionScope.Label+="x", and the same is illustrated in the following figure
6. The label needs to have a computed value with the following code in it.
sessionScope.Label, and this is as illustrated in the following figure,
8. You will see that the label get changed every time you click the button, and the same is illustrated in the following screen shot
Hope this helps :)