If you want your modal to render data from the server without having to refresh the current page, then you'll need some type of "ajax" to retrieve the data and populate the modal.
A quick example (i'm assuming you have jquery, and bootstrap css+js):
//button to launch your modal
<a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a>
//your modal
<div id="myModal" class="modal hide fade" ...
...
<div id="modal-body">..
</div>
One way to load data into the modal is tying ajax call to the modal "show" event. This is a very basic example, but whenever the modal shows, a call to myController/myAction/someid to load data into modal-body div
$(document).ready(function() {
$('#myModal').on('show', function () {
$.ajax({
type: "GET",
url: "${createLink(controller: 'myController', action: 'myAction', id: 'someid')}"
}).done(function(data) {
$('#modal-body').html(data);
});
});//end on()
});//end ready()
Some things to consider:
- you'll probably want to do some type of content negotiation to pass back json data vs raw html
- a less localized method of passing url: to ajax call
Hopefully that'll get you started with some ideas