• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question about using logic:empty tag

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to display a table containing a list of all items related to a particular option. If the selected option does not have any associated items, a message 'No Items Found' should be displayed. I implemented it by checking if the list of items that will be retrieved from a database will return nothing. In this case, I was able to display in my jsp a message informing the user that no items are found and the table containing the list of items otherwise. My problem is that since upon loading, my list does not contain any values since the user has not selected any option, the message is already displayed.

<pre>
<!-- Display table of items based on selected option -->
<logic:notEmpty name="myForm" property="myList">
<tiles:insert page="myListTiles.jsp" flush="true">
</tiles:insert>
</logic:notEmpty>

<!-- Display message if no items are associated with the option >
<logic:empty name="myForm" property="myList">
<A>No Items</A>
</logic:empty>
</pre>

Can anyone help me how I can resolve this? Thanks in advance.
 
I'm sure glad that he's gone. Now I can read this tiny ad in peace!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic