« Learning XPages Part 30 : Creating An Action Bar And Buttons | Main| Learning XPages Table Of Contents »

Learning XPages Part 31 : Adding Actions To The Action Buttons

Tags : Lotus Domino XPages
Bookmark : del.icio.us  Technorati  Digg This  Add To Furl  Add To YahooMyWeb  Add To Reddit  Add To NewsVine 

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' option.

A picture named M2

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.

A picture named M3

In the next part we will add some validation to some of the fields and also disable the ability to edit certain fields.

Comments

Gravatar Image1 - Gah!!! Now I have to be able to login, and me out of the office and no server to handle the authentication (and it's too late in the night to upgrade my local one).

I hate having to rely on barNet sometimes Emoticon

Seriously, though, this is fantastic stuff, just wondering if the IBM three-dayer in a couple of weeks is going to be able to hold a candle to it Emoticon