Jean-Francois Leveque

Amélioration formulaire et résultat

...@@ -18,7 +18,7 @@ import java.util.List; ...@@ -18,7 +18,7 @@ import java.util.List;
18 public class PublisherSearchView implements Serializable { 18 public class PublisherSearchView implements Serializable {
19 19
20 List<PublisherVersion> publisherVersions = new ArrayList<>(); 20 List<PublisherVersion> publisherVersions = new ArrayList<>();
21 - String searchString; 21 + String searchString = new String();
22 22
23 transient PublisherService publisherService; 23 transient PublisherService publisherService;
24 24
...@@ -36,6 +36,10 @@ public class PublisherSearchView implements Serializable { ...@@ -36,6 +36,10 @@ public class PublisherSearchView implements Serializable {
36 //no args constructor to make it proxyable 36 //no args constructor to make it proxyable
37 } 37 }
38 38
39 + public boolean searchEmpty() {
40 + return ((!searchString.isEmpty()) && publisherVersions.isEmpty());
41 + }
42 +
39 /** 43 /**
40 * 44 *
41 */ 45 */
......
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
15 <li> 15 <li>
16 <a jsf:outcome="/index">Menu principal</a> 16 <a jsf:outcome="/index">Menu principal</a>
17 </li> 17 </li>
18 + <li>
19 + <a jsf:outcome="/xyz/search">Recherche globale</a>
20 + </li>
18 <li>Éditeurs 21 <li>Éditeurs
19 <ul> 22 <ul>
20 <li> 23 <li>
...@@ -49,7 +52,7 @@ ...@@ -49,7 +52,7 @@
49 </h:panelGrid> 52 </h:panelGrid>
50 </form> 53 </form>
51 54
52 -<p jsf:rendered="#{publisherSearchView.publisherVersions.isEmpty() and !publisherSearchView.searchString.isEmpty()}">Aucun éditeur ne correspond à votre recherche : ${publisherSearchView.searchString}.</p> 55 +<p jsf:rendered="#{publisherSearchView.searchEmpty()}">Aucun éditeur ne correspond à votre recherche : ${publisherSearchView.searchString}.</p>
53 56
54 <h:dataTable rendered="#{!publisherSearchView.publisherVersions.isEmpty()}" value="#{publisherSearchView.publisherVersions}" var="version"> 57 <h:dataTable rendered="#{!publisherSearchView.publisherVersions.isEmpty()}" value="#{publisherSearchView.publisherVersions}" var="version">
55 <h:column> 58 <h:column>
......