[
https://issues.apache.org/jira/browse/DELTASPIKE-511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13879812#comment-13879812
]
Paa Kojo Konduah Amos commented on DELTASPIKE-511:
--------------------------------------------------
Hi Karl, here we go. I hope this works for you.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:head></h:head>
<h:body>
<h:form>
<p:commandButton value="move"
action="#{mPageController.toNextPage}"></p:commandButton>
</h:form>
</h:body>
</html>
#============================ Controller
==============================================
/**
*
*/
package com.applied.business.solutions.controller;
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;
import org.apache.deltaspike.core.api.config.view.ViewConfig;
import com.applied.business.solutions.navigation.MyPage;
import java.io.Serializable;
/**
* @author pkkamos
*
*/
@Named("mPageController")
@SessionScoped
public class MyPageController implements Serializable {
/**
*
*/
private static final long serialVersionUID = -4995867229948019234L;
/**
*
*/
public MyPageController() {
// TODO Auto-generated constructor stub
}
public Class<? extends ViewConfig> toNextPage() {
return MyPage.class;
}
}
#=========================== NAVIGATION CLASS =====================
/**
*
*/
package com.applied.business.solutions.navigation;
import org.apache.deltaspike.core.api.config.view.ViewConfig;
/**
* @author pkkamos
*
*/
public class MyPage implements ViewConfig {
}
> Navigation seems not to work
> ----------------------------
>
> Key: DELTASPIKE-511
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-511
> Project: DeltaSpike
> Issue Type: Bug
> Components: BeanValidation-Module, JSF-Module
> Affects Versions: 0.5, 0.6
> Environment: Ubuntu , Java 7, Eclipse Kepler, Widfly,
> Reporter: Paa Kojo Konduah Amos
>
> From the online documenation on the JSF Module page,
> public class MyPage implements ViewConfig{} and
> public Class<? extends ViewConfig? toNextPage(){
>
> return MyPage.class;
> }
> My understanding is, if i clicked on a button for example whose
> action/actionListener points to MyPage's toNextPage() method, the
> navigation never happens.
> However, when i inject ViewNavigationHandler and do the
> .naviagteTo(MyPage.class), that works perfectly.
> Please why is this the case?
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)