makumba / makumba

Makumba helps you rapidly develop data driven web applications. Provides a custom JSP taglib as a main interface, but leaves API open for advanced access. It is implemented in Java.
https://www.makumba.org
GNU Lesser General Public License v2.1
5 stars 2 forks source link

mak:input name="somedatefield" type=hidden misprinted in html form #11

Closed ghost closed 21 years ago

ghost commented 21 years ago

Reported by @frederikhabils on 13 Oct 2002 18:11 UTC <mak:input name="student.person.birthdate" value="$student.person.birthdate" type="hidden"/>

messes up the way it goes to the html

=> sets hidden fields to result (in query string)

student.person.birthdate_0=1&student.person.birthdate_1=1977&student.person.birt hdate_2=0

while should be

student.person.birthdate_null=&student.person.birthdate_0=1&student.person.birth date_1=0&student.person.birthdate_2=1977

can at the moment (but not for long?) be seen in http://18080.makumba.org/fred-k/johnny/student/register/registerStep1.jsp http://18080.makumba.org/fred-k/johnny/student/register/registerStep2.jsp

Migrated-From: http://trac.makumba.org/ticket/12

ghost commented 21 years ago

Comment by @frederikhabils on 13 Oct 2002 18:30 UTC to be more clear (?) it would seem that this is not done correct:

"date is splitted in 3 inputs, _0 (day), _1 (month), _2 (year) "

quoted from http://www.best.eu.org/makumba/makumba-spec.html#input

ghost commented 21 years ago

Comment by @frederikhabils on 13 Oct 2002 19:02 UTC found easy fix

in : classes/org/makumba/view/jsptaglib/dateEditor.java in : void formatComponent(StringBuffer sb, Date d, String fmt, int component, boolean hidden) in : if(hidden)

line : sb.append("<input type=\"hidden\" name=\"").append(name).append("\" value=\"").append(c.get(component)).append("\">");

should be : sb.append("<input type=\"hidden\" name=\"").append(name).append("\" value=\"").append(c.get(components[the componentscomponent).append("\">");

(note))

because otherwise, the wrong constant for Calendar.get() is used.

java.util.Calendar public static final int DATE 5 public static final int ERA 0 public static final int MONTH 2 public static final int YEAR 1

(Stefan is implementing it and building 0.5.3.35.

ghost commented 21 years ago

Comment by @stefanb on 13 Oct 2002 19:22 UTC applied fix suggested by Fred in Comment 2 and released 0.5.3.35