Run command through HTML
Is there anyway to run a command from html. Specific example, some users end up closing the table of content and then if they bring the window back up and choose the Home Panel, there doesn't appear to be an easy way to bring the Layer List back. Is there a way to set up a command in html in the home panel to bring the the layer list back. I think the command is ShowLayerList
Thanks!
0
-
Hi Michael,
You could use a (https://docs.geocortex.com/essentials/4.8/admin-help/Default.htm#ge/admin/configuration-methods-and-techniques.htm#embedding-viewer-commands-in-hyperlinks) command hyperlink like this:<a href="command:ActivateView?LayerListView">Bring back my layer list!</a>ShowLayerList would also work, for now, but it's been deprecated.0 -
Jordan - thanks so very much!!! 0 -
Happy to help! 0 -
Hi Jordan,
Recently I tried to include a command as mentioned above into HTML of Home Panel. But when I am clicking it in viewer I am getting an error "The specified command "OpenAndFocusToolbar" has no associated metadata." in the client's debug log. Can you help point out what the problem is..!
Thanks,
Shubham0 -
Hi Shubham,
Unfortunately, the error "The specified command _____ has no associated metadata" means that you can't run that command from a command hyperlink until we add the necessary metadata to the viewer. I will try to get that done for an upcoming release but I am not sure when that might be available.
As a workaround, you can run a workflow that uses a Run External Command activity, which is not ideal but will let you use that command in turn.
Regards,
-Malcolm0 -
Hi Malcom,
Thank you very much for the information you provided. I was trying to implement this after having a look at it in the home panel of LA County demo site (http://gedemo.geocortex.com/Html5Viewer/index.html?viewer=LA_County_.LA_HTML) .
However, while running it in the demo site I checked the network trace and I didn't find any request to run a workflow going to the server side after clicking the hyperlink. Can you tell how it is implemented in the demo site?
Thanks,
Shubham0 -
Hi Shubham,
In the LA County demo site, we use the ToggleToolbar command to open the toolbar, rather than the OpenAndFocusToolbar command:<a href="command:ToggleToolbar">toolbar</a>There is a copy of the LA County sample site in your installation of Essentials, in the Sample Sites folder. Assuming our demo map services are still running, you can copy that site folder into your own Sites folder and load the sample site in Essentials Manager to see how it is configured.
Regards,
-Malcolm0 -
Thank you for the information Malcolm. I will have a look at the site.
- Shubham0 -
I built a custom command in JavaScript and I 'm getting the error ("The specified command _____ has no associated metadata") when I try to run that command from a command hyperlink.
How does one add the needed metadata to custom command?
BTW: It works great when run as tool from the toolbar, within the context menus, or launched from within a workflow.0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
9 kommentarer