Note that there are some explanatory texts on larger screens.

plurals
  1. POAjax fallback when Javascript is disabled
    primarykey
    data
    text
    <p><strong>Problem:</strong><br/> i) In a JSF2 application, I want to create a page with a tab control, where, when the user clicks on a tab, the contents for the panel below is loaded from an xhtml file in the server through an ajax call.<br/> ii) I want this to support graceful degradation (when Javascript is disabled), so that upon clicking the tab, an HTTP request is fired, and a new page is loaded...or the other way round, through progressive enhancement.<br/></p> <p><strong>Partial solutions:</strong> i) I guess I can accomplish this through the code example posted by BalusC in <a href="https://stackoverflow.com/questions/7737759/how-to-ajax-jsf-2-outputlink">How to ajax jsf 2 outputLink</a><br/> :-</p> <pre><code>&lt;h:form&gt; &lt;f:ajax render=":include"&gt; &lt;h:commandLink value="Home" action="#{menuManager.setPage('home')}" /&gt;&lt;br /&gt; &lt;h:commandLink value="FAQ" action="#{menuManager.setPage('faq')}" /&gt;&lt;br /&gt; &lt;h:commandLink value="Contact" action="#{menuManager.setPage('contact')}" /&gt;&lt;br /&gt; &lt;/f:ajax&gt; &lt;/h:form&gt; &lt;h:panelGroup id="include"&gt; &lt;ui:include src="#{menuManager.page}.xhtml" /&gt; &lt;/h:panelGroup&gt; </code></pre> <p><strong>Question</strong><br/> How can I extend this to solve problem (ii) Or is there any other completely different method? I think <em>maybe</em> I could achieve this with a noscript, but can't figure out how!</p> <p><strong>EDIT: Possible solution - yet to verify</strong>:<br/> The above code should work even if ajax is disabled; it should just work through HTTP, according to <a href="http://www.laliluna.de/articles/posts/jsf-2-evaluation-test.html" rel="nofollow noreferrer">http://www.laliluna.de/articles/posts/jsf-2-evaluation-test.html</a> :) <br/> Elegant! I'll try it out.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload