Conflict between show/hide conditions and classes

I have a table with buttons to select items (to add/remove record ids to/from a cookie). A message indicates the number of selected items; for this, I have two paragraphs with show/hide conditions*. I’ve used this approach before without any problems, but couldn’t get it to work today. These two paragraphs were shown regardless of any items being selected:

<p class="d-sm-block" dmx-show="cookies1.data.idlist.trim()">records selected: {{cookies1.data.idlist.wordCount()}}</p>
<p class="d-sm-block" dmx-hide="cookies1.data.idlist.trim()">no records selected</p>

It turned out the classes were causing the problem. When I removed these, the show/hide conditions worked as expected. It seems classes and conditions conflict. I realise there could be cases where they might conflict, but not in this case.

*On a related matter: I haven’t found a way to indicate ‘records selected: 0’, unless the cookie is removed. So whether a cookie contains a single value or no values, the wordCount still returns ‘1’. Is there a reason for this? Is there any other way of determining if a cookie has a value or not?

Community Page
Last updated: