JSF component is not rendered from my p:commandButton in in a dialog in included page
<p>My page contains a login header that i include via ui:include. The included page contains a dialog with a p:commandButton. When the user logs in, the include page is refreshed properly according to the @form in the update attribute. I also want to update a component outside the included page, that shall display a button when the user is logged in. The include page refreshes and the name of the logged in user is displayed. But the button in the main page is not shown. It is displayed if I refresh the page though. I can't figure out what I'm doing wrong here. Anyone have any ideas.</p>

<p>The header page also displays the commandLink component properly. But when clicking the logout link, the button in the main page is not removed. Since the commandLink does not use ajax, I assume that a normal page POST is done. Which should reload the whole page. Doesn't this work from a page that have been referenced with ui:include?</p>

<p>The login page is using a session scoped backing bean. The main page is view scoped.</p>

<p>Here's the included xhtml (login.xhtml):</p>

<pre><code>&lt;ui:composition
    xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui" 
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"&gt;
    &lt;div style="width:100%;font-size:12px;line-height:20px;background-color:#b0d9e6;color:white"&gt;

&lt;h:form&gt;
&lt;h:message id="top_msg"&gt;&lt;/h:message&gt;
    &lt;h:panelGrid width="100%" columns="3" columnClasses="none,right1,right1"&gt;
       &lt;h:outputLink rendered="#{!loginController.loggedIn}" styleClass="text-align:right;" value="javascript:void(0)" onclick="PF('dlg').show();" title="login"&gt;
             &lt;p:outputLabel&gt;Login&lt;/p:outputLabel&gt;
        &lt;/h:outputLink&gt;


    &lt;h:commandLink rendered="#{loginController.loggedIn}" action="#{loginController.logout}" styleClass="text-align:right;" &gt;
         &lt;h:outputLabel&gt;Logout&lt;/h:outputLabel&gt;
    &lt;/h:commandLink&gt;

    &lt;p:growl id="growl" sticky="true" showDetail="true" life="3000" /&gt;

    &lt;p:dialog header="Login" widgetVar="dlg" resizable="false"&gt;
        &lt;h:panelGrid columns="2" cellpadding="5"&gt;
            &lt;h:outputLabel for="username" value="Username:" /&gt;
            &lt;p:inputText id="username" value="#{loginController.username}" required="true" label="username" /&gt;

            &lt;h:outputLabel for="password" value="Password:" /&gt;
            &lt;p:password id="password" value="#{loginController.password}" required="true" label="password" /&gt;

            &lt;f:facet name="footer"&gt;
                &lt;p:commandButton value="Login" 
                        update="@form :createform:createbutton"
                        actionListener="#{loginController.login}"
                        oncomplete="handleLoginRequest(xhr, status, args)" &gt;

                &lt;/p:commandButton&gt;
            &lt;/f:facet&gt;  
        &lt;/h:panelGrid&gt;
    &lt;/p:dialog&gt;
    &lt;/h:panelGrid&gt;
&lt;script type="text/javascript"&gt;
    function handleLoginRequest(xhr, status, args)


&lt;/script&gt;

&lt;/h:form&gt;

&lt;/div&gt;

&lt;/ui:composition&gt;
...
</code></pre>

<p>This one is included in the following main page:</p>

<pre><code>...
&lt;ui:include src="login.xhtml" /&gt;

   &lt;h:form id="createform"&gt;
   &lt;h:panelGroup id="createbutton" layout="block"&gt;

     &lt;p:commandButton id="createnew"
        ajax="false" 
        action="#{recepieController.createNewRecipes}" 
        value="Create new recipe" 
        rendered="#{recepieController.loggedIn and !recepieController.create and !recepieController.viewOnly and !recepieController.edit}"
        accesskey="s"&gt;
      &lt;/p:commandButton&gt;
 &lt;/h:panelGroup&gt;     
  &lt;/h:form&gt;
</code></pre>