jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 12189] - Setting default values for the <input:checkbox> Tag
Date Thu, 20 Oct 2005 19:53:55 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=12189>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=12189





------- Additional Comments From karl@xk72.com  2005-10-20 21:53 -------
That could work, however adding another field to the form changes the nature 
of what's generated in the HTML, and I think the input taglib has always been 
a 1-1 type of library. It could cause difficulty for people iterating over a 
form at runtime (eg Javascript); it would post either a single (the hidden) or 
multiple values depending upon the check state, which might be misinterpreted 
on the server; finally in a situation where there are multiple checkboxes with 
the same name it would cause all of the off values to be sent with any on 
values which would require special treatment on the server side.

I've had long enough to think about this! I think the real issue is knowing 
whether this is a redisplay of the form or the initial display. In the case of 
a redisplay we want to use the information in the request, in the case of an 
initial display we want to use the default.

In comment 2 I suggested using another field in the form (a non checkbox) to 
indicate whether this was a redisplay or not. The only problem with that is 
that some fields will possibly be on multiple pages in a sequence of forms so 
we could be steered wrong.

How about this for a solution? We add an "indicator" (or better name) 
attribute to the form tag, if the request parameter with the name given in 
indicator is set then we assume this is a redisplay, and use the appropriate 
default logic on checkboxes in the form. Also we add an indicator attribute to 
the checkbox tag so that it can be controlled at a closer level (say different 
parts of the same form appear each time you submit so there is no one 
indicator to say if the whole form is a redisplay).

I think this could work quite nicely; it will be 100% backwards compatible (no 
changes in generated code) and I think should work for all situations (except 
where there are only checkboxes in a form in which case you would need to 
artificially introduce a hidden indicator field).

What are your thoughts?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Mime
View raw message