Home › Forums › Presentation › Forms › Dynamic menu item example or support?
- This topic has 4 replies, 2 voices, and was last updated 3 years, 10 months ago by Atulan Zaman.
-
AuthorPosts
-
-
January 12, 2021 at 6:08 pm #14976Mark De CarvalhoParticipant
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 -
January 13, 2021 at 10:25 am #14990Atulan ZamanParticipant
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-
January 18, 2021 at 2:59 pm #15038Mark De CarvalhoParticipant
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
-
-
January 18, 2021 at 4:34 pm #15059Atulan ZamanParticipant
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-
January 18, 2021 at 4:40 pm #15068Atulan ZamanParticipant
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
-
-
-
AuthorPosts
- You must be logged in to reply to this topic.