How Do I Stop A Selected <select> Item Disappearing When the Options are Updated?

I have a select statement like this:

repeat attendees_datastore
   <select id="i_attendee_price" 
      dmx-bind:options="prices_datastore.data.where(attendee==$id).where(show_price==1)"
      dmx-on:changed="flow to update prices_datastore's values.">

With the logic of what I am creating, sometimes the dmx-on:changed causes the options available to the select statement to change, but still include the option the user has selected.

The problem is that when this happens, the user selected option disappears.

Is there something I can do or Wappler can do to prevent this?

Use Case

I have the following situation:

Hence if some of the people who book choose a “number limited price”, I need to make sure I don’t exceed the number available to book.

To manage this I have the prices in a data store, which lists each price for each attendee, and whether that price can be shown based on the number left available to book… something like this:

[attendee1, price1, show_price], [attendee1, price2,  show_price], [attendee2, price1,  show_price], [attendee2, price2  show_price], etc

If a user de-selects a number limited price, then I need to make it available again for the other users, hence changing the options available for the select statements.

When this happens, the item the user has selected disappears.

Community Page
Last updated: