How to replace image on click

Hello all,
I have a report where I am having a edit column with a image:
<a href="javascript:jump('''
                  || emp".emp_id
|| ''','''
|| rownum
|| ''');"
|| onclick="movepic();">'
|| '<img name="edit1" src="#IMAGE_PREFIX#edit.gif" alt="">'
|| '</a>' edit,
jump() function opens an popup, but I am calling another function movepic() onclick of the image, where I am replacing the original image with another image, here is the function:
function movepic(){
var img_src = '#APP_IMAGES#edit_y.gif';
document.getElementById("edit1").src=img_src;
Popup is opening correctly but the image does not changes, and it is not showing any error also.
Please tell me where I am going wrong.
Thanks

I have changed the code
now I am passing the rownum as the parameter to the movepic function
that function is working actually but when I click on edit image it is not replacing with the another image, but after clicking it is not showing any thing in place of edit image.
movepic function is here:
function movepic(num){
var img_src = '#APP_IMAGES#edit_y.gif';
var img = "edit" + num;
document.getElementById(img).src=img_src;
I think the problem is with the img_src variable, in which I am assigning the image source.
Please check it, if it is correct.
thanks
Edited by: T999 on Jun 9, 2010 3:18 AM

Similar Messages

  • How to replace image?

    Hi people out there, me facing a problem on replacing the image.
    I have a array of images. When i double clicked any of the image, there will be a file chooser appeared. This allows the user to choose another picture to replace the current image. So how to replace that particular image?
    Please help. Thanks.
    * Nuts_gal *

    Actually this is how it works:
    1. First, the user will select a text file and a folder where all the images are store
    2. Then it will generate an array of images and the particulars that took from the text file.
    So the current image displayed is by array...

  • How to replace images in slideshow?

    I would like to replace images in slideshow, but I can see only ADD option.

    Thanks Parikshit.
    Looks the trick would be to turn on Thumbnails, delete the image and turn it off.

  • Using Pages for iPad, how to replace images

    Hi. 
    I'm new to Pages.  I have created a Pages document with text and photos.  I'd like to create more documents using the same basic format.  I'd like to be able to click on a photo and choose a new image without the image size changing in the document.   I thought I had tried this from a pages template on my friend's ipad but I can't figure it out now that I have my own ipad.   Any help appreciated. 

    These are merge fields.
    A double tap on them selects all and then you can type whatever you want in their place.
    Peter

  • How to replace images?

    Hi all..
    I have a vector of images and each individual images are display in JLabel. When double clicked any of the images, it able to change the image from the file chooser. I have a problem here: whenever i clicked one image so as to change the picture it only change the last index of the images and not the corresponding images. Why itz so? Anyone can help. Thanks.

    multipost:
    http://forum.java.sun.com/thread.jspa?threadID=581253&messageID=2950031

  • How can I determine which image was clicked in 3D carousel?

    I have been modifying some 3D carousel code that I found in hopes that I can get it such that when image "resolv2.jpg" (or any of my other images) is clicked on at the front of my carousel, it goes to a specific webpage. By just replacing "moveBack(event.target) from the toggler section of the code with "navigateToURL:(newURLRequest('http://google.com'), the target DOES sucessfully go to google when clicked on. However, I want to modify this code by altering the else statement to say something to the effect of "else if event.target (clicked on object) is 'resolv2.jpg' THEN go to google". So essentially, my question is how can I determine which image was clicked? Here is the entire code with the area I was altering bolded:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" applicationComplete="init();" backgroundGradientColors="[#000033, #000033]" backgroundGradientAlphas="[1.0, 1.0]">
    <mx:Script>
              <![CDATA[
    //Import Papervision Classes
                   import org.papervision3d.scenes.*;
                   import org.papervision3d.cameras.*; 
                   import org.papervision3d.objects.*;
                   import org.papervision3d.objects.primitives.*;
                   import org.papervision3d.materials.*;
                   import org.papervision3d.materials.shadematerials.*;
                   import org.papervision3d.materials.utils.MaterialsList;
                   import org.papervision3d.lights.*;
                   import org.papervision3d.render.*;
                   import org.papervision3d.view.*;
                   import org.papervision3d.events.*;
                   import org.papervision3d.core.*;
                   import org.papervision3d.lights.PointLight3D;
                   import flash.filters.DropShadowFilter;
                         import caurina.transitions.*;
                         private var numOfItems:int = 5;
                         private var radius:Number = 600;
                         private var anglePer:Number = (Math.PI*2) / numOfItems;
                         //private var dsf:DropShadowFilter = new DropShadowFilter(10, 45, 0x000000, 0.3, 6, 6, 1, 3);
                   public var angleX:Number = anglePer;
             public var dest:Number = 1;
                   private var theLight:PointLight3D;
            //Papervision Engine
                   private var viewport:Viewport3D; 
                   private var scene:Scene3D; 
                   private var camera:Camera3D;
                   private var renderer:BasicRenderEngine;
             private var planeArray:Array = new Array();
             [Bindable]
             public var object:Object;
             private var arrayPlane:Object;
             private var p:Plane;
             //Initiation function           
             private function init():void 
             viewport = new Viewport3D(pv3dCanvas.width, pv3dCanvas.height, false, true); 
             pv3dCanvas.rawChildren.addChild(viewport); 
             viewport.buttonMode=true;
             renderer = new BasicRenderEngine();
             scene = new Scene3D(); 
             camera = new Camera3D();
             camera.zoom = 2; 
             createObjects(); 
             addEventListeners();
    //Create Objects function          
              private function createObjects():void{
              for(var i:uint=1; i<=numOfItems; i++)
                        /* var shadow:DropShadowFilter = new DropShadowFilter();
                        shadow.distance = 10;
            shadow.angle = 25; */
                        var bam:BitmapFileMaterial = new BitmapFileMaterial("images/resolv"+i+".jpg");
                        bam.oneSide = false;
                        bam.smooth = true;
            bam.interactive = true;
                        p = new Plane(bam, 220, 200, 2, 2);
                        p.x = Math.cos(i*anglePer) * radius;
                        p.z = Math.sin(i*anglePer) * radius;
                        p.rotationY = (-i*anglePer) * (180/Math.PI) + 270;
                        scene.addChild(p);
                        //p.filters=[shadow];
                        p.extra={pIdent:"in"};
                        p.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, toggler);
            planeArray[i] = p;
              // create lighting
            theLight = new PointLight3D();
            scene.addChild(theLight);
            theLight.y = pv3dCanvas.height;
              private function toggler(event:InteractiveScene3DEvent):void
                            // if the cube's position is "in", move it out else move it back
                            if (event.target.extra.pIdent == "in")
                                    moveOut(event.target);
                            else
                                   moveBack(event.target);
                    private function moveOut(object:Object):void
                              trace(object +" my object");
                            // for each cube that was not selected, remove the click event listener
                            for each (var arrayPlane:Object in planeArray)
                                    if (arrayPlane != object)
                                            arrayPlane.removeEventListener(InteractiveScene3DEvent.OBJECT_PRESS, toggler);
                            //right.enabled=false;
                            //left.enabled=false;
                            // move the selected cube out 1000 and rotate 90 degrees once it has finished moving out
                            Tweener.addTween(object, {scaleX:1.2, time:0.5, transition:"easeInOutSine", onComplete:rotateCube, onCompleteParams:[object]});
                            Tweener.addTween(object, {scaleY:1.2, time:0.5, transition:"easeInOutSine", onComplete:rotateCube, onCompleteParams:[object]});
                            // set the cube's position to "out"
                            object.extra = {pIdent:"out"};
                            // move the camera out 1000 and move it the to same y coordinate as the selected cube
                            //Tweener.addTween(camera, {x:1000, y:object.y, rotationX:0, time:0.5, transition:"easeInOutSine"});
                    private function moveBack(object:Object):void
                            // for each cube that was not selected, add the click event listener back
                            for each (var arrayPlane:Object in planeArray)
                                    if (arrayPlane != object)
                                            arrayPlane.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, toggler);
                            // move the selected cube back to 0 and rotate 90 degrees once it has finished moving back
                            Tweener.addTween(object, {scaleX:1, time:0.5, transition:"easeInOutSine", onComplete:rotateCube, onCompleteParams:[object]});
                            Tweener.addTween(object, {scaleY:1, time:0.5, transition:"easeInOutSine", onComplete:rotateCube, onCompleteParams:[object]});
                            // set the cube's position to "in"
                            object.extra = {pIdent:"in"};
                            // move the camera back to its original position
                            //Tweener.addTween(camera, {x:0, y:1000, rotationX:-30, time:0.5, transition:"easeInOutSine"});
                            //right.enabled=true;
                            //left.enabled=true;
                    private function goBack():void
                            // for each cube that was not selected, add the click event listener back
                            for each (var arrayPlane:Object in planeArray)
                                    if (arrayPlane != object)
                                            arrayPlane.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, toggler);
                    private function rotateCube(object:Object):void
                            //object.rotationX = 0;
                            //Tweener.addTween(object, {rotationZ:0, time:0.5, transition:"easeOutSine"});
              private function addEventListeners():void{
        this.addEventListener(Event.ENTER_FRAME, render);
    //Enter Frame Listener function             
    private function render(e:Event):void{ 
                     renderer.renderScene(scene, camera, viewport);
                     camera.x = Math.cos(angleX) * 800;                                                  
                     camera.z = Math.sin(angleX) * 800;
    private function moveRight():void
              dest++;
              Tweener.addTween(this, {angleX:dest*anglePer, time:0.5});
              //goBack();
    private function moveLeft():void
              dest--;
              Tweener.addTween(this, {angleX:dest*anglePer, time:0.5});
              //goBack();
              ]]>
    </mx:Script>
              <mx:Canvas width="1014" height="661">
              <mx:Canvas id="pv3dCanvas" x="503" y="20" width="400" height="204" borderColor="#110101" backgroundColor="#841414" alpha="1.0" backgroundAlpha="0.57"> 
              </mx:Canvas>
              <mx:Button x="804" y="232" label="right" id="right" click="moveRight(),goBack()"/>
              <mx:Button x="582" y="232" label="left"  id="left"  click="moveLeft(),goBack()" />
              </mx:Canvas>
    </mx:Application>

    Your answer may be correct, but I am very much a beginner to actionscript, and I was wondering moreso if it is possible to determine the root/url (i.e. images/resolv2.jpg)? Or even if InteractiveScene3DEvent calls a variable that holds this url? However, specifically, I'm just wondering if the actionscript itself could determine the url in a line of code such as "if object == BitmapFileMaterial("/images/resolv2.jpg"); "? Also, here's a copy of InteractiveScene3DEvent in more detail if you think that will help:
    public class InteractiveScene3DEvent extends Event
                         * Dispatched when a container in the ISM recieves a MouseEvent.CLICK event
                        * @eventType mouseClick
                        public static const OBJECT_CLICK:String = "mouseClick";
                         * Dispatched when a container in the ISM receives an MouseEvent.MOUSE_OVER event
                        * @eventType mouseOver
                        public static const OBJECT_OVER:String = "mouseOver";
                         * Dispatched when a container in the ISM receives an MouseEvent.MOUSE_OUT event
                        * @eventType mouseOut
                        public static const OBJECT_OUT:String = "mouseOut";
                         * Dispatched when a container in the ISM receives a MouseEvent.MOUSE_MOVE event
                        * @eventType mouseMove
                        public static const OBJECT_MOVE:String = "mouseMove";
                         * Dispatched when a container in the ISM receives a MouseEvent.MOUSE_PRESS event
                        * @eventType mousePress
                        public static const OBJECT_PRESS:String = "mousePress";
                         * Dispatched when a container in the ISM receives a MouseEvent.MOUSE_RELEASE event
                        * @eventType mouseRelease
                        public static const OBJECT_RELEASE:String = "mouseRelease";
                         * Dispatched when the main container of the ISM is clicked
                        * @eventType mouseReleaseOutside
                        public static const OBJECT_RELEASE_OUTSIDE:String = "mouseReleaseOutside";
                         * Dispatched when a container is created in the ISM for drawing and mouse interaction purposes
                        * @eventType objectAdded
                        public static const OBJECT_ADDED:String = "objectAdded";
                        public var displayObject3D                                        :DisplayObject3D = null;
                        public var sprite                                                            :Sprite = null;
                        public var face3d                                                            :Triangle3D = null;
                        public var x                                                                      :Number = 0;
                        public var y                                                                      :Number = 0;
                        public var renderHitData:RenderHitData;
                        public function InteractiveScene3DEvent(type:String, container3d:DisplayObject3D=null, sprite:Sprite=null, face3d:Triangle3D=null,x:Number=0, y:Number=0, renderhitData:RenderHitData = null, bubbles:Boolean=false, cancelable:Boolean=false)
                                  super(type, bubbles, cancelable);
                                  this.displayObject3D = container3d;
                                  this.sprite = sprite;
                                  this.face3d = face3d;
                                  this.x = x;
                                  this.y = y;
                                  this.renderHitData = renderhitData;
    Thank you so much!

  • HT2477 How do I select multiple images without clicking on each one? Is there a way to select duplicate photos to delete them?

    How do I select multiple images without clicking on each one? Is there a way to select duplicate photos to delete them?

    Consider adding the delete symbol to the Finder window tool bar.  This way you can highlight all the photos you want to delete at the same time then hit the "delete" symbol.
    Open a Finder window/View/Customize Toolbar - follow the directions in the customized pop down window.

  • How to replace title bar from image

    Respected Sir/Madem,
    please help me, how we replace title bar of farme from image.and also that image have button like minimiz,restore,and close.
    i want to completely replace my title bar to a image for example NeoPlanet browser.
    plz givehelp.

    Frame.setUndecorated()

  • How to change images based on action.Even clicking changed images should ?

    how to change images based on action.
    Even clicking changed images should do respective actions.
    and while displaying only one image at a time sholud get displayed.
    I am using three images for a single column of a table in Jsp.
    Any clues.
    Any link for any good javascript html jsp site where i can find some good solution.
    vijendra

    In broad way if i say i have multiple situations in mutiple tables where i need such a logic to operate in for all tables.
    lets say in first time load of page by default one image will be displayed (one with sorted order for first column rest all non sorted)Now after every click to any image respective sort should get called.along with all images should get changed.Here with every function one/two images will get effect at least.
    As in first if i say sort by desc then this image will change rest all will remain in unsort form.
    when i move to other column and click on new image the previos will convert to unsort and new one will convert to sort by ascending. rest all will be in unsort form as it is.
    Now it seems like same logic is required with two three conditions.
    even for everyaction different parametrs has to be passed at differnt situations.
    Any good idea if someone can suggest.
    I will be very greatful for him.
    thanks
    vijendra

  • How to open an image when clicking in a word.

    Im working in a demo for an interactive book for ipad using the Digital Publishing Suite > Folio Builder and i need to be able to open a specific image when clicking in a word. I havent found any tutorial that shows how to do this can somebody please point me in that right direction?  thx so much

    Download Bob Bringhurst's DPS Tips app from the app store and/or watch my lynda.com DPS Essentials Course. If you don't have a subscription you can get a free one week trial here: lynda.com library | Trial Subscription

  • HELP! how to display an image when clicking on JLabel?

    hi. new to the forums. anyway, i need help in displaying an image.
    what i'm trying to do is when clicking on a JLabel using mouseClicked, an image will show and when the image is clicked it will disappear. i've searched and searched and have not found anything useful. thanks...

    thanks.
    searched on the setIcon, didn't find anything. btw, i know how to set the icon on the JLabel. i'm trying to figure out how i can get it that when i click on the JLabel by using the mouseClicked (or maybe even mousePressed) listener, the image pops up and when i click on the image, it closes or disappears.
    btw, i'm using the netBeans GUI builder for this. thanks again.

  • How to replace wecenter default loading image(ss.gif).

    Hi All ,
    I am working on webcenter customization .
    Can anyone provide me how to replace webcenter default loading image which appears before webcenter content gets loaded .
    Appreciate any prompt response .
    Thanks ,
    Arun.

    If it's the splash screen you speak of, a custom skin defining these selectors may work - af|document::splash-screen, af|document::splash-screen-content, af|document::splash-screen-message and af|document::splash-screen-icon.
    Please note that I have not tried these myself.

  • Hello, i am new to the mac and i need to learn how to re image using an external hard drive

    Hello, i am new, like baby fresh new,...lol, to the mac and i need to learn how to re-image using an external hard drive.

    How to replace or upgrade a drive in a laptop
    Step One: Repair the Hard Drive and Permissions
    Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger, Leopard or Snow Leopard.) After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    Step Two: Remove the old drive and install the new drive.  Place the old drive in an external USB enclosure.  You can buy one at OWC who is also a good vendor for drives.
    Step Three: Boot from the external drive.  Restart the computer and after the chime press and hold down the OPTION key until the boot manager appears.  Select the icon for the external drive then click on the downward pointing arrow button.
    Step Four: New Hard Drive Preparation
    1. Open Disk Utility in your Utilities folder.
    2. After DU loads select your new hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Note the SMART status of the drive in DU's status area.  If it does not say "Verified" then the drive is failing or has failed and will need replacing.  Otherwise, click on the Partition tab in the DU main window.
    3. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Set the format type to Mac OS Extended (Journaled.) Click on the Options button, set the partition scheme to GUID  then click on the OK button. Click on the Partition button and wait until the process has completed.
    4. Select the volume you just created (this is the sub-entry under the drive entry) from the left side list. Click on the Erase tab in the DU main window.
    5. Set the format type to Mac OS Extended (Journaled.) Click on the Options button, check the button for Zero Data and click on OK to return to the Erase window.
    6. Click on the Erase button. The format process can take up to several hours depending upon the drive size.
    Step Five: Clone the old drive to the new drive
    1. Open Disk Utility from the Utilities folder.
    2. Select the destination volume from the left side list.
    3. Click on the Restore tab in the DU main window.
    4. Check the box labeled Erase destination.
    5. Select the destination volume from the left side list and drag it to the Destination entry field.
    6. Select the source volume from the left side list and drag it to the Source entry field.
    7. Double-check you got it right, then click on the Restore button.
    Destination means the new internal drive. Source means the old external drive.
    Step Six: Open the Startup Disk preferences and select the new internal volume.  Click on the Restart button.  You should boot from the new drive.  Eject the external drive and disconnect it from the computer.

  • Replacing images using Javascript

    There are several posts explaining how to replace an image using Javascript (simpler with JQuery), but when I tried the code, the image kept reverting to the original image specified. This occurred regardless of browser, but does not revert in DW's "Live View". It turns out the culprit is that I was using an anchor <a> with a href attribute. The browser apparently evaluates the href after processing the OnClick() event. Switching to a button versus an anchor solved the problem. DW needs a little tuning.

    It turns out the culprit is that I was using an anchor <a> with a href attribute. The browser apparently evaluates the href after processing the OnClick() event. Switching to a button versus an anchor solved the problem.
    If you show us your code that wasn't working we'll be happy to recommend
    Don't need to see code. The explanation was clear enough to determine the cause of issue. <a href="somefile.ext" onclick="somefunction();">click</a> is going to somefile.ext immediately after triggering the onclick event on the page. Lookup return false; for the solution of using onclick event in an anchor tag.

  • How to Uplaod Image in BW Server(Images to be used in creation of web appli

    Hi All,
    How can we upload images in BW server, which can be used  in creation of web application which will contain the links to the super user utilities such as super queries and help documentation.
    Regrads
    Premanshu

    Hi,
    Goto SE80-> Mime repository ->SAP ->BW->Customer -> Images -> Right click ->Create mime object -> Show path from local computer and its done .
    After importing image remember to log off and log on from WAD in order to see imported image and include it in the object.
    Hope that helps.
    Regards
    Mr Kapadia

Maybe you are looking for

  • Sql in jspx file

    In my jspx file .....iam using JSTL package for exceuting sql query in jsf page.... but it could not run here i mentioned my code ..whats is mistakes in my code <sql:setDataSource driver="sun.jdbc.odbc.JdbcOdbcDriver" url="jdbc:odbc:dsn4" user="xyz"

  • Photostream pictures shown on iphone..cannot find them anywhere else

    Ok, this is ridiculous! Photostream is shown in the photos app camera roll shows 327 pictures photostream shows 1000 pictures. How do I get them onto my MAC??????????????????????????????????????????????? Tried Itunes Tried Icloud Tried share_pod Help

  • Add the ability to use .xls and .xlsx files for Data Merge

    Who wouldn't like that?!

  • Error in LV 6i

    I've got an error with Labview 6i. I tried to load a VI, and I got the error: "error in objheap.c line 474". Anyone else got this error? The NI web site says that I have a corrupt VI, but it loads up in LV5. Any help on this would be appreciated. Tha

  • How to create an eclipse visual editor plugin?

    Hi all, I want to know how to create an eclipse plugin that uses a visual editor for creating my xml file. Can anyone help me? Thanks Pasquy73