SOLVED: Databasejoin element issues with ajax - Apply where when

Status
Not open for further replies.

ontarget

Active Member
  • J!4.3.2
  • F4 Delta
Hi I have a DBJ element (Render as Dropdown) with a Data - Where statement:
Code:
WHERE {thistable}.`id` IN (SELECT `user_teams` FROM `adtldlddd_registration_repeat_user_teams` WHERE `parent_id` = '{adtldldd_claim___userid_raw}')

Apply where to = Public
Apply where when = Both
AJAX Update = Yes
Ajax on Load = Yes
Please Select = Yes

I create an entry in the form and submit.
When I Edit the row entry in the list the DBJ element reloads and shows "Please Select" - this seems correct as:
Apply where when = Both

However I dont want to it to reload when a user edits the entry - I want it to keep the original submitted selection.

If i change: Apply where when = New - it doesnt make any difference and the DBJ element reloads with "Please Select" on edit.

Is this a bug? Or how do I prevent the DBJ element from reloading on editing of the row?
Thanks
 
Hi,
If i turn off Ajax in the DBJoin element I have to use the "Apply" button in the form to trigger the dbjoin to load items.
Apply where to = Public
Apply where when = Both
AJAX Update = No
Ajax on Load = No
Please Select = Yes
Turning off ajax however does stop the issue of the element resetting when editing the form, but users wont know to hit "Apply" when filling the form out for the first time!

Is there a solution to this?
Thanks for any help
 
Hi,
I am still having issues getting the database join element to work.
I fixed the issue blocking the element from reloading to"Please Select " on edit by adding an additional calc element see screen shot and a js workaround on the dbjoin element

https://ibb.co/CQZL22p
https://ibb.co/k4t09kh






My setting on the DBJoin are now:
Code:
WHERE {thistable}.`id` IN (SELECT `user_teams` FROM `adtldlddd_registration_repeat_user_teams` WHERE `parent_id` = '{adtldldd_claim___userid_raw}')
Apply where to = Registered
Apply where when = New
AJAX Update = No
Ajax on Load = Yes
Please Select = Yes



The form works well now - users can select from the dropdown on New and on Edit, their entry stays the same when the form loads.

BUT:
In the List i have set the databasejoin element to be a filter > Dropdown.
The filter wont load any data (because the WHERE statement above is preventing it) removing the where statement allows the filter to work fine.
Is it possible to get the filter in the list to ignore the Where statement in the element?
 
Last edited:
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top