How to return a message "'No document type registered" when nothing returns from the database

Asked

Viewed 45 times

0

I would like to know how I put in Thymeleaf for when I find nothing in the bank I return a personalized message on the web page "No document registered".

Document Type Types of Documents Add

<div class="container-fluid px-5">
    <table class="table">
        <tbody>         
            <tr>
                <th >Descrição</th>
                <th >Opções</th>
            </tr> 
        </tbody>
        <tbody>
          <tr th:each="tipoDocumento: ${tipoDocumentos}">
          <td th:text="${tipoDocumento.descricao}"> </td>
          <td> 
                        <a class="btn btn-primary-link btn-onlyicon py-2" th:href="@{'/selecao/tipo-documento/editar/' + ${tipoDocumento.id}}" title="Editar"><i class="fa fa-pencil" aria-hidden="true"></i></a>
                        <a class="btn btn-primary-link btn-onlyicon py-2" th:href="@{'/selecao/tipo-documento/remover/' + ${tipoDocumento.id}}"  title="Remover" onclick="confirm({},event)"><i class="fa fa-trash" aria-hidden="true"></i></a>
             </td>
          </tr>    
        </tbody>    
    </table>
</div>

  • Probably the return of the bank will be Empty, You can Put this Error message within that description in the back end or Create some javascript routine, with an Alert for example, when the description is empty, and then the user will be warned that no Document was Registered. :)

  • I recommend putting a Re-turn on the back end with a message and when you click on the link and return that message you fire an Alert!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.