Home › Forums › Classic DFFS › Stay on page after save
- This topic has 4 replies, 2 voices, and was last updated 8 years, 7 months ago by Alexander Bautz.
-
AuthorPosts
-
-
April 23, 2016 at 18:14 #11229
Hi Alexander!
I have several web part pages using the same lists. These lists have places where my users need to input responses. I would like them to be able to input their response and stay on that page without getting redirected to the AllItems.aspx for the list. I tried the attached code, but it just takes me back to the AllItems.aspx in the modal window which I think will confuse my users. Is there a way to save a new item or an edit item and stay on the page they are working in?
Thanks!
Lana -
April 23, 2016 at 18:21 #11232
Here is the Attachment
Attachments:
-
April 26, 2016 at 21:35 #11278
Hi,
I’m not sure I understand exactly what you mean. Where are the users write their input? – is it in an EditForm opened from the list view? I would think the default SharePoint behavior would be to redirect back to where you were?Please note that any “&Source=/Url/To/A/Page” in the URL will causer the page to redirect to this “Source” after save.
Alexander
-
April 28, 2016 at 20:01 #11321
Hi,
I have created several Web Part Pages. Each page uses the same lists with different views.
If you open the edit form for a list item, input information and save, SharePoint automatically redirects you back to the default view of the list that was just edited, away from the web part page. At least my SharePoint 2010 version does. I am unsure how else to describe this, so I have screenshots below.
I need the redirect to not redirect. To just save the item and close the modal dialog box.
Is this possible?
Thanks!
LanaAttachments:
-
May 2, 2016 at 23:15 #11352
Hi Lana – I’m posting the solution we exchanged on email here to maybe help others.
I’m not sure how this is set up as my test in a web part page will not redirect. You can try adding this to a CEWP / HTML form web part below the form:
<script type="text/javascript"> EditItemWithCheckoutAlert = function(a,b,c){ var dlg, options = {}; options.url = b; options.dialogReturnValueCallback = function(a,b){ if(a === 1){ alert("The item was edited"); }else{ alert("The dialog was cancelled.") } }; dlg = SP.UI.ModalDialog.showModalDialog(options); } </script>
This code will alert the dialog “result” – these alerts must be removed, but they show you how you can do something when the dialog is closed.
Hope this helps,
Alexander- This reply was modified 8 years, 7 months ago by Alexander Bautz. Reason: fixed missing code snippet
-
-
AuthorPosts
- You must be logged in to reply to this topic.