1 Reply Latest reply on Mar 16, 2006 1:28 AM by Gavin King

    "component j_id0 must be enclosed inside a form" running wit

    Xiang Qinxian Newbie

      hi,


      when goto main page after login seam-booking examples, running with jsf 1.2 ri:
      you can get some warn messages like this:
      "component j_id0 must be enclosed inside a form"

      and you can't see logout and setting at top of page.


      so check view code from main.xhtml:

      ...
      <ui:composition
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
       template="template.xhtml">
      ...
      


      check template.xhtml, and that maybe can be modified like follows:
      ...
      <div id="document">
       <div id="header">
       <div id="title"><img src="img/hdr.title.gif" /></div>
       <h:form><!---add h:form here-->
       <div id="status">
       Welcome #{user.name}
       | <h:commandLink action="password">Settings</h:commandLink>
       | <h:commandLink action="#{logout.logout}">Logout</h:commandLink>
       </div>
       </h:form><!---add h:form end tag here-->
       </div>
      ....
      


      Regards,

      xiangya