4 Replies Latest reply on Aug 26, 2009 7:16 AM by Mario Baracu

    Target component for id [ID] not found

    Mario Baracu Newbie

      Im using PanelMenuGroup for navigation, and create the component dinamically from backing bean.

      The action and rerender works OK, but i have this warning on my Apache console:

      13/08/2009 04:12:09 PM org.ajax4jsf.context.AjaxContextImpl convertId
      WARNING: Target component for id formBody not found
      


      I set rerender "formBody" from a backing Bean
      HtmlAjaxSupport ajaxSupport = new HtmlAjaxSupport();
       ajaxSupport.setAjaxSingle(true);
       ajaxSupport.setEvent("onclick");
       ajaxSupport.setReRender("formBody");
       ajaxSupport.setImmediate(true);
       ajaxSupport.setId("ajsId");
       methodExpression = app.getExpressionFactory().createMethodExpression(facesContext.getELContext(),"#{componentNavigator." + strAction + "}", null, new Class<?>[0]);
       onexpand.setActionExpression(methodExpression);
       panelMenuGroup.getFacets().put("a4jsupport", ajaxSupport);


      The form in my web body
      <a4j:form id="formBody">
      <!-- magic code -->
       </a4j:form>


      for one reason the code cant reach the "formBody" ID but in other level find it and work ok.

      English isnt my native language :)

        • 1. Re: Target component for id [ID] not found
          Nick Belaevski Master

          Hi,

          Can you please post how your page would look like (I mean page code) if it's written in JSP/Facelets?

          • 2. Re: Target component for id [ID] not found
            Mario Baracu Newbie

            Hi nbelaevski, that is what you need ?

            
            <html 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"
             xmlns:a4j="http://richfaces.org/a4j"
             xmlns:rich="http://richfaces.org/rich">
            <head>
             <meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8"/>
             <title>Foo</title>
             <link rel="STYLESHEET" type="text/css" href="${facesContext.externalContext.requestContextPath}/css/common.css"/>
             <script type="text/javascript" src="/foo/foo.js"/>
            </head>
            
            


            libs:
            myfaces-core-1.2.3
            jstl-1.2
            facelets-1.1.14
            JSF 1.1/1.2 Support
            Richfaces 3.2.2-GA / 3.3.1-GA (with the same results)
            Tomahawk-Facelets-taglib
            Toplink essentials

            Thx

            • 3. Re: Target component for id [ID] not found
              Nick Belaevski Master

              Hi,

              No, I was asking about the structure of the page expressed in XHTML code. Your code snippet does not give information on what is "formBody" so it's not known why it is not found.

              • 4. Re: Target component for id [ID] not found
                Mario Baracu Newbie

                 

                
                <html 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"
                 xmlns:a4j="http://richfaces.org/a4j"
                 xmlns:rich="http://richfaces.org/rich">
                
                <head>
                 <meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8"/>
                 <title>TEST</title>
                 <link rel="STYLESHEET" type="text/css" href="${facesContext.externalContext.requestContextPath}/css/common.css"/>
                 <script type="text/javascript" src="/Test/test.js"/>
                </head>
                
                <body onload="update('formHeader')">
                
                 <f:view locale="#{Login.locale}"/>
                
                 <a4j:region id="bodyStatus">
                
                 <a4j:form id="formHeader">
                 <ui:include src="/header/header.xhtml"/>
                 </a4j:form>
                
                 <a4j:form id="formBody">
                 <div id="menuBg">
                 <h:graphicImage value="/images/menu_image.png" rendered="${Login.loggedIn}"/>
                 </div>
                 <table class="left_menu" cellpadding="0" cellspacing="0" border="0">
                 <tbody>
                 <tr>
                 <td>
                 <ui:include src="/menu/components-navigation.xhtml"/>
                 </td>
                 </tr>
                 </tbody>
                 </table>
                 <table cellpadding="0" cellspacing="0" class="content_container" >
                 <tbody>
                 <tr>
                 <td>
                 <div class="content_container_left_brick"/>
                 </td>
                 <td class="content_container_middle_brick" >
                 <table cellpadding="0" cellspacing="0" class="content_container_table">
                 <tbody>
                 <tr>
                 <td>
                 <ui:include src="#{componentNavigator.currentComponent.location}"/>
                 </td>
                 </tr>
                 </tbody>
                 </table>
                 </td>
                 <td>
                 <div class="content_container_right_brick"/>
                 </td>
                 </tr>
                 </tbody>
                 </table>
                 </a4j:form>
                
                 </a4j:region>
                </body>
                
                </html>
                
                


                sorry for the delay.

                I appreciate your help !!!