Image Click Event in html text

Is there a way to attach event with the image inside html
text in TextArea control. Just like we can attach text event with
link tag?
One possible solution is to enclose the image in <A>
tag making it a link and setting its href to generate text event. I
have already tried this and it works fine. But is there any other
way to do that.
Thanks

Hi Prabhavathi,
Here is how you handle double click events in Textedit control.
1)Create a custom control in screen (say TEXT_CONTROL)
2)In main program,
a) Declarations:
data: obj type ref to cl_gui_custiom_control.
      text type ref to cl_gui_textedit.
b) Create the instance of custom container
c) Create the instance of textedit control.
3)Now to handle double click events , create a local class as follows.
class shail_event definition.
public section.
methods:
handle_doubleclick for event dblclick of cl_gui_textedit .
endclass.
class shail_event implementation.
method handle_doubleclick .
here do the coding for handling the double click.
endmethod.
endclass.
4) Create an instance of the handler class(ie.ZSHAIL_EVENT).Let it be named hand.
5) Define varibles for event.
DATA: i_events TYPE cntl_simple_events,
      wa_events TYPE cntl_simple_event.
SET HANDLER hand->handle_doubleclick for text.
wa_events-eventid = cl_gui_textedit=>event_double_click.
wa_events-appl_event = 'X'. "This is an application event
APPEND wa_events TO i_events.
6)
    CALL METHOD texte->set_registered_events
      EXPORTING
        events                    = i_events
      EXCEPTIONS
        cntl_error                = 1
        cntl_system_error         = 2
        illegal_event_combination = 3
        OTHERS                    = 4.
    IF sy-subrc <> 0.
     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
These are the basic steps needed for handling events in Textedit control.You can go to SE24 and type CL_GUI_TEXTEDIT to find the associated events of the class.
If you want the program, kindly send your mail-id so that I can mail it to you.
Regards,
Sylendra.

