Jean-Francois Leveque

Amélioration formulaire et résultat

......@@ -18,7 +18,7 @@ import java.util.List;
public class PublisherSearchView implements Serializable {
List<PublisherVersion> publisherVersions = new ArrayList<>();
String searchString;
String searchString = new String();
transient PublisherService publisherService;
......@@ -36,6 +36,10 @@ public class PublisherSearchView implements Serializable {
//no args constructor to make it proxyable
}
public boolean searchEmpty() {
return ((!searchString.isEmpty()) && publisherVersions.isEmpty());
}
/**
*
*/
......
......@@ -15,6 +15,9 @@
<li>
<a jsf:outcome="/index">Menu principal</a>
</li>
<li>
<a jsf:outcome="/xyz/search">Recherche globale</a>
</li>
<li>Éditeurs
<ul>
<li>
......@@ -49,7 +52,7 @@
</h:panelGrid>
</form>
<p jsf:rendered="#{publisherSearchView.publisherVersions.isEmpty() and !publisherSearchView.searchString.isEmpty()}">Aucun éditeur ne correspond à votre recherche : ${publisherSearchView.searchString}.</p>
<p jsf:rendered="#{publisherSearchView.searchEmpty()}">Aucun éditeur ne correspond à votre recherche : ${publisherSearchView.searchString}.</p>
<h:dataTable rendered="#{!publisherSearchView.publisherVersions.isEmpty()}" value="#{publisherSearchView.publisherVersions}" var="version">
<h:column>
......