Forum Discussion

AngelaIp's avatar
AngelaIp
Ideator I
6 years ago

How can I add an Item selector to a Form used in TOC View

Hi community,

I want to build a TOC view Form that is completely independent from any ItemType. The Form shall only represent an input mask for end users.

I wonder if it´s possible to add an Item selector to TOC view forms. Of course we cannot use any item as data source, so we have to use Method.

I added a Item property without data source to my Form and tried this onLoad Method to tie the item selector to an ItemType:

var item = getFieldComponentByName('myPartSelector');

item.component.request = function() {
var itemType = "Part";
var maxCount = "6";

var req =
'<Item type="' + itemType + '" select="keyed_name" maxRecords="' + maxCount + '" action="get">' +
'</Item>';

return ArasModules.soap(req, {async: true});
}

I know that something similar is possible with dropdowns. But unfortunately my version didn´t work. The returned value of getFieldComponentByName seems to be undefined. Is there any way to use Item selectors in TOC Views at all?

Thanks!
Angela

3 Replies

  • Hi Angela,

    did manage to solve this? It seems like it is exactly what I need...

    • AngelaIp's avatar
      AngelaIp
      Ideator I

      Hi Ken,

      I right now cannot remember where and how I used this one.

      In one case I faked the item selector by using a Method that calls the Search Dialog manually. So basically I used a regular field in combination with a custom "selector-like" button to open the Item search. This variant worked but didn´t support type ahead.

      A better idea would be to open the TOC View with a temporary context item. But I so far haven´t found a solution for this by myself, as you can see in the post from 1 month ago:

      https://community.aras.com/f/development/37369/how-to-pass-context-id-of-calling-element-to-custom-html-or-toc-view-in-new-tab

      • KenDiver's avatar
        KenDiver
        Ideator I

        Hi Angela,

        thanks for the answer. I will post here something if I get a solution for this.