Problème composant primefaces <p:commandButton>
Bonjour,
Je ne comprend pas pourquoi l'action de mon bouton Primefaces "rechercherButtonAction" ne marche pas.
Pourtant, il est bien dans une balise <form>
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
<?xml version="1.0" encoding="UTF-8"?>
<!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:c="http://java.sun.com/jsp/jstl/core"
xmlns:p="http://primefaces.org/ui" xmlns:cof="http://java.sun.com/jsf/composite/templateCof">
<h:head></h:head>
<h:body>
<h:outputStylesheet name="css/default.css" />
<div class="banniere" align="center">
<img src="../images/header.jpg" />
</div>
<div class="content">
<h:form>
<p:toolbar>
<p:toolbarGroup class="id_toolBarGroup">
<p:button style="font-size: 9px" outcome="ongletParametrage"
value="#{msg['setting.title']}" icon="ui-icon ui-icon-bullet">
<f:param name="productId" value="10" />
</p:button>
<span class="ui-separator"> <span class="ui-icon ui-icon-grip-dotted-vertical" />
</span>
<p:button style="font-size: 9px" outcome="ongletPE" value="#{msg['entryPoint.title']}"
icon="ui-icon ui-icon-bullet" />
<span class="ui-separator"> <span class="ui-icon ui-icon-grip-dotted-vertical" />
</span>
<p:button style="font-size: 9px" outcome="ongletProfilPE"
value="#{msg['entryPointProfile.title']}" icon="ui-icon ui-icon-bullet" />
</p:toolbarGroup>
</p:toolbar>
</h:form>
<p:outputPanel>
<h5>
<h:outputText value="#{msg['entryPoint.title']}" />
</h5>
</p:outputPanel>
<!-- bloc critere de recherche -->
<h:form id="formRecherche">
<h:panelGroup>
<p:panelGrid style="width: 100%" overflow-x="hidden">
<f:facet name="header">
<p:row>
<p:column colspan="2"><h:outputText value="#{msg['entryPoint.searchBlockPE.title']}" />
</p:column>
</p:row>
</f:facet>
<p:row>
<p:column class="w_label">
<p:outputLabel for="pointEntree" value="#{msg['entryPoint.label']} :" />
</p:column>
<p:column class="w_input">
<p:inputText id="pointEntree" value="#{gestionPE.pointEntree}" />
</p:column>
</p:row>
<p:row>
<p:column class="w_label">
<p:outputLabel for="numeroExterne" value="#{msg['entryPoint.numeroExt']} :" />
</p:column>
<p:column class="w_input">
<p:inputText id="numeroExterne" value="#{gestionPE.numeroExt}" />
</p:column>
</p:row>
<p:row>
<p:column class="w_label">
<p:outputLabel for="profilPointEntree" value="#{msg['entryPoint.profilPE']} :" />
</p:column>
<p:column class="w_selectOneMenu">
<p:selectOneMenu converter="#{gestionPE.profilPEConverter}"
id="profilPointEntree" value="#{gestionPE.profilPE}">
<f:selectItem itemLabel="Select One" itemValue="-1" />
<f:selectItems value="#{gestionPE.listeProfilPE}" var="profil"
itemLabel="#{profil.nomProfil}" itemValue="#{profil}" />
</p:selectOneMenu>
</p:column>
</p:row>
<p:row>
<p:column colspan="2">
<p:commandButton value="#{msg['button.PE.research']}" id="_rechercher"
actionListener="#{gestionPE.rechercherButtonAction}" icon="ui-icon-search" />
</p:column>
</p:row>
</p:panelGrid>
</h:panelGroup>
</h:form>
</div>
</h:body>
</html> |
Pourtant j'arrive bien a affichierla liste "listeProfilPE" avec le bean gestionPE
Voici ma config Spring :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd"
default-autowire="byName">
<bean name="pointEntreeManager" class="com.cofinoga.metier.services.impl.PointEntreeManagerImpl" scope="session"></bean>
<bean id="gestionPE" class="com.cofinoga.ihmParametrage.gestionIhm.GestionPointEntree" scope="session">
<property name="pointEntreeManager" ref="pointEntreeManager"></property>
</bean>
</beans> |
Voici une partie de mon bean java GestionPointEntree.java:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
package com.cofinoga.ihmParametrage.gestionIhm;
import java.util.ArrayList;
import java.util.List;
import javax.faces.component.UIComponent;
import javax.faces.event.ActionEvent;
import org.primefaces.component.datatable.DataTable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cofinoga.hibernateDB.database.entities.Profil;
import com.cofinoga.hibernateDB.database.entities_generated.PointEntree;
import com.cofinoga.hibernateDB.database.entities_generated.SegmentAppel;
import com.cofinoga.ihmParametrage.util.ProfilPEConverter;
import com.cofinoga.ihmParametrage.util.SegmentConverter;
import com.cofinoga.metier.services.PointEntreeManager;
public class GestionPointEntree {
private static final Logger LOGGER = LoggerFactory.getLogger(GestionPointEntree.class);
//Action bouton rechercher point d'entree
public void rechercherButtonAction(ActionEvent actionEvent)
{
System.out.println("test bouton action");
LOGGER.info("rechercherButtonAction !!!!! ");
pointEntreeManager.getPointEntreeById(1234);
if (profilPE != null)
{
//pointEntreeTools.rechercher(pointEntree, numeroExt);
LOGGER.info("Profil PE selectionne = " + getProfilPE().getIdSegment());
LOGGER.info("Test connection à la BD via hibernate = " );
setResultRendered(true);
}
} |