parameter_template.html 4.3 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
<html xmlns:xf="http://www.w3.org/2002/xforms">
   <head>
	<!-- do not include a <meta> tag -->
      <link rel="stylesheet" type="text/css" href="/pentaho-portal-layout/pentaho.css"></link>
      <title>Parameter Page Customization Example</title>
            			
						<script src="js/parameters.js" type="text/javascript"></script>
						
      			<script><![CDATA[
      			  var url=unescape('ViewAction?');
      			  var target=unescape('');
      			  function doForm() {
      			    var submitUrl = url;
      			    var form = document.forms['parameter-form'];
      			    var elements = form.elements;
      			    var i;
      			    for( i=0; i<elements.length; i++ ) {
      			      if( elements[i].type == 'select-one' || elements[i].type == 'text' || elements[i].type == 'hidden') {
      			        submitUrl += '&' + elements[ i ].name + '=' + escape( elements[ i ].value );
      			      } else if( elements[i].type == 'radio' ) {
      			      	if( elements[i].checked ) {
      			          submitUrl += '&' + elements[ i ].name + '=' + escape( elements[ i ].value );
      			      	}
      			      } else if( elements[i].type == 'checkbox' ) {
      			      	if( elements[i].checked ) {
      				      submitUrl += '&' + elements[i].name + "=" + escape( elements[i].value );
      			      	}
      			      } else if( elements[i].type == 'select-multiple' ) {
      				    var options = elements[i].options;
      				    var j;
      				    for( j=0; j!=options.length; j++ ) {
      				      if( options[j].selected ) {
      	  			        submitUrl += '&' + elements[i].name + '=' + escape( options[ j ].value );
      				      }
      				    }
      				  }
      			    }
      			    if( target == '' ) {
      				    document.location.href=submitUrl;
      				} else {
      					window.open( submitUrl, target );
      				}
      			    return false;
      			  }
      			]]></script>
      		
	{xform-header}

   </head>
   <body style="border:2px solid #dddddd">
      <div style="margin:10px"><span class="portlet-section-header">Parameter Page Customization Example 2</span></div>
      <div style="margin:10px;border:1px solid #808080;padding:5px;">
         <form name="parameter-form" id="parameter-form" method="GET">
            <table width="100%" style="padding:5px;">
               <tr>
                  <td><span class="portlet-font">Use this form to supply the parameters required for this content. 
<p/>This parameter page was generated using at html template. You can find the template in pentaho-demo/samples/reporting/parameter_template.html
</span></td>
               </tr>
               <tr>
                  <td class="portlet-section-subheader">Select a DEPARTMENT<br/><span class="portlet-font">Try 'Finance' or maybe 'Sales' </span>
                  </td>
               </tr>
               <tr>
			<!-- this shows an example of using the form control that is built automatically -->
                  <td class="portlet-font">{DEPARTMENT}</td>
               </tr>
               <tr>
                  <td class="portlet-section-subheader"><br/>Select a REGION
                  </td>
               </tr>
               <tr>
			<!-- this shows an example of providing your own form control -->
                  <td class="portlet-font">
				<input id="REGION" class="portlet-form-field" type="radio" name="REGION" value="Central" title=""/>
				<span id="REGION-label" class="portlet-form-field-label">Central</span>
				<input id="REGION" class="portlet-form-field" type="radio" name="REGION" value="Eastern" title=""/>
				<span id="REGION-label" class="portlet-form-field-label">Eastern</span>
				<input id="REGION" class="portlet-form-field" type="radio" name="REGION" value="Western" title=""/>
				<span id="REGION-label" class="portlet-form-field-label">Western</span>
				<input id="REGION" class="portlet-form-field" type="radio" name="REGION" value="Southern" title=""/>
				<span id="REGION-label" class="portlet-form-field-label">Southern</span>
				<span id="REGION-required" class="required-symbol"></span></td>

               </tr>
               <tr>
                  <td><br/><input type="button" name="go" class="portlet-form-button" value="Run..." onClick="doForm()"/></td>
               </tr>
            </table>
		{solution}
		{action}
		{path}
	    </form>
      </div>
   </body>
</html>