Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9204519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:43:43+00:00 2026-06-17T23:43:43+00:00

I wonder if anyone can help. I am working on a Spring/Webflow/Tiles/Thymeleaf project. All

  • 0

I wonder if anyone can help.

I am working on a Spring/Webflow/Tiles/Thymeleaf project. All is going reasonably well. We have tiles which represent the data entry forms, typically like this:

<form th:object="${questionnaire}">
    .... 
    <select th:field="*{title}>
        <option ..... 
    </select>
    .... 
    <input th:field="*{fname}" />
    <input th:field="*{lastname}" />
    .... 
</form>

This is working well. But now we are trying to add some ajax magic to the form. Basically the idea is that when a button is pressed it triggers a webflow transition which will render its response in a tile. This is all working well … expect the content of the fragment tile. The idea is that the new fragment will be some extra form fields. Something like this:

<div tiles:fragment="moreDetails">
    .... 
    <input th:field="*{phone}" />
    <input th:field="*{email}" />
    .... 
</div>

The webflow and tiles part is working, but when thymeleaf tries to render the tile, it complains that the form fields refer to properties with *{} syntax, but not enclosed in a form tag with th:object

So far we’ve come up with only 2 workarounds. We can put the form tag with th:object in the fragment tile, but this means we have a nested form in the resultant page 🙁
The other thing we’ve found we can do is simply write the input fields in the fraement with a name attribute rather than th:field
Both ‘solutions’ feel wrong

Does anyone know if there is a better, more thymeleaf friendly way of doing this?

Cheers

Nathan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:43:44+00:00Added an answer on June 17, 2026 at 11:43 pm

    I posted the same question on the thymeleaf forum, and Daniel, the author of thymeleaf replied :
    http://forum.thymeleaf.org/Spring-fields-in-an-ajax-tile-td4025527.html

    "th:field" is in fact a sort of macro that gives a value to the "name", "id" and "value" of an input. So in case you cannot use th:field directly, you could assign "name" and "id" to a fixed value, and then "th:value" like:

    <input id="phone" name="phone" th:value="${questionnaire.phone}" />
    

    Regards, Daniel.

    Basically, the 2 workarounds I already mentioned are the ony way to achieve this. Not ideal (IMHO) but at least we have an answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wonder if anyone can help. I am working on a Spring Webflow 2
I have a VC++ Win32 DLL project. I wonder if anyone can help me
I wonder if anyone can help. I'm writing a Spring MVC / Webflow web
I wonder if anyone can help - I have this error showing recently when
I wonder if anyone can help me to understand where I could be going
I'm a newbie programmer working with jQuery and wonder if anyone can help me
I wonder if anyone can help, I have the following xml file, the problem
wonder if anyone can help; I have an a two dimensional array which I
I wonder if anyone can help with the following. I have integrated both iAds
wonder if anyone can help. Bascially I'm working on a site, and a chunk

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.