Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In JSF, the name attribute is computed based on the combination of the 'id' atribute of the jsf component and the 'id' attribute of the form. The reason for this is explained by <a href="https://stackoverflow.com/users/157882/balusc">BalusC</a> <a href="https://stackoverflow.com/questions/11406215/why-does-hselectoneradio-does-not-have-a-name-attribute">here</a>. So if you specify an id for a JSF component, then the name is also computed for it.</p> <p>Anyways, starting HTML5 usage of name attribute for <code>&lt;a&gt;</code> tag is made obsolete instead it is recommended to use the id attribute of the nearest container. So do not rely on the name attribute.</p> <p>Though you can try to focus any of these:</p> <pre><code>&lt;h2 id="top4"&gt;This is a heading&lt;/h2&gt; or &lt;h2&gt;&lt;a id="top4"&gt;This is a heading&lt;/a&gt;&lt;/h2&gt; </code></pre> <p>Or simply focus a container on the target page like this:</p> <p>In HTML 4.01</p> <pre><code>&lt;div id="top4"&gt; &lt;h2&gt;This is a heading&lt;/h2&gt; &lt;p&gt;This is a paragraph&lt;/p&gt; &lt;/div&gt; </code></pre> <p>In HTML 5</p> <pre><code>&lt;article id="top4"&gt; &lt;h2&gt;This is a heading&lt;/h2&gt; &lt;p&gt;This is a paragraph&lt;/p&gt; &lt;/article&gt; </code></pre> <p>Now in JSF, this is how you focus the container on the target page:</p> <p>When the outcome is a different page but in the same application:</p> <pre><code> &lt;h:link id="link1" value="link1" outcome="welcome" fragment="top4" /&gt; </code></pre> <p>where the outcome is welcome.xhtml which is relative to the context root, and "top4" is the id of the container to be focused when the target page is rendered.</p> <p>When linking an external site:</p> <pre><code> &lt;h:outputLink id="link2" value="http://www.msn.com/#spotlight"&gt;link2&lt;/h:outputLink&gt; </code></pre> <p>Within the same page:</p> <pre><code>&lt;h:link id="link3" value="link3" fragment="top4" /&gt; </code></pre> <p>Here there is no outcome specified, so the outcome will be the same page.</p> <p>See also:</p> <ul> <li><a href="http://dev.w3.org/html5/markup/a.html" rel="nofollow noreferrer">http://dev.w3.org/html5/markup/a.html</a></li> <li><a href="http://docs.oracle.com/cd/E17802_01/j2ee/javaee/javaserverfaces/2.0/docs/pdldocs/facelets/h/link.html" rel="nofollow noreferrer">h:link</a></li> <li><a href="http://docs.oracle.com/cd/E17802_01/j2ee/javaee/javaserverfaces/2.0/docs/pdldocs/facelets/h/outputLink.html" rel="nofollow noreferrer">h:outputLink</a></li> </ul>
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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