AC2 Bug #4 - Repeat With Checkbox Selection of Array Should Function Correctly

Wappler Version : 5.8.2 Beta
Operating System : Windows
Server Model: PHP
Database Type: MySQL
Hosting Type: WAMP

Expected behavior

The following repeat should show the values that have been returned by the SC search_activities (data visible in the network tab of the browser).

<div dmx-repeat:rg_activities_searched="i_activity_search_show_deleted.checked?search_activities.data.search_activities:search_activities.data.search_activities.where(`is_deleted`, 0, &quot;==&quot;).where(`end_date_app`, current_datetime.datetime, &quot;>&quot;)">

Here is how the page looks with the stable channel:

activities_stable

Actual behavior

Nothing is shown. The page looks like this:

activities_beta

how to Reproduce

@patrick, this is all on my local machine… would it be helpful if I upload this to a server where you can see the behaviour for yourself? :thinking:

An online page whit the problem is always useful for debugging. It doesn’t have to be the actual project page, just a sample page which reproduces the problem. I will also try to reproduce the problem, but having one supplied is always better.

Not sure what goes wrong here, do the activities show when you toggle the Show deleted and past checkbox?

@Antony Take a look at “Meetup October 2022” at around the 49 minutes mark
This demos how to use ngrok to share a local page in wappler without needing to upload it. Really useful

1 Like

Yes, it turns out that they do… So when it is checked then they all show, but when it isn’t then nothing is showed… so it looks like the issue is to do with the .where() function!

It is happening in lots of places where I have this box_checked?data:data.where() type of structure…

@patrick, there is a similar related looking bug with this bit of code:

<input id="i_sm_choose_message" name="message" type="text" 
is="dmx-autocomplete" class="input_search" 
placeholder="Message Text: start typing topic"
dmx-bind:data="message_templates_mailing.data.message_templates.where(`is_deleted`, 0, &quot;==&quot;)" 
optiontext="message_topic" optionvalue="id">

The dmx-bind:data isn’t working… maybe again because it has a .where() in it!

I’m not able to reproduce the problem, the where formatter seems to work fine for me. What does the data look like, what type is the is_deleted property in your data?

Found an issue with values that evaluate to false in the data scope being parsed incorrect, here is an update that probably fixes your issue also.

dmxAppConnect.zip (28.2 KB)

Hi there @patrick…

That file makes it worse… I can’t even login with that one!

My login inputs are disabled and have a random character in them…

<input id="i_login_email" name="user_email" type="text" class="form-control input_text">
<input id="i_login_password" name="user_password" class="form-control input_text" data-msg-required="" type="password">

search_activities

Do you have some dynamic bindings on the inputs for value and disabled?

Here is the latest beta version which will probably be released today.

dmxAppConnect.zip (28.2 KB)

Hi there @patrick… I still can’t log in with this one! :slightly_frowning_face:

My email and password inputs are still disabled as per the image a few posts ago.

The version where this doesn’t happen is the 2023-06-20 1117 build.

It happens in the 2023-06-21 1131 and 2023-06-22 1451 builds.

They haven’t changed for eons, so you can see them live in a 3.9.7 build at:
https://app.workshop-angel.com/?s=login

Here is the complete unadulterated code for the login form:

