none
OpenPopUpPage and IE 10 problem

    Question

  • Hi,

    I have a custom display form in SharePoint. This display form contains a button that opens a dialog to create a new item in another list.

    It looks like this:

    <input type="button" value="button name" onclick="javascript:OpenPopUpPage('/path/newform.aspx?Param={@Param}')" />

    In IE 9 this works perfect, but in IE 10 something goes wrong. The dialog opens but it somehow ignores the IsDlg=1. The URL shows IsDlg=1, but still the left and top navigation are shown. When doing some research I found out that when clicking on the item in the list, the URL for the display form that contains the button is like this: http://path/DispForm.aspx?ID=9&Source=http%3A%2F...&ContentTypeId=...&IsDlg=1

    If I make a custom link to the display form and still use the source but like this http://path/DispForm.aspx?ID=9&Source=http://...&ContentTypeId=...&IsDlg=1 or not using the source at all, everything is ok.

    I've got the same behaviour when using a hyperlink or SP.UI.ModalDialog.showModalDialog.

    Any idea how to fix this?

    Sandra


    Sandra Ratis

    Wednesday, September 18, 2013 1:30 PM

All replies

  • Hi,

    According to your post, you wanted to custom display form to contain a button that opened a dialog to create a new item in another list, but the dialog ignored the ‘OpenPopUpPage’ in IE 10.

    I try to reproduce the issues as follows:

    1. Open SharePoint Designer, select the custom list.
    2. Add a new Display Form, set as default form for the selected type.
    3. Select Spilt View, insert the code: <input type="button" value="Display" onclick="javascript:OpenPopUpPage('http://[site name]/Lists/[list name]/NewForm.aspx')" />
    4. Save.
    5. Open the List in IE 10, select an item, view item, the button appears.
    6. Click the button, it will open a dialog to create a new item in another list as the picture below.

    In addition, I suggest you to add the create bottom as the picture above to open a dialog to create a new item in another list. Please refer to the following steps:

    1. Open SharePoint Designer, select the custom list.
    2. Click Custom Action in the Ribbon->Display Form Ribbon.
    3. Create Custom Action, enter a name.
    4. Select type of the action: Navigate to URL.
    5. Click Brower-> Lists-> the another list ->NewForm.aspx->Ok.
    6. Open the List in IE 10, select an item, view item, the Custom Action appears.
    7. Click the create button, it will open a dialog to create a new item in another list as the picture above.

    The dialog will be popped up no matter the Brower Mode is IE10 or IE10 Compatibility View.

    Best Regards,

    Linda Li


    Linda Li
    TechNet Community Support


    Thursday, September 19, 2013 5:55 AM
    Moderator
  • Hi,

    Thank you very much for your reply, but as you can see, you also get the left navigation displayed. This is the problem.

    I've tried your second suggestions and that works, but unfortunately the link has to contain one parameter. I've tried with the Navigate to URL option but it didn't work. And also this link only appears on the form when some conditions are met, but if I put it on the ribbon, it will be dispalyed all the time?

    Thank you again for your reply.

    Best regards,

       Sandra


    Sandra Ratis

    Monday, September 23, 2013 8:25 AM
  • Try adding the css class "s4-nodlg" to the left navigation control.

    Regards,

    Sairam

     

    Sairam Avacorp Technologies

    Monday, September 23, 2013 8:31 AM
  • Hi,

    According the first method , after I click the Display button, it appear the New Form of another list as bleow.

    According the second method, after I click the create button, the Display Form disappears and the New Form of the other list appears.

     
    Best Regards,
    Linda Li


    Linda Li
    TechNet Community Support

    Monday, September 23, 2013 8:53 AM
    Moderator
  • Sairam, thank you for your suggestion but I already have that class added.

    Linda, like I said, if there would be no parameter and the link could be displayed all the time, the second option would be ok. But the link has to have one parameter and it is only displayed when some conditions are met.

    Best regards,

      Sandra


    Sandra Ratis

    Tuesday, September 24, 2013 6:40 AM
  • Hi,

    The first method I provided in the first reply is correct, but I pasted a wrong picture.

    I still suggest you to follow the steps as below to acheive what you want:

    1. Open SharePoint Designer, select the custom list.
    2. Add a new Display Form, set as default form for the selected type.
    3. Select Spilt View, insert the code: <input type="button" value="Display" onclick="javascript:OpenPopUpPage('http://[site name]/Lists/[list name]/NewForm.aspx')" />
    4. Save.
    5. Open the List in IE 10, select an item, view item, the button appears.
    6. Click the button, it will open a dialog to create a new item in another list as the picture below.

    Best Regards,

    Linda Li


    Linda Li
    TechNet Community Support



    Tuesday, September 24, 2013 7:43 AM
    Moderator
  • Linda hi,

    this is the way that I have done the button, but for me it does not work. I have also removed the parameter stuff, but it is the same. The only time that it works is if the display form does not have a source parameter or the source is like Source=http:// and not Source=http%3A%2F (but if I open the display form from the list, souce is like this)

    Best regards.

       Sandra


    Sandra Ratis

    Wednesday, September 25, 2013 7:27 AM
  • Hi,

    Thank you for your question. I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience. Thank you for your understanding and support.

    Thanks,

    Linda Li


    Linda Li
    TechNet Community Support

    Thursday, September 26, 2013 8:58 AM
    Moderator
  • Hi Sandra,

    may i know more regarding this source parameters, do this source parameters are the parameters that passed on to dialog box?

    as i know to pass parameters to the modal dialog box need some settings and coding that you need to check:

    http://dotnetfollower.com/wordpress/2012/08/sharepoint-how-to-access-the-parameters-passed-into-a-modal-dialog-window/

    http://www.codeproject.com/Questions/256099/Open-SharePoint-Popup-by-passing-url-as-parameter

    i am followed this two articles regarding this request:

    http://blogs.msdn.com/b/sharepointdev/archive/2011/06/23/how-to-open-a-list-form-in-a-modal-dialog-box.aspx

    http://kyleschaeffer.com/sharepoint/sharepoint-2010-pop-up-dialogs/


    Regards,
    Aries
    Microsoft Online Community Support


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Thursday, September 26, 2013 10:52 AM
  • Hi Aries,

    The source parameter is on the display form (when I open the form from the list, the source parameter is there), not on the new form.
    I went throught your articles, but no luck. So for now I have set to open the new item form in a new tab.

    Thank you for your help.

    Sandra


    Sandra Ratis

    Friday, September 27, 2013 7:40 AM
  • Hi Sandra,

    as i follow the examples, i have the same result with the examples as tested.

    i am not quite sure why in your envoronment, that makes different and not pass the source directory to the new form, quite unique.

    do you have the latest printscreen, perhaps we can look for clues from there.


    Regards,
    Aries
    Microsoft Online Community Support


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Friday, September 27, 2013 9:09 AM
  • Hi Sandra,

    Regarding this issue, is there any update that we may have?

    meanwhile i will put your post as propose as answer.


    Regards,
    Aries
    Microsoft Online Community Support


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Tuesday, October 22, 2013 7:45 AM
  • Hi,

    I'm sorry for the late reply. I have not found a solution for this. It works perfect in Mozilla and Chrome, but not in IE 10 or 11. I've tried with compatibility mode and nothing. It is also funny because sometimes it only displays left navigation and sometimes it displays left navigartion plus the global navigation and search bars. I've also made sure that sp.js is loaded before calling the open in dialog function and still nothing. I've also tried it with the default master page, to see if something is wrong with my branding but still the same result.

    So now I'm opening new forms from disp forms in new tabs. Don't like it, but can't help it.

    Thank you for your help.

    Best regards,

       Sandra


    Sandra Ratis

    Tuesday, November 05, 2013 9:07 AM