Moves request logic from pz2bean to individual commands
[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="renderWhileActiveclientsRecord"/>\r
17     <cc:attribute name="trackHistory"/>\r
18     <cc:attribute name="renderOnHitoryChange"/> \r
19     <cc:attribute name="debug"/>   \r
20   </cc:interface>\r
21 \r
22   <cc:implementation>\r
23     <h:outputScript name="jsf.js" library="javax.faces" target="head" />\r
24     <h:outputScript name="listeners.js" library="pz2utils" target="head" />\r
25     \r
26     <!-- Initiate Ajax listeners -->  \r
27     <script>\r
28      //<![CDATA[\r
29        var renderWhileActiveclients = "${cc.attrs.renderWhileActiveclients}";\r
30        var renderWhileActiveclientsRecord = "${cc.attrs.renderWhileActiveclientsRecord}";\r
31        var renderOnHistoryChange = "${cc.attrs.renderOnHistoryChange}";\r
32        var trackHistory = ("${cc.attrs.trackHistory}" == "true");  \r
33        setUpListeners();\r
34      //]]>\r
35     </script>  \r
36 \r
37     <h:form id="activeclientsForm" prependId="false">\r
38       <h:outputText id="activeClientsLabel" value="Active clients: show: " style="${cc.attrs.debug == 'true' ? '' : 'display:none;'}"/> \r
39       <h:outputText id="activeclientsField" value="${pz2.update()}"  style="${cc.attrs.debug == 'true' ? '' : 'display:none;'}"/>\r
40       <h:outputText id="space" value=" - record: " style="${cc.attrs.debug == 'true' ? '' : 'display:none;'}"/>\r
41       <h:outputText id="activeclientsFieldRecord" value="${pzreq.record.run().getActiveClients()}" style="${cc.attrs.debug == 'true' ? '' : 'display:none;'}"/>      \r
42     </h:form>\r
43 \r
44     <h:form id="stateForm" prependId="false" rendered="${cc.attrs.trackHistory == 'true'}" style="${cc.attrs.debug == 'true' ? '' : 'display:none;'}">\r
45       State: \r
46       <h:inputText id="windowlocationhash" value="#{pz2.currentStateKey}" size="100">\r
47         <f:ajax event="change" render="#{cc.attrs.renderOnHistoryChange} #{pz2.watchActiveclients}"/>\r
48       </h:inputText>\r
49     </h:form>\r
50   </cc:implementation>\r
51   \r
52 </body>\r
53 </h:html>