Retrieving object and setting in a modal

0

How do I do when I click the editar trigger, a modal open with the data of an object that I previously selected in the table?

Follow my code:

<div class="container">
            <div class="row" style="background-color: white; padding: 10px;">
                <div class="col-md-3">
                    <a href="#cadastro" class="edit" data-toggle="modal" data-target="#cadastro">
                        <span style="width: 20px; height: 50px;" class="glyphicon glyphicon-plus" aria-hidden="true"></span>
                    </a>
                    <a href="#editar" data-toggle="modal" class="edit" data-target="#editar">
                        <span class="glyphicon glyphicon-pencil" style="width: 20px; height: 50px;" aria-hidden="true"></span>
                    </a>
                    <a href="#">
                        <span class="glyphicon glyphicon-trash" style="width: 20px; height: 50px;" aria-hidden="true"></span>
                    </a>
                                    </div>
                <div class="col-md-9">
                    <div class="input-group">
                        <input type="text" id="search" class="form-control" placeholder="Search for...">
                        <span class="input-group-btn">
                            <button class="btn btn-default" type="button"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></button>
                        </span>
                    </div>
                </div>
            </div>
        </div>
<div class="container" style="background-color: white;">
             <div class="table-responsive">
                 <table class="table table-striped table-bordered" id="table">
                     <tr onclick="toggle(this)">
                            <th>Nome</th>
                            <th>Email</th>
                            <th>Papel</th>
                            <th>Status</th>
                        </tr>
                        <tbody>
                        <c:forEach items="${sessionScope.listaDeUsuarios}" var="usuario">
                            <tr id="row" onclick="changeColor();">
                                <td>${usuario.id}</td>
                                <td>${usuario.username}</td>
                                <td>${usuario.email}</td>
                                <td>${usuario.papel}</td>
                                <td>${usuario.status}</td>
                            </tr>
                        </c:forEach>
                    </tbody>
                </table>
            </div> 
        </div>
    
asked by anonymous 26.01.2016 / 02:59

0 answers