Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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).

Update

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

2 Answers 2

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']]);  

EDIT
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:

<Button
  Id="Ribbon.WikiPageTab.EditAndCheckout.Checkout.Menu.Checkout.Checkin"
  MenuItemId="Ribbon.WikiPageTab.EditAndCheckout.Checkout.Menu.Checkout.Checkin"
  Sequence="20"
  Alt="$Resources:core,ButCheckin;"
  Command="PageStateGroupCheckin"
  CommandValueId="PageStateGroupCheckin"
  Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-104" Image16by16Left="-32"
  Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-416" Image32by32Left="-192"
  LabelText="$Resources:core,ButCheckin;"
  ToolTipTitle="$Resources:core,ButCheckin;"
  ToolTipDescription="$Resources:core,cui_STT_ButCheckin_page;"
 />  

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:

img

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. –  EStruyf Jan 18 '12 at 21:18

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. –  EStruyf Jan 18 '12 at 19:12

Your Answer

 
discard

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.