Packaging pazpar2/io error messages in response objects
[mkjsf-moved-to-github.git] / src / META-INF / resources / pz2utils / pz2watch.xhtml
1 <?xml version="1.0" encoding="UTF-8" ?>\r
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
3 <h:html xmlns="http://www.w3.org/1999/xhtml"\r
4       xmlns:f="http://java.sun.com/jsf/core"\r
5       xmlns:h="http://java.sun.com/jsf/html"\r
6       xmlns:ui="http://java.sun.com/jsf/facelets"\r
7       xmlns:cc="http://java.sun.com/jsf/composite">\r
8 \r
9 <head>\r
10 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
11 </head>\r
12 <body>\r
13 \r
14   <cc:interface>\r
15     <cc:attribute name="renderWhileActiveclients"/>\r
16     <cc:attribute name="trackHistory"/>\r
17     <cc:attribute name="renderOnHitoryChange"/> \r
18     <cc:attribute name="debug"/>   \r
19   </cc:interface>\r
20 \r
21   <cc:implementation>\r
22     <h:outputScript name="jsf.js" library="javax.faces" target="head" />\r
23     <h:outputScript name="fieldlisteners.js" library="pz2utils" target="head" />\r
24     \r
25     <!-- Initiate Ajax update listeners -->  \r
26     <script>\r
27      //<![CDATA[\r
28        var renderWhileActiveclients = "${cc.attrs.renderWhileActiveclients}";\r
29        var renderOnHistoryChange = "${cc.attrs.renderOnHistoryChange}";\r
30        var trackHistory = ("${cc.attrs.trackHistory}" == "true");  \r
31        setUpListeners();\r
32      //]]>\r
33     </script>  \r
34 \r
35     <h:form id="activeclientsForm" prependId="false">\r
36       <h:outputText id="activeClientsLabel" value="Active clients: " style="${cc.attrs.debug == 'true' ? '' : 'display:none;'}"/> \r
37       <h:outputText id="activeclientsField" value="${pz2.update()}"  style="${cc.attrs.debug == 'true' ? '' : 'display:none;'}"/>\r
38       <h:panelGrid id="errorMessages" style="${pz2.hasErrors() ? 'color: red;' : 'display: none;'}">\r
39         <p><h:outputText id="messages" value="Error: #{pz2.firstErrorMessage}"/></p>\r
40       </h:panelGrid>                      \r
41     </h:form>\r
42 \r
43     <h:form id="stateForm" prependId="false" rendered="${cc.attrs.trackHistory == 'true'}" style="${cc.attrs.debug == 'true' ? '' : 'display:none;'}">\r
44       State: \r
45       <h:inputText id="windowlocationhash" value="#{pz2.currentStateKey}" size="100">\r
46         <f:ajax event="change" render="#{cc.attrs.renderOnHistoryChange} #{pz2watch.activeclients}"/>\r
47       </h:inputText>\r
48     </h:form>\r
49   </cc:implementation>\r
50   \r
51 </body>\r
52 </h:html>