Select to view content in your preferred language

Triggering data actions from a custom widget

1935
12
Jump to solution
09-23-2022 07:15 AM
MaxDiebold
New Contributor

I want to enable a custom widget to consume the "View in Table" data action provided by the Table widget, but I don't want to use the DataActionDropDown component. How do I trigger the action programmatically? I don't see any methods to do so in the DataActionManager class.

0 Kudos
1 Solution

Accepted Solutions
MaxDiebold
New Contributor

Never mind, figured it out. Once an action object is obtained from 

DataActionManager.getInstance().getActions();

 and the specific action is found, its `onExecute()` function can be called directly.

View solution in original post

12 Replies
MaxDiebold
New Contributor

Never mind, figured it out. Once an action object is obtained from 

DataActionManager.getInstance().getActions();

 and the specific action is found, its `onExecute()` function can be called directly.

chapmunnhsc
Occasional Contributor

Max -

How did you import the DataActionManager? Where does it come from? There is like zero documentation on it. Also, did you figure out how to pass a Feature Layer to the Table action?

Thanks

0 Kudos
chapmunnhsc
Occasional Contributor
import AppDataActionManager from './lib/app-data-action-manager';
 
Might answer my own Q.
0 Kudos
JillianStanford
Frequent Contributor

Hello @chapmunnhsc !

This is a few months old but did you get this functionality working?

I managed to get the View in Table data action but I can't quite figure out how to pass in my feature layer.

Thank you!

0 Kudos
chapmunnhsc
Occasional Contributor

@JillianStanford -

I didn't figure it out! I think I duct taped together a solution. However, I'm not at the point where I want to add a client side feature layer to the out of the box Table widget.

Any chance you know how to do that?

0 Kudos
JillianStanford
Frequent Contributor

Hi @chapmunnhsc,

Thanks for the reply.

I'm in the same boat and cannot figure it out! I'm finding developing for this platform incredibly frustrating. If I could start over, I would not use it.

I think I need to create an output data source that can be consumed by other widgets but can't figure out how to get it wired up.

If I figure it out, I will post it here.

Thanks!

Jill

0 Kudos
chapmunnhsc
Occasional Contributor

@JillianStanford did you ever figure this out?

0 Kudos
JillianStanford
Frequent Contributor

Hi there @chapmunnhsc ,

I cobbled something together and posted it here - Custom Widget Output Datasource 

Not sure if it's the most elegant solution but I'm relieved to have something working after months of frustration!

chapmunnhsc
Occasional Contributor

@JillianStanford way to keep at it and figure it out! I'm about to ping you with another question...

0 Kudos