Calling xhtml page by commandButton

Asked

Viewed 3,999 times

0

I am implementing the Toolbar component of the first faces and within this component there are several commandButtons that I need when clicking it to call another xhtml page of my project. How do you? ex:

<p:commandButton type="button" value="Cadastro de Cliente"
                icon="ui-icon-plus"  action="CadastroClientePrime.xhtml" />
  • try using Outcome instead of action

  • That way it didn’t work?

  • The @Diegoaugusto comment is also valid.

1 answer

2


There are some navigation modes such as dynamic, static and redirected.

for statistical navigation see a simple example:

<p:commandButton value="Sobre" action="sobre" />

remembering that for my page I named "about.xhtml".

Now, see an example of dynamic navigation, so you need a method

 <p:commandButton value="Sobre" action="#{ControlePrincipal.sobre()}" />

Method:

  public String sobre()
  {
    return "sobre";
  }

Browser other questions tagged

You are not signed in. Login or sign up in order to post.