SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Which function is called when you click on the "Check In" button of a page? I am referring to the button that opens the following modal dialog window.

Check In Page

It does not reference a page (already checked it with fiddler).


The function that Howard specified will have the following result:

Check In Page with version settings

If you want to try it out, here is the code:

var ctx = new SP.ClientContext.get_current()
var str=ctx.get_url()+"/_layouts/checkin.aspx?"+"List=Pages&FileName="+document.location;
OpenPopUpPage(str, CheckInNotifyAndRefreshPage);  
share|improve this question
up vote 7 down vote accepted

When you click Check In button, method handleCommand called from javascript object SP.Ribbon.PageState.PageStateHandler (sp.ribbon.js) with commandId = "PageStateGroupCheckin"
If you debug it, you can find that it executes this line at least:

return SP.Ribbon.PageState.Handlers.showStateChangeDialog(properties['CommandValueId'], SP.Ribbon.PageState.ImportedNativeData.CommandHandlers[properties['CommandValueId']]);  

Ok, somebody down voted, I'll explain how to find this function.
First of all inspect check in button using firebug or google chrome dev tools. Check in button is a link with id Ribbon.WikiPageTab.EditAndCheckout.Checkout.Menu.Checkout.Checkin-Menu16. Next, go to cmdui.xml file in 14 hive. Here using search find button with id Ribbon.WikiPageTab.EditAndCheckout.Checkout.Menu.Checkout. You will find this menu:

<Menu Id="Ribbon.WikiPageTab.EditAndCheckout.Checkout.Menu">  

and button with definition:

  Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-104" Image16by16Left="-32"
  Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-416" Image32by32Left="-192"

We interested in CommandValueId attribute. Next go to sp.ribbon.debug.js and using search find object, which handle this particular commandid - this is SP.Ribbon.PageState.PageStateHandler. All commands in page component handle method handleCommand, setup break and click check in in browser - consider screen shot below:


if you step further you got to line, that I mentioned above: img

It means, that when you press Check In in the ribbon method SP.Ribbon.PageState.Handlers.showStateChangeDialog fires.
Hope this helps.

share|improve this answer
Please, comment why down vote? – Kai Jan 18 '12 at 19:24
Valid answer to me, had enough detail even before you elaborated. +1 from me. – James Love Jan 18 '12 at 20:11
Thank you, it works! Now I see what I was been doing wrong. – Elio Struyf Jan 18 '12 at 21:18
When I try to call SP.Ribbon.PageState.Handlers.showStateChangeDialog in SharePoint 2013 I get following error: "Unable to get property 'CommandHandlers' of undefined or null reference". – Vladimir Almaev Oct 31 '14 at 14:35

I think it's the CheckInSingleItem function which can be found in \Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\INPLVIEW.js

share|improve this answer
Thank you for your comment, but this does not open the correct check in page. This opens the one with the check in versions. – Elio Struyf Jan 18 '12 at 19:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.