th:field not working?

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

th:field not working?

Hello i have been stuck trying to use thymeleaf for making a post request of a form but for some reason specifically th:field is not working ( i did try and error to narrow the problem down. ) i have looked up online but i cant really see the issue i am having.

here is some code.

 public class DepositeMoneyBean {
        private Integer transaction_id;
        private Integer transaction_user_id;
        private String transaction_type;
        private String amount;
        private Date transaction_date;
        private Integer credit_id;
        private Integer end_user_money;
        private Double current_amount;
this includes getters, setters, toString, and contructors.

  <div class="container">
                                        <form action="#" th:action="@{/makeadeposit}" th:object="${depositeMoneyBean}"
                                                        Id: <input type="text" th:field="*{amount}" />
                                                        <input type="submit" value="Submit" />

and Controller

        public String makeADeposite(@ModelAttribute DepositeMoneyBean depositeMoneyBean) {
                return "redirect:/";

any idea why this is happening? thx in advance

Reply | Threaded
Open this post in threaded view

Re: th:field not working?

fields naming with underscore...