Similar Messages

  • How to handle double click event in a text control

    Hi,
       Will u please send me information on handling double click events inside text control and also about locking and unlocking of DB tables for updation.
    Regards,
    Praba.

    Hi Prabhavathi,
    Here is how you handle double click events in Textedit control.
    1)Create a custom control in screen (say TEXT_CONTROL)
    2)In main program,
    a) Declarations:
    data: obj type ref to cl_gui_custiom_control.
          text type ref to cl_gui_textedit.
    b) Create the instance of custom container
    c) Create the instance of textedit control.
    3)Now to handle double click events , create a local class as follows.
    class shail_event definition.
    public section.
    methods:
    handle_doubleclick for event dblclick of cl_gui_textedit .
    endclass.
    class shail_event implementation.
    method handle_doubleclick .
    here do the coding for handling the double click.
    endmethod.
    endclass.
    4) Create an instance of the handler class(ie.ZSHAIL_EVENT).Let it be named hand.
    5) Define varibles for event.
    DATA: i_events TYPE cntl_simple_events,
          wa_events TYPE cntl_simple_event.
    SET HANDLER hand->handle_doubleclick for text.
    wa_events-eventid = cl_gui_textedit=>event_double_click.
    wa_events-appl_event = 'X'. "This is an application event
    APPEND wa_events TO i_events.
    6)
        CALL METHOD texte->set_registered_events
          EXPORTING
            events                    = i_events
          EXCEPTIONS
            cntl_error                = 1
            cntl_system_error         = 2
            illegal_event_combination = 3
            OTHERS                    = 4.
        IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    These are the basic steps needed for handling events in Textedit control.You can go to SE24 and type CL_GUI_TEXTEDIT to find the associated events of the class.
    If you want the program, kindly send your mail-id so that I can mail it to you.
    Regards,
    Sylendra.

  • Style Image Slider to include HTML text: How?

    I am trying to insert an image slider onto my page. So far, I have tried a few different sliders with some issues.
    Does anyone know
    A good Jquery Image Slider that allows for HTML text beside the image on a slide?? (Like MSN Homepage)--No Caption or Overlay. Looking for White background with linkable HTML Text on left (40%) and Picture on Right (60%)-all on one slide. Cycle through four similar slides.
    I am assuming the solution is not so much the slider, but has to do with creating a seperate div or rule / class and applying?
    Thank you for any help.

    I would approach it like this:
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>HTML5 document with Cycle2</title>
    <!--Latest jQuery Core Library-->
    <script src="http://code.jquery.com/jquery-latest.min.js">
    </script>
    <!--Cycle2 Plugin Script-->
    <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery.cycle2/20130409/jquery.cycle2.min.js"></script>
    <style>
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    .cycle-slideshow {
    margin: 25px auto;
    border: 1px solid silver;
    overflow: hidden; /**float containment**/
    width: 80%; /**adjust width of container as required**/
    .cycle-slideshow img {
    width: 60%;
    float: left;
    .cycle-slideshow h3 {
    float: right;
    width: 40%;
    font-size: 26px;
    color: red
    .cycle-slideshow p {
    clear: right;
    float: right;
    width: 40%;
    font-size: 16px;
    .center {text-align:center}
    /* Special Rules for tablets, mobiles */
    @media only screen and (max-width: 768px) {
    .cycle-slideshow { width: 98% }
    .cycle-slideshow img {
    width: 100%;
    display: block;
    float: none;
    .cycle-slideshow h3 {
    display: block;
    float: none;
    font-size: 20px;
    width: 100%;
    .cycle-slideshow p {
    display: block;
    float: none;
    font-size: 14px;
    width: 100%;
    </style>
    </head>
    <body>
    <h1><a href="http://www.malsup.com/jquery/cycle2/">jQuery Cycle 2</a>
    Responsive Slideshow with text</h1>
    <!--begin slideshow-->
    <div class="cycle-slideshow"
        data-cycle-pause-on-hover="true"
        data-cycle-timeout="2000"
        data-cycle-next="#next"
        data-cycle-prev="#prev"
        data-cycle-slides="> div"
    >
    <div>
    <img alt="description" src="http://placehold.it/400x100">
    <h3>Slide 1</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
    Mauris vitae libero lacus, vel hendrerit nisi! Maecenas quis velit nisl, volutpat viverra felis. </p>
    </div>
    <div>
    <img alt="description" src="http://placehold.it/400x100">
    <h3>Slide 2</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
    Mauris vitae libero lacus, vel hendrerit nisi! Maecenas quis velit nisl, volutpat viverra felis. </p>
    </div>
    <div>
    <img alt="description" src="http://placehold.it/400x100">
    <h3>Slide 3</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
    Mauris vitae libero lacus, vel hendrerit nisi! Maecenas quis velit nisl, volutpat viverra felis. </p>
    </div>
    <div>
    <img alt="description" src="http://placehold.it/400x100">
    <h3>Slide 4</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
    Mauris vitae libero lacus, vel hendrerit nisi! Maecenas quis velit nisl, volutpat viverra felis. </p>
    </div>
    <div>
    <img alt="description" src="http://placehold.it/400x100">
    <h3>Slide 5</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
    Mauris vitae libero lacus, vel hendrerit nisi! Maecenas quis velit nisl, volutpat viverra felis. </p>
    </div>
    <!--end slideshow-->
    </div>
    <!--prev, next links-->
    <div class="center">
    <a href=# id="prev">Prev</a>  | <a href=# id="next">Next</a>
    </div>
    </body>
    </html>
    Nancy O.

  • Image not displaying with HTML text field

    I am trying to display am image within
    flash using CS3.
    I have a text field with the following code.
    feedback.htmlText = "<img src='Logo_small.png'</img>"
    nothing displays. The image and flash document are at the same level, so that is why I am using a relative link. Do I need to use a full (absolute) link to the image?

    That's not properly coded html...
    feedback.htmlText = "<img src='Logo_small.png' />";
    image tags do not have a closing tag and you didn't close the opening tag if they did, so it would still fail.

  • html:text tag

    Hi everybody,
    I am new to Struts concept. I am trying to develop astruts application. I am writing one textbox on that I want call one javascript function for onchange event my html:text tag looks like the following:
    <% int i=0; %>
         <logic:iterate id="ts" name="loginForm" property="timesheet">
         <td>
    <% i+= ; %>
         <html:text property="worked_Hours" name="ts" onchange="findTotal(<%= i %>)"></html:text>
         </script>
         </td>
         </logic:iterate>
         </tr>
    My intention in this code is I am creating the textbox control array. So I want to send that i variable value to that findTotal() javascript function. But the compiler instead of putting i value in the findTotal() function it is putting the code like this
    <input type=text name="worked_hours" value="8" onchange="findTotal(%= i %>).
    How can I get the value of i in the resultant jsp page.
    Please reply me soon.
    Thank you all,
    Varma

    When using custom tags, and specifying a dynamic attribute, always put <%= %> for the entire attribute
    Try this:
    <html:text property="worked_Hours" name="ts"
      onchange="<%= "findTotal(" + i + ")" %>" ></html:text>

  • Opening New Browser window for click event on an image

    hi all,
    I want someone to help me out solving the problem of opening
    a new browser window on the mouse click event of an image or a
    button etc.... The new window would contain the datagrid details
    from the main window, but in an expanded form. If at all there is a
    solution, I even want to know whether there is anyway for sizing
    the poped up window,because I dont want the new poped up window to
    cover the entire screen.
    For getting better idea of my problem, the best example I
    could give is the popup window that appears when we click on the
    preview button while posting the message to the forum.
    Someone please do help me out in this regard.
    Thanks,
    amar.

    I'd definitely try to use a Flex popup... but the
    flash.net.navigateToURL method is a simple way to open a popup
    window in a new browser. You can pass any data needed by the new
    page using the URLRequest and/or URLVariables. The URL you navigate
    to could, of course, be another Flex application if necessary. I
    use this only when I need to open a popup window on another site,
    or an HTML formatter report or something similar.
    Concerning yourself with the size of the popup window may be
    a bad design choice also. I, for example, have my browser
    configured to open all popups in a new tab regardless of sizing
    constraints imposed by the designer. If it is absolutely necessary
    for you to have control over the size of your popup window, you
    should follow the advice given by others and use a Flex
    popup.

  • TS3899 I recently discovered that I can no longer access websites pointed to within the content of an email message on my iPad Air by clicking on the highlighted HTML text or symbols. What should I do to correct this issue?

    I recently discovered that I can no longer access websites pointed to within the content of an email message on my iPad Air by clicking on the highlighted HTML text or symbols. What have I done to create, and what should I now do to correct, this issue?

    Or you could include a width to your body style:
    body {
    background-image: url(Logo/sky1.jpg);
    background-position: center center;
    background-attachment: fixed;
    width: 75%;}
    It might work or not depending on your other color scheme.

  • Preventing html text from downloading before image

    Hi. I am so NEW to this. I just created my first web site
    ever! It's mine.
    Problem: If anyone goes to see the site for the first time
    and clicks on the links--my html text downloads before my images,
    and this looks weird for a second. What can I do to fix that?
    Anything simple? My site is:
    http://www.lolabernabe.com
    Thanks so much for your help. I will miss this forum after
    Adobe changes it!
    L.

    "manhattangirl" <[email protected]> wrote in
    message
    news:gntn65$bts$[email protected]..
    > Hi. I am so NEW to this. I just created my first web
    site ever! It's mine.
    >
    > Problem: If anyone goes to see the site for the first
    time and clicks on
    > the
    > links--my html text downloads before my images, and this
    looks weird for a
    > second. What can I do to fix that? Anything simple?
    >
    > Thanks so much for your help. I will miss this forum
    after Adobe changes
    > it!
    >
    > L.
    >
    Hi L
    This is a normal part of the process. The html text is
    smaller in size than
    your images, so loads much quicker.
    Even if there were some way to hold back the display of the
    text until the
    images are downloaded, I would suggest that you wouldnt
    really want to do
    that.
    Imagine someone coming to your newly created web site
    (congratulations!),
    and they see nothing on the page.
    Many people would think that either the site is too slow and
    might not hang
    around. Its much better for them to see something happening
    on the page
    straight away.
    My advice would be to learn how to optimise your images to
    get them to
    download as quickly as they can, without destroying too much
    quality of the
    image. If your images are really large, in physical size,
    perhaps you could
    consider slicing them into a couple of sections, so that it
    doesnt take as
    long for something to appear on the page.
    Regards
    Fiona

  • Listening for click event on an af:image tag

    Dear All,
    Can anybody help me why my code does not work.
    Use case, using an Image, i wanted to call a managed bean method whenever I clicked the image. So here is what I did, I added a clientlistner
    and wait for the click event. Also a server listener is attached to the image.
    <af:image >
         <af:clientListener type="click" method="handleImageClick"/>
         <af:serverListener type="ImageEvent"
                           method="#{viewScope.MyBean.handleImageEvent}"/>
    </af:image>...and here is my javascript...
    <f:facet name="metaContainer">
         <af:resource type="javascript">
           function handleImageClick(evt)
                var comp = evt.getSource();
                AdfCustomEvent.queue(comp, "ImageEvent",{ fvalue : comp.getSubmittedValue()},false);
                evt.cancel();
         </af:resource>
    </f:facet>..and here is my managed bean method.
    public void handleImageEvent(ClientEvent ce)
    }I jsut dont know why it does not call my managed bean method. Is there any mistake in my code?
    JDEV 11G PS5
    Thanks

    codigoadf wrote:
    the problem is in Javascript. remove "fvalue : comp.getSubmittedValue()" and will work fine.
    AdfCustomEvent.queue(comp, "ImageEvent",{ },false);comp.getSubmittedValue()?? comp is a imageAhhh yeah..I just copy pasted this code from google..
    Thanks for your help...it now works..

  • Gallery with HTML text under image

    I'm working on a gallery of images with thumbnails on the left and larger photos on the right. My problem is the larger photos on the right need some text under them. I've been adding the text to the photos in photoshop and doing this as a standard swap image/swap image restore. What I was wondering, is there a way to add this text as HTML. When I do the swap image I would need to swap out the HTML text also. I've done this as a layered div in the past, but it gets cumbersome when you have 30 thumbnails. Hopefully someone has a good solution for this. I'm thinking about giving up on Dreamweaver and doing this sort of thing in Flash.
    ----Here's the website I'm working on -- http://www.elyssabassdesigns.com/fashion_collection/fashion_cuffs.html

    There are literally hundreds of CSS, DHTML or jQuery solutions you could use.
    http://www.1stwebdesigner.com/resources/57-free-image-gallery-slideshow-and-lightbox-solut ions/
    http://www.dynamicdrive.com/dynamicindex14/index.html
    www.JAlbum.net
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • How to open a text file using button click event

    hi, How can i open a text file in a textpad or notepad on the click event of a button.?
    Thanks
    Jay

    Pnt,
    this will not work LV 8.0.1 and LV 8.6 will give back error 193.
    Attached is a VI to use the ShellExecute WinAPI. The VI is LV 7.1.1.
    Message Edited by waldemar.hersacher on 10-09-2008 10:48 PM
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions
    Attachments:
    ShellExecute.zip ‏27 KB

  • Dynamic text box, HTML Text with Image

    Hello Everyone,
    I am using Flash version 8. I have used the text tool and
    created a dynamic text box and have attached the UIScrollBar
    component to it. This text box is configured to allow the use of
    html text to be inputted to it. I have code that reads a file which
    contains a list of text files that I then read and place them into
    the text box. The user can use the scroll bar to scroll through all
    the text.
    I have created an image that is a picture of the tab portion
    of a file folder. On the tab I have place some text. This was all
    done in Photoshop. This tab image is used to separate the different
    stories in the text box. The image is save as a jpeg file
    Everything you have just read works with out any problems.
    Now for the problem!
    This image is only 20 pixels tall and the text is not very
    readable. As we all know the HTML tags are very limited in Flash 8.
    Ideally I would like to put the text and image in to the text
    box as I would normally do. Then place text on top of the image and
    have it all scroll properly with in the text box.
    I have taken the tab image and converted it in to a graph
    symbol and then put the text on top of the image. This looks good;
    however I don’t know how (or if it is even possible) to place
    the graphic symbol in to the text box at the correct place within
    the text.
    Does anyone have ideas on what may work? Remember that the
    image I am working with is only 20 pixels tall which is why the
    text quality on the image is so poor.
    Thank you all for any help you may provide,
    Steve

    Yes Tim I am using the <img> tag and I know that I
    can’t place text over the image. I have set the height and
    width to be the exact size of the image. However When you go to the
    webpage it will open the movie to the maximum size based on the
    resolution of your display; however I do maintain the aspect ratio
    of the movie. For testing I did set a fix size to the size of the
    movie. Sometimes the fix size (1000x750) looks better and sometimes
    a larger size (example 1280x1024). I believe that the main problem
    is the fact the size of the image is 670 pixels wide by 25 pixels
    high and of the 25 pixels the text is only 18 pixels tall. In
    Photoshop this makes it about a 1.75 point font. As you can see the
    real problem is that I don’t have enough pixels to make up
    the text. This is why I am looking for an alterative way to create
    the text.
    I tried importing the image into flash as a graphic symbol
    and then using the text tool to create the text. The results looked
    real sharp, the text was nice and crisp (just what I wanted). The
    problem is that I could not find a way to place the graphic symbol
    into the dynamic text area like id did using the <img> tag.
    This symbol needs to scroll as you scroll the text in the text
    area.
    This is why I am asking for help. I am looking for some ideas
    that may work.
    Thank you,
    Steve

  • Image Field overwrite existing click event

    Using LiveCycle 8, I am creating a form which has an image which will change when the user clicks the image object.
    I downloaded the trial of Acrobat Professional 8.0. In this version, instead of creating a form in Acrobat, it uses LiveCycle 8. In LiveCycle, there is no Image Button and the Static Image object cannot be scripted. It seems the choice for a dynamic image object is the Image Field. But this object has a default click event which is not required in my form.
    Is there a way to replace the default click event on the Image Field object? I would like to overwrite it's click event with my own Javascript script. So far, I can add my own script in the click event, but then both my script and the browse for image file occurs.
    Thanks!

    You can't override an event but you could put a button over top of the image, make it the same color as the background, remove the caption and then when you click the image you are really clicking the button. You can put your code on the click event of the button. make sure the button is in the foreground and the image field is in the background.

  • How to Display Html Text with Image

    HI Frens,
    I am getting some html text from a source, Later i want to
    display that data, but it may happened that it has some images in
    it. Currently I am using text area to display it.
    Now My question is if there is any image will it show, as we
    can see it in our mails? if Not, Which component I should use for
    this?
    I also want that I need to select some file from, How can i
    get open dialog box here?
    Thks in Advance for replies frens:
    Ashish Mishra

    Hi Ashish,
    If I have understood your requirement properly, u want to
    display html text on a flex application.
    I think there its better if you use the html component to
    display the text. I have a sample code which will give you a
    direction to think on.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
    xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical"
    creationComplete="initApp( )">
    <mx:Script>
    <![CDATA[
    public function initApp( ):void
    var initHtml:String = "<html><head> \
    <title='Page Example'/> \
    <body bgcolor='#ccddee'><h1>Page
    Example</h1> \
    <p>This is a complete <b>HTML</b> \
    page as a
    <em>string</em>.</p></html></body>";
    this.html.htmlText = initHtml;
    ]]>
    </mx:Script>
    <mx:HTML id="html" width="100%" height="100%" />
    </mx:Application>
    Also do you want a file open dialog box??

  • Double Click Event not fired for IE 11 with compatibility mode for HTML elemnt table

    Hi,
    I am facing an issue with Double click event(not getting fired on double click of mouse) for IE 11 with compatibility mode on HTML element "table" for Windows 7 64 bit machine.It runs fine on IE 10 with compatible mode with Windws 7 64  bit
    machine -- double click event.
    Can you please help to resolve the issue?
    Thanks and Regards,
    Yogesh

    Hi,
    f12>Debug tab, click the 'start' button.....(select break on all exceptions from the dropdown on the Debug tab)
    click your table and correct any errors that are listed in the Console of the developer tool.... probably you are using attachEvent I/o addEventListener. You should be using addEventListener for IE9 and higher and other web browsers.(it the w3c standard
    (recommendation).
    Post questions about html, css and scripting for website developers to the MSDN IE Web Development forum. Include with your question a link to your website or a mashup that shows the issue.
    Rob^_^

Maybe you are looking for

  • Check plugins page never loads.

    Beginning today, I can no longer watch YouTube videos without them freezing. They will usually start with an ad that doesn't play or load. Then if I wait a few seconds or click on the video, the video just starts playing. Then, the video will play fo

  • My itunes is not recognizing my iPhone

    When I plugged in today to sync the iPhone is not being recognized by iTunes account.  Only option on my Phone is the "eject". Uninstalled all components and did reinstall, same issue. 

  • Assistant NET8 and DBCA won't start after installation HELP

    HEllo, I've installed oracle 9.01 and later on 8.1.7 i cannot use the assistants net 8 and dbca after installation. Does anybody have the same problem. I think is has something to do with jre versions. I alse got the same problem when i installed db9

  • Where can I get ABAP trial?

    I ' am  a new student of ABAP and need a demo or trial version to practice  the programming in ABAP. Thank You

  • EM console  - SQL monitor  message: NO SQL exectuion monitored so far...

    Hi All, I have installed oracle11g (11.2.0.3.0) Standard Edition. When I run the EM console to view list of running SQLs I clicked on SQL Monitoring link but to my surprised there is no sql and message is NO SQL exectuions were monitored so far...I d