Upvote 1

Transfer variable to a pop-up window from clicking a tile in a data grid to show data of the same

Answered jay gtz 7 years ago

Hello.


I have a data grid functioning as an item display or "tiles". I have an event that when one is clicked a window show up. I want this pop-up to display data of the same tile clicked, I.e. the image, name, description, etc.

What will be the best way to achieve this?

Replies (2)
photo
1

There are two methods to accomplish this, that I know of. The first method is to create an event based on the click of a data grid record using a hotspot that copies the values from the data grid record to the pop-up modal then shows the modal, which is initially hidden. The second way is to add an "id" column to your data master and include it as a hidden field in the data grid record. Then, using the same type of hotspot click event, use the id to filter the data master for each of the fields of the record you want to populate in the pop-up modal before showing the hidden modal. I have included screenshots below of example actions and expressions used for implementing these two methods. I don't know if one would be preferable to the other for performance or any other reasons.

I have attached a prototype that demonstrates both methods using two hotspots per record. Clicking on the left half of a record populates the pop-up modal using the first method while clicking on the right half of a record populates the pop-up modal using the second method. By clicking each half in succession, you will see that the same results are returned. You will have to drill down into the implementation to confirm that the pop-up modal is indeed being populated by two different methods.

To use the prototype, simply change the extension from ".rar" to ".vp". The file is not compressed. As for user images in the data master records of the prototype, since this field is a file upload type, you will need to supply these yourself if you care to see images with the records, but they should function the same as any other field in the record.

Hope this helps. Cheers!

First method example action with expression. The "selected_user_first_name_value" field in the pop-up modal is populated by copying it from the "user_first_name_value" in the selected data record of the data grid.:

21e12d517119d28279cd352a820b9133

b034e50bcd940b8bec0f65bfb7692d64

Second method example action with expression. The "selected_user_first_name_value" field in the pop-up modal is populated by copying the hidden "user_data_master_data_record_id" from the selected data record of the data grid and using it to filter the "users_data_master" for the correct record, then selecting the value of the matching record's "first_name" field.:

d6ed223eb95d0e69ae2ee20e4079e953

8899c805e9f9167b9f0b88da279b91fc

8a1e20f742e38e08073a060faa4af92b

photo
1

Thank you for your contribution eggroll!

photo
2

Happy to help!

photo
1

I can do that to other page, not a popup? tranfer value from one page to other page.... Sorry about my english.

photo
1

HI Maite,

Have you downloaded the prototype from my earlier response? If not, downloading it and see how it works may help. If you have already looked at it, then maybe you can provide some more detail about where you're having the problem.

Cheers!

photo
1

Yes, I downloaded it, but you show the value in a component of the same page (popup) , i need show the selected record in a new page or new screen. And I have another problem, I need filter the data list with a category that I selected in the previous page. Then, I need to know how I can pass the value from one screen to another screen.

I´m working in a prototype for Android.

One more time I´m sorry about my english, I hope you can understand me. Thanks for your answer.

photo
1

Hi, eggroll


I´ll try put it all in one screen with dinamic panels. Thanks for your colaboration.

photo
1

Hi Maite,

For JIM prototypes, I don't like page/screen loads (I'm currently working on an iPhone prototype), so the way you are now doing it is the way I most often do it, especially if there is a lot of data to share between screens. Like you, I simply create the additional screens in separate dynamic panels and position them out of view, then animate them into view when the corresponding link/button/hotspot is tapped. That way, when changing screens, the response is immediate and you still have access to whatever data you need for use in these additional screens. (Alternatively, for these additional screens, you could initially position them in the same position as the primary screen, but have them hidden).

If you wanted to actually link to other screens and carry over data from the primary screen, as you had originally intended, you could achieve this in a couple of ways. One way would be to create variables that represent each of the data fields in the primary screen whose values you need to share with the screens you are linking to. The link on the primary screen should contain "on Tap -> Set Value" events (coming before your "on Tap -> Link to" event) that set the values of these variables using the corresponding field values from the primary screen. Additionally, the linked-to screens need to have "On Page Load -> Set Value" events that then copy the values from these variables to the corresponding fields on these linked-to screens.

An alternate method would be to ensure that your data master has an "id" field (or any field whose value is unique to each record) and including that id field in each data grid record as a hidden field. Using this method, only the value of this id variable would need to be set before your "Link to" action. Then, as in the first method above, the linked-to screens would need "On Page Load -> Set Value" events that set the corresponding field values on those linked-to screens, but not by copying values from multiple variables, but rather by using the value of the id variable to retrieve the values of these fields from the data master. This is done with "Filter" on the data master, using the value of the id variable to retrieve the record whose id it represents, combined with "Select" to retrieve, from that record, the value of the appropriate field. The expression, inside the event builder, for retrieving the value of a field would be similar to the screenshot below.

Hope this helps. Cheers!

92d93256dc361075bef80b2e5f9db7d9

photo
1

Thank you very much for your help Eggrol. I´ll try he first way, and then i´ll try the other, just for learn. Thank you.

photo
Leave a Comment
 
Attach a file