Currently utilizing JSF2.
I have a button that triggers an action and then updates a section of the page (fairly standard).
<h:commandButton value="foo" action="#{myBean.myAction}" >
<f:ajax execute="@form" render="#content" />
</h:commandButton>
The website must be accessible to individuals with disabilities, so I need to ensure functionality even when JavaScript is disabled.
Personally, I believe the ideal solution would involve completely reloading the page when JS is disabled.
I considered setting a cookie upon the initial page load indicating the presence of JS, and then using rendered="someBeanThatReadsCookies" to display either an ajaxed button if JS is enabled or a regular button if it isn't, but I find this approach somewhat inelegant.
If anyone has a more refined solution, I would greatly appreciate it.
I understand that this issue is similar to the one discussed in this thread Ajax fallback when Javascript is disabled
However, I am not satisfied with the provided answer. In my case, simply disabling JS results in the button becoming non-functional rather than providing a suitable fallback option.