4 Replies Latest reply on Sep 12, 2007 6:35 PM by Oliver

    Problem with reRender and PanelMenuItem

    Oliver Newbie

      Hello,

      I use the RC5 and MyFaces 1.1.5. The view is assembled directly by Java Code:

      HtmlPanelMenuItem menuItem = new HtmlPanelMenuItem();
      menuItem.setMode("ajax");
      menuItem.getAttributes().put("reRender", "form:panel");
      menuItem.setLabel("Auftrag");
      menuItem.setAction(createMethodBinding());
      menu.getChildren().add(menuItem);
      


      My page contains a PanelMenu and as direct childs PanelMenuItems, the mode is "ajax". The request is sent to the server, but the reRender does not work.

      Is there a problem with the RC5 or with my approach ?

      Thanks for your help.

      regards,
      Oliver


        • 1. Re: Problem with reRender and PanelMenuItem
          Ilya Shaikovsky Master

          Any errors from a4j:log?

          • 2. Re: Problem with reRender and PanelMenuItem
            Oliver Newbie

            A warning "No information in response about elements to replace" :

            debug[10:44:35,250]: Header Ajax-Expired not found, search in <meta>
            debug[10:44:35,250]: search for elements by name 'meta' in element #document
            debug[10:44:35,250]: getElementsByTagName found 3
            debug[10:44:35,250]: Find <meta name='null' content='text/html;charset=UTF-8'>
            debug[10:44:35,250]: Find <meta name='Ajax-Update-Ids' content=''>
            debug[10:44:35,250]: Find <meta name='Ajax-Response' content='true'>
            debug[10:44:35,250]: Header Ajax-Update-Ids not found, search in <meta>
            debug[10:44:35,250]: search for elements by name 'meta' in element #document
            debug[10:44:35,265]: getElementsByTagName found 3
            debug[10:44:35,265]: Find <meta name='null' content='text/html;charset=UTF-8'>
            debug[10:44:35,265]: Find <meta name='Ajax-Update-Ids' content=''>
            warn[10:44:35,265]: No information in response about elements to replace
            debug[10:44:35,265]: call getElementById for id= ajax-view-state
            debug[10:44:35,265]: Hidden JSF state fields: [object HTMLSpanElement]
            debug[10:44:35,265]: Namespace for hidden view-state input fields is undefined
            debug[10:44:35,265]: search for elements by name 'input' in element span
            debug[10:44:35,265]: getElementsByTagName found 1
            debug[10:44:35,265]: Replace value for inputs: 48 by new values: 1
            debug[10:44:35,265]: Input in response: javax.faces.ViewState
            debug[10:44:35,265]: Found same input on page with type: hidden
            debug[10:44:35,265]: Found same input on page with type: hidden
            debug[10:44:35,265]: Found same input on page with type: hidden
            debug[10:44:35,265]: search for elements by name 'INPUT' in element span
            debug[10:44:35,281]: getElementsByTagName found 0
            debug[10:44:35,281]: Replace value for inputs: 48 by new values: 0
            debug[10:44:35,281]: call getElementById for id= _ajax:data
            debug[10:44:35,281]: call getElementById for id= _A4J.AJAX.focus
            debug[10:44:35,281]: No focus information in response
            debug[10:44:35,281]: call getElementById for id= org.ajax4jsf.oncomplete
            


            I tried the whole thing in the meantime, with commandbuttons as childs of the menuitems (menuitem::mode="none"). Same reRender-Id. This works.

            • 3. Re: Problem with reRender and PanelMenuItem
              Alexander Smirnov Master

              You don't set id attribute for a menu component. For a null id values, JSF generate different results on every call to the getClientId method. try to change your code :

              HtmlPanelMenuItem menuItem = new HtmlPanelMenuItem();
              menuItem.setId("myItem");
              menuItem.setMode("ajax");
              ....
              


              • 4. Re: Problem with reRender and PanelMenuItem
                Oliver Newbie

                Done. id is now set to menuitem and menu, but still the same problem.

                As I mentioned earlier, a commandbutton as child of the menuitem works. So it seems nothing wrong with the reRenderId itself.