You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Kevin Hale Boyes <kc...@gmail.com> on 2006/05/25 08:17:53 UTC

does h:commandLink need a h:form

I have the following findex.jsp file

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<html><head><title>title</title></head><body>
<f:view>
	<h:commandLink action="navoutcome" value="Go" />
</f:view>
</body></html>


but when I click "Go" I get an error in my JavaScript Console.
"clear_linkDummyForm is not defined"
  in http://localhost:8080/findex.jsf#


If I wrap the commandLink in an <h:form> then I don't get an
error and it navigates properly.

Do commandLink's need a surounding form?
I didn't think so but wanted to ask.

Using
MyFaces 1.1.3
Tomahawk 1.1.2


Thanks,
K.

Re: does h:commandLink need a h:form

Posted by Craig McClanahan <cr...@apache.org>.
On 5/24/06, Kevin Hale Boyes <kc...@gmail.com> wrote:
>
> I have the following findex.jsp file
>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
>
> <html><head><title>title</title></head><body>
> <f:view>
>         <h:commandLink action="navoutcome" value="Go" />
> </f:view>
> </body></html>
>
>
> but when I click "Go" I get an error in my JavaScript Console.
> "clear_linkDummyForm is not defined"
>   in http://localhost:8080/findex.jsf#
>
>
> If I wrap the commandLink in an <h:form> then I don't get an
> error and it navigates properly.
>
> Do commandLink's need a surounding form?
> I didn't think so but wanted to ask.


Yes, it does ... the whole point of a CommandLink is that it is "a hyperlink
that submits the form containing it."  If you want a hyperlink that doesn't
have to be in a form, use an OutputLink instead.

Using
> MyFaces 1.1.3
> Tomahawk 1.1.2
>
>
> Thanks,
> K.
>

Craig