Get ready for BLACK FRIDAY shopping starting in

DMXzone App Connect Support Product Page

show element when repeat is empty

Reported 30 Jan 2018 11:32:30
2
have this problem
30 Jan 2018 11:32:30 Hans Haverlach posted:
I've a (nested) repeat with a filter on it:

dmx-repeat:showparents="sv_parents.data.q_tsoparents.where(`obo_obopties`, oo_id, "==")">


Sometimes the filter gives the repeat no data to show. In that case I want to show a div with a message.
I tried the dynamic attribute to show or hide. But in the WHEN field you cannot put something like: showparents: hasitems or something like that, like you can with a server connect query.

Is there a solution for this?

Replies

Replied 01 Feb 2018 08:14:08
01 Feb 2018 08:14:08 Teodor Kuduschiev replied:
Replied 01 Feb 2018 13:02:08
01 Feb 2018 13:02:08 Hans Haverlach replied:
Hi Teodor,

Yes I've seen that movie already. And it is clear, but not for above situation.
The 'Has items' condition only can be chosen with queries.

Look at my code above: the repeater takes data from the query (q_tsoparents) (and receives data, so it has items!).
But then the repeater itself has a filter: .where(`obo_obopties`, oo_id, "==&quot.
This filter sometimes returns data, sometimes not.
And here I want to use the show or hide dynamic attributes. But that seems not to be possible, since it is not the query that contains no items, but the repeater.
Replied 01 Feb 2018 13:40:46
01 Feb 2018 13:40:46 Teodor Kuduschiev replied:
Well, then just use nested repeat regions in the server action instead.
Replied 05 Feb 2018 09:05:29
05 Feb 2018 09:05:29 Hans Haverlach replied:
Ah yes, sometimes I'm to focused on the App connect section. The server actions provide many functions too. I'll try.
Thank you for pointing this out Teodor.
Replied 05 Feb 2018 09:17:24
05 Feb 2018 09:17:24 Teodor Kuduschiev replied:
Here's a tutorial about nesting queries: www.dmxzone.com/go/32997/nesting-database-queries

Reply to this topic