Forum Academy Marketplace Showcase Pricing Features

Frames - having one page "talk" to another page without redirecting

I’m building out a hybrid email inbox as part of an app. Essentially, it looks the same as Outlook (a very stripped down version) and bunches emails together in “conversations” (a repeating group of emails on the left, and the selected conversation thread on the right). I have two separate windows:

  1. List of Emails (page 1)
  2. Conversation Thread (page 2)

In order to have page 1 (i.e. the list of emails) talk to page 2 (the conversation thread), I have attached a “selected_conversation” datatype to the user so that it can store what conversation the user last viewed. However, each time a new conversation thread is selected in page 1, the app does a r/w on the database to update the “selected_conversation”. Two questions for some experienced Bubble folks out there:

  1. Is there a better Bubble best-practice than attaching a data-type to the user for having one page talk to another without navigating to it (ideally we could would just send the desired page a set of parameters)?

  2. Because page 2 (List of Emails) contains every email in the “selected_conversation” via a repeating group, I need to have page 2 ‘scroll to’ the selected email in the conversation thread. Currently, I am doing a series of of ‘do a search for’ to extract the index (indexA) of the selected email and filter the conversation repeating group (i.e. page 2) to display cells “from item #: indexA”. This is not ideal from a performance perspective, any ideas on reducing search queries?

You could probably use the javascript plugin to read and write cookies. Then use a timer on the Page 2 to check if the value of the cookies has changed since the page was initially loaded.