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
  • 745
  • 6
  • 18
  • 40

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,040,783
  • 362
  • 3,548
  • 3,513