1

Using a Calendar in SharePoint 2010.

In a Web Part above a calendar we are using to process room reservations, I placed some information for users about the request process. One of the list items contains a button for the user to open the default request form.

Clicking the button will launch the form in the modal dialog. The form functions just fine when it comes to saving the event to the calendar, but it will not trigger a reload of the calendar to show the added event. The user is forced to manually refresh the page.

It does, however, reload the calendar when the user opens the same form either by double clicking on the calendar itself, or by clicking on the +add button that appears.

By reloading I mean:

enter image description here

...apears and the new item is displayed.

I've searched the web high and low and wasn't able find anyone with a similar problem, or I simply failed to realize the solution in front of my eyes. Below is the markup and code for the button. I pieced this together by various tutorial sites and inspecting current elements (with IE) on the calendar. I've come this far, and it a road block.

Could someone please point out what I'm missing? I would greatly appreciate it.

<li>
   Click 
    <span id="rrcr_event_button" class="ms-uploadbtnlink">
        <BUTTON onclick="javascript:SP.UI.ModalDialog.showModalDialog({ url:'/afsb/405/HQ/S6/_layouts/listform.aspx?PageType=8&amp;ListId=8b2ef043-391b-42cf-842f-4577911746d2&amp;RootFolder=Lists/NewConference&amp;IsDlg=1', title: 'Conference Request - New Item' }); return false;" type="button">THIS BUTTON
        </BUTTON>
    </span> to open the room reservation / conference request form.
</li>

1 Answer 1

0

Instead of showModalDialog, try using OpenPopUpPage which lets you add the RefreshPage variable that refreshes on saves.

    <li>
   Click 
    <span id="rrcr_event_button" class="ms-uploadbtnlink">
        <BUTTON onclick="javascript: OpenPopUpPage ('/afsb/405/HQ/S6/_layouts/listform.aspx?PageType=8&amp;ListId=8b2ef043-391b-42cf-842f-4577911746d2&amp;RootFolder=Lists/NewConference', RefreshPage); return false;" type="button">THIS BUTTON
        </BUTTON>
    </span> to open the room reservation / conference request form.
</li>
1
  • Awesome! Worked like a charm. I learned something new. Greatly appreciated.
    – Brandon
    Apr 28, 2016 at 6:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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