Hi,
laredotornado schrieb:
Hi,
Im using MyFaces 1.1.6 with Tomahawk 1.1.7 on WebLogic 9.2.2. Upon visiting
my JSF page, I'm getting the error:
Exception while calling encodeEnd on : {Component-Path : [Class:
javax.faces.component.UIViewRoot,ViewId: /jsp/search_results.jsp][Class:
javax.faces.component.html.HtmlDataTable,Id: dt1][Class:
javax.faces.component.UIColumn,Id: _idJsp49][Class:
javax.faces.component.html.HtmlPanelGroup,Id: _idJsp51]}
Caused by:
java.lang.IllegalArgumentException - Link is not embedded in a form. Change
component/tag 'dt1:0:_idJsp52' from javax.faces.*/<h:tagName /> to
org.apache.myfaces.*/<t:tagName />, or embed it in a form. This is not a
bug. Please see: http://wiki.apache.org/myfaces/Upgrading_to_Tomahawk_1.1.3
The path to this component is {Component-Path : [Class:
javax.faces.component.UIViewRoot,ViewId: /jsp/search_results.jsp][Class:
javax.faces.component.html.HtmlDataTable,Id: dt1][Class:
javax.faces.component.UIColumn,Id: _idJsp49][Class:
javax.faces.component.html.HtmlPanelGroup,Id: _idJsp51][Class:
javax.faces.component.html.HtmlCommandLink,Id: _idJsp52]}. If you need to
render a special form and a JSF-form's attributes are not enough,consider
using the s:form tag of the MyFaces sandbox.
How do I figure out what MyFaces is referring to? I've included the stack
trace below, but I can't determine what line of my JSF it's referring to ...
Stack trace
=========
javax.faces.FacesException: Exception while calling encodeEnd on :
{Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId:
/jsp/search_results.jsp][Class: javax.faces.component.html.HtmlDataTable,Id:
dt1][Class: javax.faces.component.UIColumn,Id: _idJsp49][Class:
javax.faces.component.html.HtmlPanelGroup,Id: _idJsp51]}
The problem page is "/jsp/search_results.jsp" as shown in the error message.
In that page you appear to have a table (with id "dt1") that contains a
commandLink component. All command* components trigger a submit of its
enclosing form - but there *is* no enclosing form. The message above
tells you that you have this hierarchy of components leading to the
problem component:
UIViewRoot
-> HtmlDataTable
-> UIColumn
-> HtmlPanelGroup
-> HtmlCommandLink
and there is no form there in that list of ancestors of the commandlink.
There isn't a line-number; you just have to look at your page. If your
page is so big that you cannot find the problem easily then you need to
refactor! And if you add more ids to your components then the error
messages are even more helpful (they do show the ids of the relevant
components).
The message seems to be saying that the tomahawk command components (eg
t:commandLink) don't need an enclosing form. That certainly *used to be
true* (they would automatically insert a <form> tag into the page
themselves) but I'm not sure that still works. Anyway, putting an h:form
in the page is better style.
Regards,
Simon