How to pass context id of calling element to custom HTML or TOC view in new tab?

Hi community,

is any one familiar with opening custom HTML pages or Forms in a new tab? I right now work on something similar as shown in this blog article:

https://community.aras.com/b/english/posts/displaying-html-in-aras-innovator

The article describes how to open a html page in a custom tab as alternative to a pop-up dialog.
In my case I open a custom Form instead of the html page, but it basically the same concept.

Does any one know how to pass custom parameters to the html page / opened Form?

When we just open the Form as regular pop-up dialog, we can pass the context item and custom parameters within the parameters block just as shown in the code sample.
But how do we pass the context item or other properties to the html page? The blog article unfortunately doesn´t cover this detail.

Would be happy if anyone has an idea or hint that could work!

Thanks for any help!

Angela

  • Hi community,

    I guess nobody can follow what I try to solve here. I will try anyway. 

    One ugly solution is to wrap the context item id into the window name and then later extract it from the tab. Something like this:

    ---
    // Get current id
    var currentItemId = document.thisItem.getID();

    aras.uiOpenEmptyWindowEx(newItem.node);
    var newWindowName = aras.mainWindowName + "_" + newItemId + "context" + currentItemId;

    ---

    But I really don´t like this variant. I would prefer a variant where I can pass my item within the call:

    var newWindow = aras.windowsByName[newWindowName];
    newWindow.frameElement.src = "./test.html";
    newWindow.frameElement.myItem = document.thisItem;

    Unfortunately this one didn´t work. I weren´t able to pass custom variables to the frameElement. If I want to do, I would have to modify the codetree file behind it to allow my own properties to be passed. Which I also don´t want to do. 

    There has to be an easier solution...

  • Hi Angela,

    Your need may have just been met by the upgraded TOC Editor in V20:

    Kind Regards

    Riaan

  • Hi Riaan,

    want to hear a funny story? I unfortunately cannot use V20 cause I don´t have a subscription anymore. My company was affected by the cleanup of subscribers that doesn´t fit the business model (too small..). Smart decision by even more smart people.

    But your tip is still helpful! I guess something similar is already possible in my Innovator 12. I can pass parameters to the TOC view. In my case I use /ShowFormInFrame.html as start page.  But I am not sure which parameter to use to pass an item.  I will give it a try!

  • Hi Angela,

    I am almost in the same boat as you, my company is going through a bad spell  (Commercial Aviation) so we will not be renewing our subscription when the times comes.

    The big question is when the Open version will be moving to the new V14+ platform.

    Kind Regards

    Riaan

  • Hi,

    I think I found a solution! 

    As mentioned by Riaan, we can pass additional parameters to the html start page. This also works from a Method. My problem was only to read the passed properties form another "onLoad" Method as soon as the new tab pops up.

    Solution: We can use parent.frameElement.src; to get the calling URL in the onLoad Method. This string will contain the complete html query string including custom parameters.

    With URLParams we then can get the individual passed parameters. It´s not as convenient than passing a complete item to a regular dialog, but at least we can pass a few string parameters.

    A similar concept is more or less used in the regular StructureBrowser, so I think the solution is fine until we find a better one.