mercredi 2 septembre 2015

Refresh include with menu item not work

I when I click on Login it does not refresh the include does anyone know what is the problem ?

I've tried other ways but continues to give error Code

Index.xhtml

<h:head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Meu Sistema</title>
</h:head>
<h:body>
    <div align="center">
        <p:layout style="min-width:1020px;max-width:1020px;min-height:600px">
            <p:layoutUnit position="center">
                <h:panelGroup id="include">
                    <ui:include src="#{Controlomenu.pagina}" />
                </h:panelGroup>
            </p:layoutUnit>
        </p:layout>
    </div>
<p:dock position="bottom">
    <p:menuitem value="Login" icon="imagens/lock.png" url="#" actionListener="#{Controlomenu.Paginalogin}" update=":include" />
    <p:menuitem value="Registar" icon="imagens/register.png" url="#" actionListener="#{Controlomenu.Paginaregistar}" update=":include"/>
</p:dock>
</h:body>
</html>

Controlomenu.java

@ManagedBean(name = "Controlomenu")
@SessionScoped
public class Controlomenu {
    @Autowired
    private String pagina;

public Controlomenu(){
    this.pagina= "hello.xhtml";
}
    public String getPagina() {
        return pagina;
    }

    public void setPagina(String pagina) {
        this.pagina = pagina;
    }
    public void Paginalogin() {
        setPagina("login.xhtml");   
    }
    public void Paginaregistar() {
        setPagina("registar.xhtml");    
    }

}

Thanks




Aucun commentaire:

Enregistrer un commentaire