th:object and th:remove in one tag

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

th:object and th:remove in one tag

meyertee
Hello,

I've just upgraded from Thymeleaf 1.x to 2.0.2 and noticed the following change of behavior.
It used to be possible to select an instance in a tag and remove that tag, like so:

        <div th:object="${test}" th:remove="tag">
                <span th:text="*{text}">Text</span>
        </div>

Where test is a simple instance like this:
        private class Test{
                public String text = "Hi";
        }

Now the selected object is null. Is that a bug or a change in precedence?
Btw, th:object is missing in the precedence list of the Using Thymeleaf document.
I'm using Spring 3.1.0.

Best wishes, Thomas.
Reply | Threaded
Open this post in threaded view
|

Re: th:object and th:remove in one tag

danielfernandez
Administrator
Hi,

This was a bug. Selection target was not being correctly processed when the tag was removed like you did.

It is now fixed in the source code trunk, and a new snapshot version has been released with version number "2.0.3-SNAPSHOT", containing this fix.

See http://www.thymeleaf.org/faq.html for instructions on how to use a snapshot version.

This fix will go into next version (2.0.3).

Thanks
Daniel.
Reply | Threaded
Open this post in threaded view
|

Re: th:object and th:remove in one tag

macjariel
It is not working for me in 2.0.12. I didn't test it in earlier versions, so maybe it's a regression or maybe it wasn't really fixed. Or maybe I'm doing something wrong.

Reply | Threaded
Open this post in threaded view
|

Re: th:object and th:remove in one tag

danielfernandez
Administrator
Hi,

It is not exactly a regression, but a bug of a different nature appeared in 2.0.9 that happens to cause this same effect in some cases.

It has been fixed at the code trunk and also in 2.0.13-SNAPSHOT. See http://www.thymeleaf.org/faq.html in order to learn how to use a snapshot version.

Regards,
Daniel.