AC2 Bug #24 - Strange Behaviour From Select and Data Store

Wappler Version : v6 Beta 8

Expected behavior

What do you think should happen?

I have a complex select statement which works with information from a data store:

<select id="i_attendee_price" class="custom-select input_select" name="entry_price"
                      dmx-bind:options="prices_to_show.data.where(&quot;price_for&quot;, &quot;a&quot;, &quot;==&quot;).where(&quot;show_price&quot;, 1, &quot;==&quot;).where(&quot;attendee_number&quot;, this_attendee_number.value, &quot;==&quot;).sort('sort_number')"
                      dmx-bind:value="attendees.data.where(&quot;$id&quot;, this_attendee_number.value, &quot;==&quot;)[0].price" optiontext="title + ' - ' + currency_symbol.value + price_amount" optionvalue="id" dmx-on:changed="

                      show_booking_details==1?i_ticket_quantity.setValue(1):false;

                    show_booking_details==1?price_changed.load({question: 0, attendee_number: this_attendee_number.value, price: i_attendee_price.value, activity: get_activity.data.activity.id, booking: booking.value, contact: attendees.data.where(`$id`, this_attendee_number.value, '==')[0].contact, booking_item: attendees.data.where(`$id`, $id, '==')[0].booking_item, quantity: i_ticket_quantity.value, server_offset_seconds: server_offset_seconds.value}):false;

                    show_booking_details==1?attendees.update({$id: this_attendee_number.value}, {price: i_attendee_price.value.toNumber(), responses_okay: 0, quantity:i_ticket_quantity.value}):false;

                    show_booking_details==1?responses.update({attendee_number_question: this_attendee_number.value+'_entry_price'},{has_responded: i_attendee_price.value>0?1:0, response: i_attendee_price.value, response_type_response: 'entry_price_'+i_attendee_price.value, quantity: 1}):false;

                    show_booking_details==1?flow_set_instalments_price.run({price:i_attendee_price.value, attendee_number: this_attendee_number.value }):false;

                    show_payment_details.setValue(0)
                    " dmx-class:input_required="(entry_price_has_responded.value==0) && (show_response_errors==1)"
                      dmx-show="prices_to_show.data.where(&quot;price_for&quot;, &quot;a&quot;, &quot;==&quot;).where(&quot;show_price&quot;, 1, &quot;==&quot;).where(&quot;attendee_number&quot;, this_attendee_number.value, &quot;==&quot;).count() > 0">
                      <option value="0" selected=""></option>
                    </select>

So the value being bound to it is:

dmx-bind:value="attendees.data.where(&quot;$id&quot;, this_attendee_number.value, &quot;==&quot;)[0].price

And this attendees.data... value is set when the select value changes.

In the stable release, when a price is selected, the select statement takes on the correct value, and the price’s details are displayed.

Actual behavior

What actually happens?

In beta 8, the first time you select the price it isn’t displayed, and the second time you select the same price, it is. I have checked, and the data store is correctly updated after the first price selection.

How to reproduce

Go to this page:

… and select a price while watching the data store values change in the developer tools.

Fixed in Wappler 6 beta 9

This topic was automatically closed after 42 hours. New replies are no longer allowed.