Master -> Detail Relationship

If created several pages that are working perfectly using the Master-Detail Relationship tutorial video.

Here’s what stumped me: When clicking the row to initiate the display of the Detail data, it appears to use the variable value to display the result. However, when there is no result (no data), there is no indication when the data is available.

My question is, “What can I use as a trigger, and how can we use the error to alert the user that there is no data to report?”

Thanks for your help.

There is nothing worse than what you describe, a user clicking an option only to find an empty page. Personally I would filter the option out so that it is not visible.

use the hide and show feature for your page element.
i personally do not show the detail page if the query parameter is not set.
you could show an alert if the variable is not set or if the serverconnect is empty.

Thank you for your input. What I have done is as you suggested, however, what happens is the alert pops up as soon as the page is opened. I must have the alert inside the wrong event.

Are you suggesting that I put it inside the element that triggers the detail to be shown?

set the alert to be shown when the serverconnect has finished and there is no result

Explain where I might find ‘when the server connect is finished’.

When the table row is clicked, the id is checked for content, the detail is shown if exist, nothing happens if it does not exist. I would like the alert would follow this ‘error’ or lack of a true return on the row id … See attached html page image…

use design view and select the serverconnect then see the dynamic events

Thanks for the help! I appreciate it very much…

Okay, thanks! Now do I select Done, Error, or what?

This is what the code looks like now. However, there’s still no response.

I’ve tried the dynamic event on the list and the detail action, but it either shows the alert when the page loads or when the row in the list is clicked there is no alert at all.

stop focusing on the code :sweat_smile:

on a second thought leave the events on the serverconnect they are not the one we need.

go to the alert and in the dynamic attribute show put something like this replace serverconnect name with yours and the query name(you can select them on the actions list)
!serverconnect.data.query.hasItems() && !serverconnect.state.executing

I see that my problem of not following your instructions is due the site that I am currently working on is Bootstrap 3. These alerts you mention appears to be the steps for Bootstrap 4. Is this correct?

I’ve never had problems with this before with other types of server connect actions. This is the first time I am using the ‘click a table row’ to open the details on the same page.

The rows are from a user list table, and its related details are from another table. When the details have data all works fine. When there is no details relative to the user nothing happens.

So I have two server connect actions: one for the list of users; the other is for the user’s detail.

When the row is clicked, and no data exists, I want an alert to popup and inform the user: This information has not been provided.

I am having a brain freeze. It’s just one of those days when even coffee fails me.

I appreciate your time and help.

Alerts doesn’t matter. you can use any element you want. you need to set its show attribute and use the detail of the user serverconnect.
i think you need to understand the workflow a bit more in wappler. but its completely logical and you will get it

i will show you a page im working on and you will get an idea of what is possible.
give me a second to upload the video

I agree. I haven’t gotten use to the design view concept. I have always viewed the code. Plus, it’s the OCD. Ha!

I’ll give it another go and let you know how it turns out.

Thanks!

Okay, I will take a look.

Here is the video from my phone
Dont mind the language
You can see the animations on the page load and the alert show and hide passed on the scan result.
If there is a result a smooth show of a record is displayed
If there is no result a yellow alert will show
The blue alert is only showing when the server is executing.
All done with wappler.
D5439983-36CB-4E50-BEF0-9689480C7F03.MP4 (8.4 MB)

Impressive.

All of these are triggered by the serverconnect & dynamic attribute, show/hide?

I’m stumped. I’ve tried and failed each time. However, I will NOT give up on this.

My situation is this:

On the users page:

  1. Step 1 the user fills out a form on page 1. The completion of form 1 will grant access to the form on page 2.
  2. The user fills out form 2, and the process continues to the next page, etc.

On the Form Managers page:

  1. There are two tables.
  2. On the left side is the list of all the completed form 1’s data.
  3. On the right side is a table that will display the details of the data where LIST ID = DETAIL ID. The data in this table is not seen until a row in the table one the left side is clicked.
  4. If there is Detail data associated with List data via ID, the Detail information will be displayed in the table on the right.

If not, I want a note to appear that states a message indicating the form data for that record is incomplete.

So far, if Detail exist, the Details are displayed properly. However, if there is no Detail data, the error message (browser alert) does not appear.

Obviously, I am missing something… or I’m blind in one eye!

3 posts were split to a new topic: Working with Arabic and RTL in Wappler

Lets start by hiding the detail table first.
on the table element what do you have set up in the show attribute?

dmx-show="id.value

That sets the initial state as hidden. Once the row is clicked, if the form has data, it is displayed in the detail table.

If not, the detail table remains seen, but the row is replaced with an empty row.

Recording.mp4 (3.5 MB)

try to change it to check if the detail serverconnect have items. do you know how?