I want to use mutliple view's in a componente. The MulitViewDeme shows selecting views by using p:commandButton action="... Is there a posibillity to select a view via attribut or a methode ?

asked 18.12.2014 at 12:50

rschreiter's gravatar image

rschreiter
16337
accept rate: 0%

In the Demo the method "nextView" is called. The return value is the name of the next view. It doesn't matter how you call this method.

(18.12.2014 at 15:21) HaraldWeber HaraldWeber's gravatar image

My Problem is that i don't want use a CommanButton to Change the View - I want select the View on the start of the component or by using JAVA in am Methode.

(18.12.2014 at 15:30) rschreiter rschreiter's gravatar image

You can try to use the method redirect of the ExternalContext interface. E.g.

FacesContext ctx = FacesContext.getCurrentInstance();

ExternalContext extContext = ctx.getExternalContext();
String url = extContext.encodeActionURL(ctx.getApplication().getViewHandler().getActionURL(ctx, "myView.xhtml"));

extContext.redirect(url);

Hope this solves your problem.

link

answered 06.01.2015 at 16:27

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
4.9k172655
accept rate: 74%

Thank You very mutch.

(16.01.2015 at 16:26) rschreiter rschreiter's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×75

Asked: 18.12.2014 at 12:50

Seen: 1,241 times

Last updated: 16.01.2015 at 16:27