Adds pazpar2 listeners
[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" style="${cc.attrs.debug == 'true' ? '' : 'display:none;'}">\r
36       Active clients: <h:outputText id="activeclientsField" value="${pz2.update()}" />\r
37     </h:form>\r
38 \r
39     <h:form id="stateForm" prependId="false" rendered="${cc.attrs.trackHistory == 'true'}" style="${cc.attrs.debug == 'true' ? '' : 'display:none;'}">\r
40       State: \r
41       <h:inputText id="windowlocationhash" value="#{pz2.currentStateKey}" size="100">\r
42         <f:ajax event="change" render="#{cc.attrs.renderOnHistoryChange} #{pz2watch.activeclients}"/>\r
43       </h:inputText>\r
44     </h:form>\r
45   </cc:implementation>\r
46   \r
47 </body>\r
48 </h:html>