Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JSF
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
TDD for a Shopping Website LiveProject
this week in the
Testing
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Paul Clapham
Ron McLeod
Jeanne Boyarsky
Tim Cooke
Sheriffs:
Liutauras Vilda
paul wheaton
Henry Wong
Saloon Keepers:
Tim Moores
Tim Holloway
Stephan van Hulst
Carey Brown
Frits Walraven
Bartenders:
Piet Souris
Himai Minh
Forum:
JSF
redirection from backbean
Dura Hurtado
Ranch Hand
Posts: 120
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi I am trying to redirect to a .xhtml form a back bean but nothing happens.
This is the code:
public void save(ActionEvent actionEvent) { addMessage("multimedia"); FacesContext facesContext = FacesContext.getCurrentInstance(); String redirect = "multimedia"; NavigationHandler myNav = facesContext.getApplication().getNavigationHandler(); myNav.handleNavigation(facesContext, null, redirect); }
and the primefaces component is:
<h:form> <p:growl id="messages"/> <p:menuButton value="Options"> <p:menuitem value="Save" update="messages" actionListener="#{buttonBean.save}" icon="ui-icon ui-icon-disk" /> <p:menuitem value="Update" update="messages" actionListener="#{buttonBean.update}" icon="ui-icon ui-icon-arrowrefresh-1-w"/> <p:menuitem value="Delete" icon="ui-icon ui-icon-close" actionListener="#{buttonBean.delete}" ajax="false"/> <p:menuitem value="Homepage" action="multimedia" icon="ui-icon ui-icon-extlink"/> </p:menuButton> </h:form>
¿Any idea?
Thanks for reply.
Ilya Kudelin
Greenhorn
Posts: 7
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Try this:
package com.foo; public class BackBean{ public String save(){ return "save"; } } <f:view> <h:form> <h:commandButton value="ClickMe!" action="#{backBean.save}"> </h:form> </f:view> <faces-config> <navigation-rule> <from-view-id>/first.jsp<from-view-id> //important: not jsf, real file name: xhml,jsp,etc <navigation-case> <from-outcome>save</from-outcome> // value from bean's method <to-view-id>/path/to/next/page.xhtml</to-view-id> </navigation-case> </navigation-rule> <managed-bean> <managed-bean-name>backBean</managed-bean> <managed-bean-class>com.foo.BackBean</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> </faces-config>
http://download.oracle.com/javaee/1.4/tutorial/doc/JSFConfigure7.html
If I'd had more time, I would have written a shorter letter. -T.S. Eliot such a short, tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Trying to change <ui:include> src tag dinamically
PrimeFaces dynamic cotextmenu and actions
Updating a form in primefaces when a selection is made in the datatable
Getting form value out of the FacesContext
SelectListener for DataTable populated with ActionListener - infact if the initial size = 0
More...