Show "Record Not Found" using a text search input query

I have a text search input query that filters a repeat region. It works great!

However, it seems I have forgotten how to set up the dmx-hide and dmx-show to display the text “Record not found!” when the search is empty.

Do I use the dmx-param:search=“search.value” somehow to determine the true or false result?

I have a feeling that it is much simpler than I’m making it or haven’t had enough coffee to clear the old man’s head.

Create the “Record Not Found” Div and select it, Dynamic Attributes, Hide, select your Server Connect Action then click the magic wand, right click on the Action and select Conditional Has Items.

:wink:

1 Like

Excellent! Thanks Dave.

1 Like

@Dave’s right, but I would add it does not have to be a div, it can be a title or some other element.

1 Like

That’s true. However, in my case the div works fine.
My hangup was that I got too used to using the column names in the query on so many other projects that I forgot I use .hasItems()!
So I reached out to you guys to help me jar my memory… and you were there. Thanks again!

Scott,

Does the show/hide attributes have to be determined by the same query as the repeater?

I believe so, but I have not tested it myself, so I am not sure.

I’ll ask everyone… thanks.

Dave,

Does the show/hide attributes have to be determined by the same query as the repeater?

I’m wanting to show an add button when there is no record. Once the record has been added, hide the add, and show the update button.

Any tips?

You can use the Show/Hide with any recordset. Doesn’t have to be the repeater recordset. Having said that in what case would you need to use a different recordset? It’s very easy to use the same recordset and show/hide using ‘has items’.

Thanks Brad.

I have two tables (1 - church, and 2 - service) that are sharing ids that are joined. The repeater shows the data from the church table. From the church data, when the update or add new buttons are clicked, it passes the id from that church record to the service table.

Once the a new service record is added, I want that add button to be hid, and an update button to be shown when the user returns to the page. Of course, when that update button is clicked it would open the update page for the service.

After several failed attempts, I am blank as what to do. That’s why I am thinking that I may need to add a line to the church query that checks the service data for an id.

Any ideas would be ‘apreciado mucho’ …