facebook

Hiding the h:dataTable header when no rows found

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #264638 Reply

    pmohanan
    Member

    Hi…,

    How do I hide the datatable column header(s) when there are no rows found to populate it. Once the response comes back with 0 rows, the page displays only the header .

    Regards

    #264786 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev

    #264888 Reply

    The easiest way is to use JSTL-EL to filter the response. I usually use something like this to wrap my table creation code:

    
    <c:if test="${not empty resultSet}">
    
        ... table creation code ...
    
    </c:if>
    

    …where “resultSet” refers to whatever data bean variable you have defined.

    You could also add another statement that tests the alternative condition (i.e. the data set IS empty), and provide a message to the user stating “No rows returned.” or equivalent is you like.

    Regards,
    -Rod

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Hiding the h:dataTable header when no rows found

You must be logged in to post in the forum log in