hi;
I have added the next code and faces-config.xml
in the index.xhtml:
Code: Select all
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui">
<h:head>
<p:resources />
<title>Probando barra menu basica con glassfish server</title>
</h:head>
<h:body>
<h:form>
<p:breadCrumb>
<p:menuitem value="" />
<p:menuitem value="Tarjeta madre" action="#{sapo.damelotodo}" />
<p:menuitem value="Procesadores" action="case2" />
<p:menuitem value="Discos duros" action="case3"/>
<p:menuitem value="Tarjetas de video" action="case3"/>
</p:breadCrumb>
</h:form>
</h:body>
</html>
then on sapo class:
Code: Select all
import javax.enterprise.context.RequestScoped;
import javax.faces.*;
import javax.faces.bean.ManagedBean;
@ManagedBean (name="sapo")
@RequestScoped
public class sapo {
private String none;
public String getNone() {
return none;
}
public void setNone(String none) {
this.none = none;
}
public sapo() {
}
public String damelotodo(){
return "case1";
}
}
now using the faces-config.xml to now make a navigation rule without use "action="case1"
Code: Select all
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
<navigation-rule>
<from-view-id>/index.xhtml</from-view-id>
<navigation-case>
<from-outcome>case1</from-outcome>
<to-view-id>/Tarjtas_de_video.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>case2</from-outcome>
<to-view-id>/Discos_duros.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>case3</from-outcome>
<to-view-id>/Tarjtasmadre.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
On this I was using the facesconfig.xml and just the action on taps to link and anyof them works, could you give some advice ??
Miguel V.
thanks in advance