Passing parameters from embedded view to popup. Still

Morning!
I’ve been trawling around for solutions to this, but it’s not working and I don’t know why.

I’ve read through the ‘how to pass parameters to popups’ here:Pass Parameter between pages

and this thread: Is it possible to add new Parameters through embedded views? has the beginnings of what my setup is, but I still can’t get it to work.

I have a primary view that contains several embedded views.
One of these views is a table that is populated from a dataset tag.
A custom property is bound to the tag, and props.data is bound to the custom property.
This was so I could get it to be read by the table as an array of objects.

The table view parameters pass to the embedded view, and selecting a row in the embedded view sets selectedRow and Selection parameter values in the table view.

Once a row is selected, an “edit” button becomes visible and enabled.
This button opens a popup.
I’m failing to pass anything to the popup.
I’ve made a ‘selectedRow’ input parameter on the popup view.
I’ve tried passing this via a popup action.
I’ve tried it with scripting.
The value doesn’t change (I have a value change script on the selectedRow parameter that just prints currentValue to the output console - it has not yet fired).

What I need is to get any information about the index of the dataset that has been selected (whether that’s the values, the index number, or whatever - doesn’t matter) into the popup so I can prefil the edit form with the selected data, have it be changed, then write it back to the dataset using the index reference.

Halp?

If you have a look at the Perspective Property Editor values for the table while running in Preview Mode you’ll see that the selected data appears in props.data.0, etc.

That’s probably what you need to pass to your popup.

You might also want to pass the selectedRow value and use a messageHandler to update the table when you’re closing the popup or as you edit each value.

Just a thought, but why not edit directly in the table? It’s more natural for the user sometimes.

1 Like

Thanks for the quick response @Transistor!
I redid the parameter selection based on your suggestion, and it’s working now (after fun dataset translation).

Why not do it in the table? Mainly because I’m updating someone else’s pages and this is what I have… :stuck_out_tongue: