I am trying to bind some api data to a popup view. The view is triggered from an click event when the user selects a row on the table. The information that is returned is based on a PONumber that is passed in as a parameter. Im not able to see any data being passed into the popup view. I created a table in the popup to bind to a view parameter that would pass in the data from the api. I need to click on a row or cell which would capture the PO# in the PoNumber column and pass it into the api call to retrieve data to the view.
onClickEvent.py (541 Bytes)
I can't open the py file on my phone, but I would be calling the api from the popup instead. I like to self contain functionality. If you ever wanted to open that popup from somewhere else, you don't want to have to repeat that same script to call the api and then pass it into the popup, you just want to pass the info you've got to the popup, and let the popup retrieve what it needs to from that
2 Likes
Regarding the actual issue with passing in the tableData itself, that looks like it should work to me, assuming your popup has a params.tableData
prop on its view params
2 Likes
As @nminchin pointed out you're better off passing the PO number and user ID to the popup as parameters instead. This also allows you to test in the designer easily by setting the parameters to some test values and getting a result.
1 Like
So the script where Im calling my API, I placed it inside of the popup in a script. Would I need to call this script from the click event in the main window. Could you provide an example?
No, I would add a custom prop bound to the params you pass into the popup using an expression structure binding. When these change, they will trigger the binding to update. Add a script transform to it to perform the API call and return the result.
1 Like
Ok you talking about here on the data property of the table that is inside of my popup correct?