Home Forums Presentation Forms Dynamic menu item example or support?

Viewing 2 reply threads
  • Author
    Posts
    • #14976
      Mark De CarvalhoMark De Carvalho
      Participant

      In the previous UI you could create menu that has dynamic list of menu items. For instance, in the Entity Service Model form, the right click menu had a “Schedule Touch” option that listed Task and Schedule Item templates based on whether the touch type was associated with those templates. I do not see how to achieve this in the 9 UI, is there an example or a guide you can point me to?

      0
    • #14990
      Atulan ZamanAtulan Zaman
      Participant

      Hi Mark.

      You can use the <Menu> control to show a dynamic collection, and bind a UI event to execute the action with the selected value as a parameter. See the example below, which shows the list of call record templates and handles the action in the “addRelatedCallRecord” event. This example is taken from EntityActList.layout.

      <Menu captions=”caption” event=”addRelatedCallRecord” icons=”icon” items=”(@@ ActTemplate)” name=”mnuAddCallRecord” order=”(caption)” where=”(and (@ allowNew) (@ isCallRecordTemplate))”/>

      0
      • #15038
        Mark De CarvalhoMark De Carvalho
        Participant

        Thanks for the reply Atulan, what we need is to have the list of items in the menu to be dynamic based on the selected row. In my example above, a proactive touch might be configured with “Call” and “Email” templates, whereas account review might be configured to associate with “Meeting”. So the menu items for each row in the grid would be different. Does that make sense?

        0
    • #15059
      Atulan ZamanAtulan Zaman
      Participant

      Hi Mark,

      You can follow a similar pattern to this, taken from NotificationList.layout.
      <Menu captions=”caption” event=”executeAssociatedAction” icons=”icon” items=”(@ visibleAssociatedActions)” name=”mnuVisibleAssociatedActions” order=”((caption . #t))” values=”type value”/>

      In this use case, CUDNotication’visibleAssociatedActions is a calculated collection attribute that is different for each notification, and the menu displays the actions for different types of notification.

      0
      • #15068
        Atulan ZamanAtulan Zaman
        Participant

        Note: I haven’t tried using this pattern in a Table. I’ve only used it in a List control. But I would think that this should work for tables as well.

        0
Viewing 2 reply threads
  • You must be logged in to reply to this topic.