Generic dialog on Hymeleaf

Asked

Viewed 252 times

2

Good evening friends,

Has anyone ever tried or done a generic dialogue on Hymeleaf?

What I want is:

Instead of writing code to confirm the deletion of a data on the screen that is something simple, I would like to do a generic, where I would just have the confirm or cancel button, and then just include it on my page.

  • I think this tutorial can help: http://nixmash.com/java/javascript-thymeleaf-and-spring-mvc/

  • I looked man, but I guess that’s not it yet

1 answer

1

You can use layout:Developer and layout:Ragment by what I understand you want the contents of the screens to be changed but without changing what is around as example the menus.

on your "Main.html" screen you should put a layout:Ragment as in the example:

 
<div layout:fragment="conteudo">
  <p>Conteúdo principal</p>
</div>

In this location will be injected the content that you put in other pages. In the other pages you will use a developer, in this case I called "Main" and implement the "Content" of the layout:Ragment, example:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	layout:decorator="Principal">
<head>
</head>
<div layout:fragment="conteudo">
Pagina 1
</div>
</html>

You can look at the full documentation on http://www.thymeleaf.org/doc/articles/layouts.html

Browser other questions tagged

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