We create command links on a page. The same command link is sometimes used on a different page of the web site. When first created because Page A does not have a form.
Scenario 1
Page A (no form on page)
- Some text
Need a link. So, create command link surrounded by a form.
Scenario 2
Page B (reuse commandLink from Page A on page B)
<h:form>
Some text
Need a link. So, create command link surrounded by a form.
Reuse commandlink component from PageA
</h:form>
Throws an error, inner form exception.
- Cannot use h:link because of url issues.
- Can we use h:outputLink instead of commandLink to avoid form issues?
- Can we create a custom jsf component to create commandLink. Check if form exists on page. If yes, do not add form. If no, add form around commandLink.