none
SharePoint 2013 XsltListViewWebPart display list from another site RRS feed

  • Question

  • Dear all,

    All our content types use a lookup field linked to a custom list with a lot of item. For helping end users to select a lookup value in the dropdown list I customized the editform.aspx by adding a XsltListViewWebPart displaying the list referenced by lookup field.

    This list is located on the site collection root site. That's the reason why i used the WebID property.

    It's working like a charm when I edit properties of already existing document.

    When I upload (upload.aspx page) a new document into the Library I am redirected to the EditForm.aspx page with an error message "The object specified does not belong to a list.".

    URL : <SharePoint site URL>/_layouts/15/Upload.aspx?List={<List Unique ID>}&RootFolder=<Relative Library URL>.

    If I remove this parameter from query string all is working correctly.

    I think that my WebID property from my XsltListViewWebPart is overwritten by the RootFolder parameter.

    Does someone already had this issue or knows how to workaround ?

    PS: I tried to modify the Upload page for changing the redirect URL without success. Redirect is done by native SharePoint server side code.

    Thank you for your help,

    Morgan

    Tuesday, February 28, 2017 2:29 PM

Answers

  • Before using server side HTTP module, please have a look into the following links:

    https://blog.josequinto.com/2015/06/16/custom-javascript-function-loaded-after-the-ui-has-loaded-in-sharepoint-2013/

    https://www.codeproject.com/articles/26033/the-page-life-cycle-of-client-browser

    Sys.Application.add_init(MyInit);
    //Sys.Application.remove_init(MyInit);
    
    function MyInit()
    {
        alert("MyInit added to page init");
    }

    Sys.Application.pageLoad

    Sys.Application class belongs to ASP.NET AJAX library, that is built into ASP.NET 3.5 and is automatically made available behind all pages in a SharePoint Farm. The events are related to the Sys.Application class, which provides a runtime object to take care of client events and to manage client components. This object provides access to all its members without creating an instance for it.

    • pageInit
    • pageLoad
    • pageUnload
    • Note that this class can be used because we have in our masterpage the asp:ScriptManager class:

      <asp:ScriptManager ID=”ScriptManager” runat=”server” EnablePageMethods=”false” EnablePartialRendering=”true” EnableScriptGlobalization=”false” EnableScriptLocalization=”true” />

       

      You can simply call the Sys.Application.add_load method from <head> or <body> to register a function that will execute right after the HTML elements on the page have been made accessible through the DOM.

      Example of usage:


      1
      2
      3
      4
      5
      Sys.Application.add_load(MyLoad);
      function MyLoad()
      {
         console.log("Sys.Application.pageLoad. Time: " + ((Date.now()) - performance.timing.navigationStart));        
      }



    Tuesday, February 28, 2017 3:52 PM

All replies