locked
LS HTML: how do I open details/AddEdit screen in a new window/tab instead of the current tab? RRS feed

  • Question

  • To open the my details / AddEdit screen I have the following lines: 

    //myapp.showAddEditProduct(selectedProduct);

    myapp.showAddEditProduct(selectProduct.ID);

    But it opens in the same tab where my search / Browse screen is. How do I open it in a new tab/window ?

    ----Update based on joshbooker's suggestion----

    The following code will give me a new tab/window but it opens the default screen instead of AddEditProduct screen (that has 'ID' parameter).

    myapp.BrowseProductSummary.ID_Tap_execute = function (screen) {
        var id = screen.ProductSummaries.selectedItem.ID;
    
        var hashPos = window.location.href.indexOf("#");
        if (hashPos >= 0)
            var baseUrl = window.location.href.substr(0, window.location.href.indexOf("#"));
        else
            var baseUrl = window.location.href;
    
        var fullUrl = baseUrl + "?screen=AddEditProduct&ID=" + id;
        
        window.open(fullUrl, '_blank');
    };


    • Edited by oyen Thursday, January 9, 2014 6:16 AM additional stuff in response to joshbooker's suggestion
    Wednesday, January 8, 2014 7:39 AM

Answers

All replies