Skip to main content
add parentheses
Source Link
Jakub Ch.
  • 3.7k
  • 3
  • 28
  • 45

The th:field attribute overrides content of name and value attributes. The decisionForm object seems to have empty fields so all forms have empty values.

Basically using th:object with th:field is convenient when you need to have your form prepopulated with values. It establishes initial state of your form, not the target. Using them makes sense for single form, not for multiple forms in loop with varying values.

In your case it seems most reasonable to drop: please remove both th:object and th:field attributes. Instead use value=1value="1" or value=2value="2" for decision input, and th:value=$value="${applicationOpen.id}" for application_id input.

The th:field attribute overrides content of name and value attributes.

Basically using th:object with th:field is convenient when you need to have your form prepopulated with values. It establishes initial state of your form, not the target.

In your case it seems most reasonable to drop both th:object and th:field attributes. Instead use value=1 or value=2 for decision, and th:value=${applicationOpen.id} for application_id.

The th:field attribute overrides content of name and value attributes. The decisionForm object seems to have empty fields so all forms have empty values.

Basically using th:object with th:field is convenient when you need to have your form prepopulated with values. It establishes initial state of your form, not the target. Using them makes sense for single form, not for multiple forms in loop with varying values.

In your case: please remove both th:object and th:field attributes. Instead use value="1" or value="2" for decision input, and th:value="${applicationOpen.id}" for application_id input.

Source Link
Jakub Ch.
  • 3.7k
  • 3
  • 28
  • 45

The th:field attribute overrides content of name and value attributes.

Basically using th:object with th:field is convenient when you need to have your form prepopulated with values. It establishes initial state of your form, not the target.

In your case it seems most reasonable to drop both th:object and th:field attributes. Instead use value=1 or value=2 for decision, and th:value=${applicationOpen.id} for application_id.