NextApp Echo
App Container 1.1.4

nextapp.echoservlet.ui
Class ImageSwapScript

java.lang.Object
  extended bynextapp.echoservlet.ui.ImageSwapScript

public class ImageSwapScript
extends java.lang.Object

A utility class that wraps JavaScript code required to swap images in HTML pages on the client without server interaction.


Field Summary
static Service SERVICE_IMAGE_SWAP_SCRIPT
          A service containing JavaScript code used to swap images on the client.
 
Method Summary
static java.lang.String getScriptImageSwap(Connection conn, Id id, java.lang.String newImageUri)
          Returns the JavaScript necessary to dynamically change an image that exists in the client browser to the one specified in newImageUri.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE_IMAGE_SWAP_SCRIPT

public static final Service SERVICE_IMAGE_SWAP_SCRIPT
A service containing JavaScript code used to swap images on the client.

Method Detail

getScriptImageSwap

public static java.lang.String getScriptImageSwap(Connection conn,
                                                  Id id,
                                                  java.lang.String newImageUri)
Returns the JavaScript necessary to dynamically change an image that exists in the client browser to the one specified in newImageUri. This method is used by buttons to generate rollover effects and by checkboxes and radio buttons to toggle their state indicators without server interaction.

This method makes use of a method of java.net.URLEncoder that has been deprecated as of JDK 1.4. There is no comparable non-deprecated method that provides this functionality that is available with JDK 1.3.

Parameters:
conn - The connection whose response the generated script will be written to.
id - The identifier of the image to be modified.
newImageUri - The URI of the replacement image.
Returns:
A JavaScript method call that should be invoked when the image is to be swapped.

NextApp Echo
App Container 1.1.4