Article:
  Improving JSF by Dumping JSP
Subject:   Fantastic!
Date:   2004-06-10 05:26:18
From:   erikhatcher
Excellent article - thank you for redeeming JSF to me. I'm a die hard Tapestry developer at the moment and you have given me hope in JSF. I cannot stand the JSF/JSP combination either - it is ugly and ugly things are wrong.


One interesting issue with your implementation, however, is your use of the 'id' attribute. This has been debated extensively in the Tapestry community, since the use of 'jwcid' makes templates not quite pure HTML. But, by using 'id' you have to take into account JavaScript interactions that rely on client-side id's being controllable. How do you account for that in your implementation?

Full Threads Oldest First

Showing messages 1 through 5 of 5.

  • ... and CSS
    2004-06-10 05:27:30  erikhatcher [View]

    ...not just JavaScript, but CSS also, when it comes to the importance of controlling the 'id' attribute.
    • ... and CSS
      2004-06-10 10:06:35  Hans Bergsten | O'Reilly Author [View]

      I'm sure this is a hot potato, but the HTML elements the JSF components render already sets the "id" attribute, so this issue isn't specific to the custom ViewHandler described in the article.

      For CSS, I believe the "class" attribute is more commonly used than the "id" attribute, so I don't see that as a big deal (but I may be wrong).

      For JavaScript, I admit it's a problem that needs to be dealt with in upcoming versions of the JSF spec. With JSF 1.0, there are methods that should be called to get the "id" attribute value from code that generates JavaScript dynamically (such as a Renderer), but this could be automated a lot more. For JavaScript entered as static text in the template, you currently need to understand the rules for how the specified "id" attribute can be adjusted by JSF and apply the same rules manually to the JavaScript code (which isn't totally fail-safe, but works pretty well for HTML at least).
      • ... and CSS
        2004-06-10 13:32:50  denka [View]

        use of "class" attribute is discouraged by W3C, so it's a big deal. Workaround can be thought of: id="checkbox myComponentId" might work as well
        • ... and CSS
          2004-06-14 15:06:52  jt2190 [View]

          I did a double take when I read the post above, so just to clarify, this is what the W3C said about using class and ids:

          By using the ID attribute as selector, one can set style properties on a per-element basis. While style sheets have been designed to augment document structure, this feature will allow authors to create documents that present well on the canvas without taking advantage of the structural elements of HTML. This use of style sheets is discouraged.

          Original here: .