Im trying to write a PrimeFaces paginator to be more compliant with WCAG rules.
Originaly page links (1 2 3 4 5) are not links, but <span>
with plain page number. I wrapped that number with '' so they can be focused and title explaining what this link is for. Renderer works just fine, however after using it and changing page (AJAX request) page links are rendered oldstyle.
Why is that, and how to fix it?
My render gives:
<span class="ui-paginator-pages">
<span class="ui-paginator-page ui-state-default ui-state-active ui-corner-all">
<a class="ui-paginator-page ui-state-default ui-state-active ui-corner-all" tabindex="10000" title="Link to page nr: 1">1</a>
</span>
<span class="ui-paginator-page ui-state-default ui-corner-all">
<a class="ui-paginator-page ui-state-default ui-corner-all" tabindex="10001" title="Link to page nr: 2">2</a>
</span>
</span>
after changing page result is
<span class="ui-paginator-pages">
<span class="ui-paginator-page ui-state-default ui-corner-all" tabindex="0">1</span>
<span class="ui-paginator-page ui-state-default ui-corner-all ui-state-active" tabindex="0">2</span>
</span>
so as you can see, after update structure is like in plain PrimeFaces. anchors are gone and tab index is back to 0
Reason for this strange behavior is that rendering page after AJAX request is done by JavaScript code defined in PrimeFaces. This means that overwriting default renderer in such cases has to be done both in Java and JavaScript.