avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l...@apache.org
Subject cvs commit: avalon-excalibur/instrument-manager/src/java/org/apache/excalibur/instrument/manager/http HTMLSampleHandler.java
Date Mon, 08 Sep 2003 10:01:48 GMT
leif        2003/09/08 03:01:48

  Modified:    instrument-manager/src/java/org/apache/excalibur/instrument/manager/http
                        HTMLSampleHandler.java
  Log:
  Modify the chart refresh code so that it will stop attempting to refresh if the
  server connection goes down.
  
  Revision  Changes    Path
  1.2       +6 -2      avalon-excalibur/instrument-manager/src/java/org/apache/excalibur/instrument/manager/http/HTMLSampleHandler.java
  
  Index: HTMLSampleHandler.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/instrument-manager/src/java/org/apache/excalibur/instrument/manager/http/HTMLSampleHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HTMLSampleHandler.java	8 Sep 2003 09:00:44 -0000	1.1
  +++ HTMLSampleHandler.java	8 Sep 2003 10:01:48 -0000	1.2
  @@ -219,13 +219,17 @@
               out.println( "  clearInterval(intervalId);" );
               out.println( "  intervalId = setInterval(\"refreshChart()\", refresh);" );
               out.println( "}" );
  +            out.println( "function chartError() {" );
  +            out.println( "  clearInterval(intervalId);" );
  +            out.println( "  document.location=\"instrument.html?name=" + urlEncode( desc.getInstrumentDescriptor().getName()
) + "\";" );
  +            out.println( "}" );
               // No auto refresh by default.
               //out.println( "setRefresh(5000);" );
               out.println( "</SCRIPT>" );
               
               out.println( "<form>" );
               startTable( out );
  -            tableCell( out, "<img name='chart' src='sample-chart.jpg?name=" + urlEncode(
desc.getName() ) + "' onError='javascript:document.location=\"instrument.html?name=" + urlEncode(
desc.getInstrumentDescriptor().getName() ) + "\"'>" );
  +            tableCell( out, "<img name='chart' src='sample-chart.jpg?name=" + urlEncode(
desc.getName() ) + "' onError='javascript:chartError()'>" );
               endTable( out );
               out.println( "Refresh rate:" );
               out.println( "<input type='button' value='No Refresh' onClick='javascript:clearInterval(intervalId)'>"
);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message