1

I have an application which has primefaces Commandbuttons. They use ajax to update form. What I want to do is, when user clicks some button say (button1) the address bar will change to http://localhost:8080/myApp/button1. I give button1 as an example it can be some custom text.Is there any solution?

Turgut Dsfadfa
  • 775
  • 6
  • 20
  • 42

1 Answers1

3

Use normal links or buttons instead of command links or buttons.

E.g.

<p:button value="Go to button1 page" outcome="button1" />

It'll open button1.xhtml and point to /myApp/button1.xhtml. To get rid of the file extension, consider PrettyFaces or FacesViews.

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555