<form id="f_login" method="post" is="dmx-serverconnect-form"  dmx-generator="bootstrap4"  dmx-form-type="vertical" action="dmxConnect/api/login/login.php" dmx-on:success="(f_login.data.forgot_password == 'yes')?window.setValue('login_change_password'):test_login.load()" id="f_login" dmx-on:start="sc_count.setValue(sc_count.value+1)" dmx-on:done="sc_count.setValue(sc_count.value-1)" class="h-100">
				<input id="h_local_time" name="local_time" type="hidden" class="form-control" dmx-bind:value="current_datetime.datetime">



				<div class="d-flex h-100 flex-column justify-content-around" id="d_login_flex">
					<p class="m-0"></p>
					<!-- ------------- Row login_header -------------- -->

					<h3 class="text-center m-0 c_right8 fs_160">Login</h3>

					<!-- ------------- Row login_email -------------- -->
					<div class="container-fluid container_field m-0" id="c_login_email">
						<div class="row row_label">
							<!--  -->
							<!-- dmx-text="apptext.value.220" -->
							<label for="i_login_email" dmx-hide="hide_labels.value==1" dmx-style:visibility="show_label.items.contains(220)||show_all_labels.value==1?'visible':'hidden'">Email:</label>

						</div>
						<div class="row row_input">
							<p class="icon_field" dmx-style:visibility="show_input_icon.value==0?'hidden':'visible'" data-trigger="hover" data-placement="auto">
								<i class="far fa-envelope" dmx-bs-tooltip="apptext.value.221"></i>
							</p>
							<div class="div_input">
								<input id="i_login_email" name="user_email" type="text" class="form-control input_text">
							</div>
							<p dmx-on:click="show_help.items.contains(220)?show_help.remove(220):show_help.addUniq(220)" class="icon_help">
								<i class="far fa-question-circle"></i>
							</p>
						</div>
						<div class="row row_help" dmx-show="show_help.items.contains(220) || show_all_help.value==1" dmx-html="apptext.value.229">
							<p></p>
						</div>
						<div class="row row_error" id="e_login_email" dmx-show="f_login.i_login_email.invalid">
							<p>Please enter a valid email address</p>
						</div>
					</div>
					<!-- ------------- Row login_password -------------- -->
					<div class="container-fluid container_field m-0" id="c_login_password">
						<div class="row row_label">
							<!--  dmx-text="apptext.value.230" -->
							<label for="i_login_email" dmx-hide="hide_labels.value==1" dmx-style:visibility="show_label.items.contains(230)||show_all_labels.value==1?'visible':'hidden'">Password</label>
						</div>
						<div class="row row_input">
							<p class="icon_field" dmx-style:visibility="show_input_icon.value==0?'hidden':'visible'" data-trigger="hover" data-placement="auto">
								<i class="fas fa-user-secret" dmx-bs-tooltip="apptext.value.231"></i>
							</p>
							<div class="div_input">
								<input id="i_login_password" name="user_password" class="form-control input_text" data-msg-required="" type="password">
							</div>
							<p dmx-on:click="show_help.items.contains(230)?show_help.remove(230):show_help.addUniq(230)" class="icon_help">
								<i class="far fa-question-circle"></i>
							</p>
						</div>
						<div class="row row_help" dmx-show="show_help.items.contains(230) || show_all_help.value==1" dmx-html="apptext.value.239">
							<p></p>
						</div>
						<div class="row row_error" id="e_login_password" dmx-show="f_login.i_login_password.invalid">
							<p>This input is required (custom message)</p>
						</div>
						<div class="row row_error" id="e_incorrect_password" dmx-show="f_login.status==401">
							<p>Incorrect password!</p>
						</div>
						<div class="row row_error" id="e_login_forgot_password_old" dmx-show="f_login.status==469">
							<p dmx-text="apptext.value.327">This replacement password is now out of date. Please create a new one.</p>
						</div>
					</div>
					<!-- ------------- Row login_button -------------- -->
					<div class="container-fluid text-center" id="c_login_login_button_42">
						<button class="button_login" id="b_login_login_42" type="submit" dmx-bind:disabled="state.executing">{{state.executing?'Logging you in...':'Log Me In'}}<span class="ml-2 spinner-border spinner_login" role="status" dmx-show="state.executing"></span></button>
					</div>

					<!-- ------------- login_last_bit -------------- -->
					<div class="container-fluid text-center" id="c_login_login_last_bit">
						<div class="row justify-content-around" id="r_login_remember_forgot">
							<div class="col p-0" id="c_login_remember_email">
								<input novalidate class="form-check-input" type="checkbox" value="" id="i_login_remember" name="remember">
								<!--  dmx-text="apptext.value.213" -->
								<label class="form-check-label label_link c_purple9" for="i_login_remember">Remember email</label>
							</div>

							<div class="col p-0" id="c_login_forgot_password">
								<!--  dmx-text="{{apptext.value.214}}" -->
								<button class=" button_link login_link c_purple9" href="" dmx-on:click="window.setValue('login_password')">Forgotten password</button>
							</div>
							<div class="container-fluid my-1 text-center border-top border-dark" id="r_login_click_to_signup">
								<!-- dmx-text="{{apptext.value.215}}" -->
								<p class="d-none button_link login_link c_purple9">Dont have an account? Sign up <a dmx-on:click="window.setValue('login_signup');show_signup1_errors.setValue(0)" class="text-decoration-underline">here</a></p>
								<button class="button_link login_link c_purple9" dmx-on:click="window.setValue('login_signup');show_signup1_errors.setValue(0)">Don't have an account? Sign up here</button>
							</div>
						</div>
					</div>




				</div>

			</form>

Thank you for the link, it helped me to find the issue. Here the update that fixes it.

dmxAppConnect.zip (28.2 KB)

Fixed in dmxAppConnect.js (2023-06-23 0942) :rocket:

fixed in the extensions beta channel as inline update