Results 1 to 3 of 3

Thread: Request for small CheckboxTag improvement

  1. #1

    Default Request for small CheckboxTag improvement

    Hidden input part of CheckboxTag rendered output should be really styled with "display:none;". I was run into some issues with display because of CSS inheritance, where hidden input tag inherits some border style and this is visible in browser (at least in Firefox). When I changed CheckboxTag source in line 118, simply by adding

    tagWriter.writeAttribute("style", "display:none;");

    display was performing as expected. I'm using Spring v2.0.5.

    Regards,
    Damir Murat

  2. #2
    Join Date
    Sep 2004
    Location
    Manchester, NH
    Posts
    1,236

    Default

    I don't think this is a bug. It sounds like a bug in your CSS, where you're incorrectly applying a style to all INPUT elements, and not clearing this style explicitly for INPUT type="hidden" elements. A simple way to do this is add a CSS rule:
    Code:
    INPUT[type=HIDDEN] {
     display: none;
    }
    At least, I'll maintain this opinion until/unless you can demonstrate that elements of INPUT type="HIDDEN" can affect page layout, assuming a properly constructed page (valid HTML) and correctly applied CSS rules
    Peter Mularien | Blog
    Author, Spring Security 3 (Book) - Packt Publishing, Available in print and eBook form
    SCJP 5, Oracle DBA
    Any postings are my own opinion, and should not be attributed to my employer or clients.


  3. #3

    Default

    Thanks for your reply. I was not aware of this type of CSS selectors (I'm rather inexperienced with CSS as you might guessed). I will certainly use it.

    But allow me to elaborate a little bit more on this. First I don't think this is a bug (as title of my post suggests), but CheckboxTag results in generation of two input tags where on one of them (checkbox) you can apply style and CSS class (through cssClass and cssStyle attributes) but you don't have this kind of control on generated hidden element. To be honest, I'm not sure if style and class attributes should be really exposed for hidden element, but it seams to me as a little inconsistency.

    Of course, I can live with that, especially with your suggested solution :-) Thanks again.

    Regards,
    Damir Murat

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •