Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make JSF / Seam pages accessible without JavaScript

I'm currently checking a complex web application for accessibility without JavaScript. We heavily rely on JSF and Seam to render the pages and I'm more than annoyed about the overall behaviour when JavaScript is turned off. Many links and buttons rely on JavaScript to perform even the most basic operations.

  • Is there some general documentation about that topic?
  • Has any of you some advise how to maintain accessibility?

My first investigations showed that tags like <s:button> can be replaced with <h:commandButton>. But a few minutes later I've realized that even <h:commandLink> doesn't seem to work without JavaScript. I'd love to have some documentation that describes what parameters that make JS mandatory and showing alternate ways to achieve the same elements.

It's understood that things like onClick and others won't work without JS. But I really need to make at least the basic actions behind those links and buttons work. Currently much of the webapp can't be navigated without JS and that's unacceptable.

like image 446
Daniel Bleisteiner Avatar asked Mar 15 '26 19:03

Daniel Bleisteiner


1 Answers

I had the same accesibility requirements for my previous project.

What I've done is the following: Just use s:link or h:commandlink for users who have JS and put there a noscript tag with a h:commandbutton styled like your link (as good as possible).

And also make sure that s:link or h:commandlink is default hidden in the CSS and made visible with JS. This way you only get one link or button seen when JS is off.

You can do this easily with Jquery.

Cheers. <>

like image 83
Serkan Avatar answered Mar 17 '26 10:03

Serkan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!