Now that we have a our OneUI styled Action
bar and a button/link on it we now need to give that button some purpose.
In this case we are going to put the document into Edit Mode so that our
end user can edit their own document or a person with the ‘PhonebookEditor’
role can edit the document.
Open your content_Person custom control
again and select the ‘Edit Document’ link that we created in the last part.
Change to the events tab for the link and in the onClick event we will
create a server side action using the ‘Simple Actions button. Set the action
category to ‘Document’ and set the action to ‘Change Document Mode’. We
need to tell the action what mode we want so we’ll select the ‘Edit Mode’
OK the dialog box and then save the
custom control and switch to your XPage. If you have not logged in on the
XPage yet then make sure you do it now. Anonymous should only have reader
access to the application. Once you have logged in navigate to a person
details page and click the button, the page will refresh and all the fields
will become editable.
In the next part we will add some validation
to some of the fields and also disable the ability to edit certain fields.