field*{} property inside th:attr

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

field*{} property inside th:attr

apprentice
The following field is null on submit. Whats the correct syntax to wrap the attribute "field*{}" inside the th:attr attribute?

This is null on submit;

<input th:attr="field=*{chart},value=#{label.sub}" group="chart" id="chart-1" type="radio" />

but this works

<input  th:field="*{chart}" th:value="#{label.sub.1}" group="chart" id="chart-1" type="radio" />
Reply | Threaded
Open this post in threaded view
|

Re: field*{} property inside th:attr

Metroids
I don't think what you're doing is possible.  As far as I know, you can't use th:attr to create any other "th:***" attributes.  You can only resolve them to regular attributes.

You might be able to do this by making the setting the "name" attribute rather than "field" so that they line up with what th:field would generate normally, but I don't really see the point here...