iamthechad
2/17/2017 - 8:51 PM

pdf_jsf.html

<ui:define name="body"> 
  <script type="text/javascript"> 
  //<![CDATA[  
  function showReport(conversationId) {  
    if (document.getElementById("messages") != null) {  
      return;  
    }
    var reportWin = window.open('#{reportAction.reportURL}' + '?cid=' + conversationId);  
    if (!reportWin) {  
      alert("Could not open the report window. Please disable popup blocking for this website and try again.");  
    }  
  }  
  // ]]> 
  </script> 
  <h:form id="generateReport"> 
    <s:validateAll> 
      <h:panelGrid width="100%" columns="1" style="text-align: center; font-weight:bold; font-size: 12px"> 
        <h:outputText value="Report Query"/> 
      </h:panelGrid> 
      <h:panelGrid columns="2" border="0" frame="none" style="padding-top:30px;"> 
        <h:outputLabel for="selectOneValue">Number of Output Rows</h:outputLabel> 
        <h:selectOneMenu id="selectOneValue" value="#{reportAction.selectOneValue}" required="true"> 
          <f:selectItem itemLabel="Zero" itemValue="0"/> 
          <f:selectItem itemLabel="One" itemValue="1"/>
          <f:selectItem itemLabel="Two" itemValue="2"/>
          <f:selectItem itemLabel="Three" itemValue="3"/>
          <f:selectItem itemLabel="Four" itemValue="4"/>
        </h:selectOneMenu> 
        <h:outputLabel for="startDate">Report Period:</h:outputLabel> 
        <h:panelGroup> 
          <rich:calendar id="startDate" enableManualInput="true" value="#{reportAction.startDate}" showWeeksBar="false" datePattern="MM/dd/yyyy" immediate="true" required="true" label="Report Start Date"/> 
          <h:outputLabel for="endDate">through</h:outputLabel>
          <rich:calendar id="endDate" enableManualInput="true" value="#{reportAction.endDate}" showWeeksBar="false" datePattern="MM/dd/yyyy" immediate="true" required="true" label="Report End Date"/>
        </h:panelGroup> 
      <a4j:commandButton id="getReportLink" action="#{reportAction.doSearch}" value="Get Report" oncomplete="showReport('#{conversation.id}')"/> 
     </h:panelGrid> 
    </s:validateAll> 
  </h:form> 
</ui:define>