Layer list - Possible to trigger hide when disabled behavior from workflow result? SDK limitations?
BeantwortetWe have a number of layer action menu items that need to be hidden based on some layer information. The layer action menu item launches a workflow that will direct to a url based on the layer context. The desire is to hide layer action menu items when the workflow would find no url for a layer.
Is there a way to have a layer action menu item hidden based on a workflow result? Does "hide when disabled" run a workflow silently before the menu becomes visible?
SDK
I've looked at possible SDK solutions without much luck. The app.json shows the layer list types as "layer-list", "menu", and "menu-item." Menu and menu item have models and I've extended those but I've been unable to find an event that triggers when the menu becomes visible... events.ui.visualStateChanged does not trigger for the menu or the menu item. The events.ui.activated doesn't do much as the layer context is needed and there is no layer context at that point.
The layer-list is a bit of a mystery as it has no VertiGIS model, as far as I can tell. It appears to just return JSX and I've been unable to extend it. I am wondering if I'm trying to work with the wrong elements and that maybe popover or paper from MUI might have the required events but it may be tricky to find the layer context from there.
-
Hi Tyson - yes there is a pattern for what you are looking to do. All feature actions support custom canExecute logic. You can therefore write your own code to look at whatever information is important to you and disable/hide the action based on it.
If you are still fighting this, I can dig up a starting point example for you.
0 -
I ran into a similar situation. I would like to hide a workflow which launches the layer's portal item page from layer action menu for layers added by users from files.
Tyson, have you found a solution for your use cases?
0 -
Since the “Hide when Disabled” option is defined in the Web designer, what are the specific conditions that would initiate it? In other words, what would cause a command or workflow to become disabled (and thus hide the button)?
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
3 Kommentare