Need to dynamically include an image file when calling a popup window

I am working on a web dynpro Java app which uses a button to call a popup window/view. Within the popup, I want to dynamically choose an image to show (from mime types) based on a criteria...there will be multiple buttons on the initial view that all call the same popup, but the popup will have content specific to which button called it (specifically the image embedded in the view).
My question is, what is the proper/best way to do this?
Here are some possible ways I can think of...
1. Pass a parameter from each button during the call of the event, but how does that get sent to the implementation of the second view for use in determining which image? And, how do I modify the source property of the image element based on that parameter?
2. Create multiple pages and views for each button to call...but this seems decidedly un-DRY.
3. Saw one posting on how to dynamically create a cached image...I could use different event handlers in the initial view, then load individual images from the mime library at that point...cache it into a hard-coded image name...then just call the identical view every time. Not sure this is even possible...input?
I don't know specifically how to implement any of these options, or know if there are other/better ways. Any help would be appreciated.

Just create a context attribute "imageFileName" in the component controller or a custom controller, map this attribute from both views (the one that contains the buttons and the one in the popup window that displays the image).
Now you can have an separate action for each button or one common action. In the first case just set the "imageFileName" inside the action handler for the specific button. In the second case use an action parameter "buttonId" and a parameter mapping
button.mappingOfOnAction().setParameter("buttonId", button.getId());
to determine which button triggered the action. After having checked which button was pressed, set the "imageFileName" accordingly.
Armin

Similar Messages

  • Error when calling a popup window in the initial screen of an application

    Hi,
        I am calling a popup window in the Initial screen to select the variant list.
    I am getting an error reference to Null Object reference.
    Here is the Error.
    Runtime Errors         OBJECTS_OBJREF_NOT_ASSIGNED_NO
    Exception              CX_SY_REF_IS_INITIAL
    Date and Time          15.06.2007 10:00:16
    Short text
    Access via 'NULL' object reference not possible.
    What happened?
    Error in the ABAP Application Program
    The current ABAP program "CL_WDR_MESSAGE_AREA===========CP" had to be
    terminated because it has
    come across a statement that unfortunately cannot be executed.
    What can you do?
    Note down which actions and inputs caused the error.
    To process the problem further, contact you SAP system
    administrator.
    Using Transaction ST22 for ABAP Dump Analysis, you can look
    at and manage termination messages, and you can also
    keep them for a long time.
    Error analysis
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_REF_IS_INITIAL', was not
    caught in
    procedure "SUPPLY_VIEW_DATA" "(METHOD)", nor was it propagated by a RAISING
    clause.
    Since the caller of the procedure could not have anticipated that the
    exception would occur, the current program is terminated.
    The reason for the exception is:
    You attempted to use a 'NULL' object reference (points to 'nothing')
    access a component.
    An object reference must point to an object (an instance of a class)
    before it can be used to access components.
    Either the reference was never set or it was set to 'NULL' using the
    CLEAR statement.
    How to correct the error
    Probably the only way to eliminate the error is to correct the program.
    If the error occures in a non-modified SAP program, you may be able to
    find an interim solution in an SAP Note.
    If you have access to SAP Notes, carry out a search with the following
    keywords:
    "OBJECTS_OBJREF_NOT_ASSIGNED_NO" "CX_SY_REF_IS_INITIAL"
    "CL_WDR_MESSAGE_AREA===========CP" or "CL_WDR_MESSAGE_AREA===========CM00Q"
    "SUPPLY_VIEW_DATA"
    If you cannot solve the problem yourself and want to send an error
    notification to SAP, include the following information:
    1. The description of the current problem (short dump)
    To save the description, choose "System->List->Save->Local File
    (Unconverted)".
    2. Corresponding system log
    Display the system log by calling transaction SM21.
    Restrict the time interval to 10 minutes before and five minutes
    after the short dump. Then choose "System->List->Save->Local File
    (Unconverted)".
    3. If the problem occurs in a problem of your own or a modified SAP
    program: The source code of the program
    In the editor, choose "Utilities->More
    Utilities->Upload/Download->Download".
    4. Details about the conditions under which the error occurred or which
    actions and input led to the error.
    The exception must either be prevented, caught within proedure
    "SUPPLY_VIEW_DATA" "(METHOD)", or its possible occurrence must be declared in
    the
    RAISING clause of the procedure.
    To prevent the exception, note the following:
    Looking for Ur valuable suggestions.
    Cheers,
    Sam

    Hi Sam,
    The correct code for creating a popup window will be:
      data lo_window_manager type ref to if_wd_window_manager.
      data lo_api_component  type ref to if_wd_component.
      data lo_window         type ref to if_wd_window.
      lo_api_component  = wd_comp_controller->wd_get_api( ).
      lo_window_manager = lo_api_component->get_window_manager( ).
      lo_window         = lo_window_manager->create_window(
                         window_name            = 'WINDOW_NAME'
    *                    title                  =
    *                    close_in_any_case      = abap_true
                         message_display_mode   = if_wd_window=>co_msg_display_mode_selected
    *                    close_button           = abap_true
                         button_kind            = if_wd_window=>co_buttons_okcancel
                         message_type           = if_wd_window=>co_msg_type_none
                         default_button         = if_wd_window=>co_button_ok
      lo_window->open( ).
    Hope this helps.
    Regards,
    Ram

  • Dynamic Action on "Get Focus" After Closing a Popup Window

    Hi,
    From one of APEX Application Pages I am calling a Popup Window where users can create a new record. In the Popup Window once the record is created and window is closed, I want to refresh the region on the main page to show the record created in the popup window.
    How do I create a dynamic action which will fire when the main APEX window gets the focus (after the popup window is closed). ?
    Any pointers will be greatly appreciated.
    Thanks & Regards,
    Ashish Agarwal
    http://www.asagarwal.com

    Assuming that you have a dynamic action in the parent page which refreshes the region
    <li> Make a note of the event which triggers your dynamic action, lets call this event A.
    <li> Create a JS function in parent page which triggers event A when called.
    For example if your Dynamic Action trigger is a button(id ="P100_REFRESH") press event
    Your JS function could be
    function Trigger_refreshRegion()
      $('#P100_REFRESH').click();
    The way in which you simulate the Dynamic action deoends on the firing event that you have used, so modify it appropriately.
    <li>Now in the pop up page, if you are closing the page in JS using smthing like window.close() or so,
    just call the parent page's refresh JS function there using the
      opener.Trigger_refreshRegion(); //whatever was the name of the function that you created.

  • Simulate Acquisition does not include new image file created after first call

    For example, I have 5 images in a folder.
    I call Simulate Acquisition.
    It cycles through all 5 images.
    Now If I include 1 more image it does not include this image in the "cycle". I need to reload this step by clicking Main\path\browse button and select any image in the folder and then it cycles through all 6 images.
    Is there anyway to automatically include new images added to the folder after the step has been created?
    Thanks.
    CVI 2010
    LabVIEW 2011 SP1
    Vision Builder AI 2011 SP1

    Here's a sample inspection and VI to illustrate how you could do this. I used an image variable and passed this into the Run LV step so the VI could read the file and update the image variable and then I used the Select Image step to get the image variable into the VBAI script so you can process it. I also added a delete option in the VI so you can delete the previous image when you read the next available image. Make sure to go to the Setup State and initialize the path variable to where your image files will live (to access the Setup State, go to View>>View Complete Inspection and select on the Setup option on the left hand side. I initialized it to c:\Image Folder
    Hope this helps,
    Brad
    Attachments:
    Read Dynamic Image File.zip ‏15 KB

  • Is it safe to back up a disk image file when it's mounted?

    Hi -
    I use some small, encrypted ".sparsebundle" disk image files to keep my diary, banking info, etc., on. When I'm at the computer, I keep them mounted all the time.
    Is it safe to let Time Machine automatically back up the .sparsebundle disk image files, even while they are mounted? Or would there be a possibility the backups would be corrupted, if the operating system hadn't written out cached data or something to the disk image file?
    In other words, if I save any open documents on the mounted disk image, does the disk image file on disk always contain the fully-saved document and a consistent file system? Or could there still be some data cached in RAM, that would not be saved at the time the .sparsebundle file was copied? Is it always necessary to unmount a disk image before duplicating its .sparsebundle file?
    Do I need to turn off Time Machine's automatic backup, and just do manual "backup now" after unmounting the disk images? That's a major pain in the behind... I really want to just let Time Machine do it's hourly backups as usual, but of course there's no point if the backups are corrupt.
    Of course my own guess is "to be safe", I should unmount them before backing up. But again it's a big pain if it's not actually necessary. Does anyone know for sure?
    Thanks...

    My understanding is that Unix, generally, doesn't write everything out to disk immediately. There is caching in RAM to speed up disk access, including modified superblocks, modified inodes, and delayed reads and writes. Now, if you ask to read an individual file, the kernel makes sure all the cached data is written before it returns the read data. But if you try to do, for example, a block copy of the whole filesystem, the kernel doesn't know that, and there's no guarantee or expectation that the filesystem will be in a coherent state.
    That's the purpose, for example, of the "sync" command - to write all this cached data to disk before unmounting, shutting down, etc., and, that's why the OS gets so upset if you just unplug a firewire drive. Because even if you've saved and closed any open documents, they haven't necessarily been fully written out to disk yet.
    So what I don't understand, is how people are ever able to back up mounted disk image files without them getting corrupted. I mean, you'd think they would get corrupted all the time. It would be the equivalent of just unplugging your firewire drive before you made a backup of it, or of doing a block copy of a read/write mounted filesystem. There ought to be a very good chance of the filesystem being scrambled. So, why does it not happen?
    Is there something different about the Apple filesystem, or Apple disk images? Or, maybe we're only talking about delay times in the cache of fractions of a second, so as long as you haven't written anything within a few seconds of the copy, and don't write anything during it, you're ok?
    Even if Apple reps won't answer my question, the kernel and most likely all the low-level disk i/o and filesystem stuff is open source. Surely there's someone out there who would be knowledgeable enough to give a definitive answer? I was hoping to find someone like that here... I do appreciate your taking the time to answer my post, but maybe I need to go elsewhere, on some developers' mailing lists or something? Does anyone know of such a place I could start looking?
    Thanks...

  • HELP: How do i include a policy file when embedding a JApplet

    This is the problem i'm facing.I've been able to successfully grant my japplet permission to access resources on the c: drive. When i run it using appletviewer there's no problem, it's able to access the database on the c: drive but when i embedd it in my html page it fails to access the database (i.e it is unable to include the policy file). Does anyone know how to get around this problem?

    You can not directly include a policy within an applet. This would be a security risk.
    In general you have 2 choices if you wish to grant an applet more rights than it has per default:
    1. You can sign it.
    2. You change your local policy file.
    ad 1:
    You can generate a keypair using keytool and sign the applet with jarsigner. (you need to create a jar file first)
    when your applet is then loaded in the browser, a popup asks the user, if he wanna trust the signer. If the user clicks no, the applet is executed with standard applet rights. If the user clicks yes, the applet is executed with full permission (like an applet from file:/*)
    ad 2:
    use policytool to create/change a policy file in your home directory. You can describe the applet either with a path (=codebase) or with some meta-information like signer.
    create a policy that fits your need, and save the file.
    next time you execute your applet in the browser, the policy will grant the applet additional permissions.
    There is a third option. You can mix 1 and 2.
    You can sign your applet, and create a policy for all applets signed by you.
    Then there will be no popup, and the applet has automatically the rights you defined in the policy file.
    But I would suggest to consider the possibility to write a stand-alone application, instead of granting an applet access to the local hard disk.

  • Attempting to upgrade to Firefox 3.6 (using an ancient Mac OS 10.3), but received an error message (corrupt image file) when downloading - any way to correct this with my current OS?

    I'm currently trying to update a few programs on my good old (VERY old) Mac Powerbook, but I ran into an error when downloading Firefox version 3.6...I'm currently running Mac OS X 10.3.9, which isn't compatible with the most recent versions of Firefox (or anything, for that matter), but it should still allow an upgrade of version 3.6; however, once the file finished downloading, an error message popped up indicating there's a corrupt image file. Is there any way to work around/correct this problem, or am I stuck with my old version of Firefox until I bite the bullet and upgrade my OS??? Any help is greatly appreciated!!

    Firefox 3.6 requires at least OS X 10.4, the last version of Firefox that runs on OS X 10.3.9 is Firefox 2.0.0.20 available from https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/2.0.0.20/mac/en-US/

  • How to include an image file in an email

    Hi,
    I want to send an image file (jpeg) in an email. Could some one help on this?
    Regards,
    kIDMan.

    Hi all,
    I have the same requirement of sending an image in email footer.
    I have tried to use the <IMG src="http://localhost.........."/> on my local computer but it only shows an empty square instead of image.
    It shows the image only in case of the complete path i.e C:\...........
    kIDMan, how did you resolve the issue.
    Thanks
    Gaurav Jain

  • Opening an image file in an existing TextEdit window

    I'm blocked on this, which seems it should be straightforward (but maybe it isn't).
    If I have an open TextEdit window on the desktop and drag an image file to it, the image appears in the window.
    How do I replicate that result with AS?

    Hi red_menace
    Your proposed approach seems reasonable, although I haven't tried it. Rather, I'm looking at other ways of achieving the present goal. That is to open a small window on the desktop with an embedded image and embedded text -- and then, at certain dates (not a problem), move the window to a different position, perhaps with a different image and different text.
    A TextEdit window certainly wasn't ideal for this, as it has baggage I can do without -- a ruler (which can be eliminated with a system events command), a title, and the three manipulation buttons.
    A window that would better meet my needs would be a "Stickies" window, but Stickies isn't scriptable.
    I can move it around fine with Finder commands, and I can close it. If I create all the windows I will need ahead of time (there are a limited number), I don't know whether it's possible to bring them up selectively -- I don't even know where/how the files are stored; I've looked at the package contents and don't find them there. I'm talking about the files for Stickies window that appear when Stickies is launched.
    The only other app I've found with a fairly basic window layout is Core Image Fun House.app, which also isn't scriptable -- but maybe I can get a bead on its stored files.
    Or maybe there are other choices . . . ?
    I'd welcome suggestions but in the meantime will just keep playing around with it. This is not the most urgent matter in the world!
    osimp

  • Dynamic include in a custom tag, called from a jsp

    Hello, I would like to be able to dynamically include other jsp's from within a custom tag that I create. is this possible?
    in a jsp page i would just write <%@ include file="file.jsp" %> and all would be ok... but if i do an out.println( "<%@ include file=\"file.jsp\" %>" ); inside a custom tag bean then it doesn't work. it just prints out the command to the page as plain text.
    I do understand why this is happening, but can anyone offer me a way around this problem?
    Thanks in advance,
    Randy

    That's actually the same result as you get with a normal include - The method I suggested is a dynamic include similar to the <jsp:include> tag, not the <%@ include %> tag.
    When you use a dynamic include, the included page is compiled and 'invoked' as serarately, and the result is what gets included, not the actual source. To get the behaviour you want would require an include directive (the <%@ include %> tag) which I don't think has an equivalence you can use inside a custom tag.
    What you can do is pass attributes from the tag class like this:
    pageContext.setAttribute(<name>, <object>, pageContext.REQUEST_SCOPE);
    and then remove them after the include using pageContext.removeAttribute.
    I'm not certain, but this implies that if you declare your variables with a <jsp:usebean> tag with request scope, instead of normal Java variable declarations, you should be able to use them in the page included by the custom tag.
    *** in the jsp ***
    <jsp:useBean id="myVar" scope="request" class="java.lang.String" />
    <% myVar = "Something"; %>
    // Now call the tag which uses the pageContext.include() mehtod.
    *** end ***
    *** in the include ***
    <jsp:useBean id="myVar" scope="request" class="java.lang.String" />
    <%= myVar + " something else" %>
    *** end ***
    Let me know if it works.

  • Error when calling skillbuilder popup in edit-record mode

    Apexers,
    Iam facing another issue with Skillbuilder modal page(for those who have used this plugins). Ive the CREATE part working well the problem is with EDIT part to edit records via the link i applied all the steps and clicking the edit link pops up the page but the issue is for any clicked row the parameter is not being passed and seleceted record doesnt show on the pop up page where could the problem be? though if i set it back to normal link created by the wizard the edit link works well and shows that record on the editable page.
    Apex 4.1.1/oracle 11gR2 ; issue happens in FF & IE
    any help please?
    thanks.

    Gor_Mahia wrote:
    Apexers,
    Iam facing another issue with Skillbuilder modal page(for those who have used this plugins). Ive the CREATE part working well the problem is with EDIT part to edit records via the link i applied all the steps and clicking the edit link pops up the page but the issue is for any clicked row the parameter is not being passed and seleceted record doesnt show on the pop up page where could the problem be? though if i set it back to normal link created by the wizard the edit link works well and shows that record on the editable page.
    Hi,
    How do you define the "URL Location" in the dynamic action "Settings" region when calling the plugin? Is it "Statically Defined"? If yes, please make sure that you are setting the URL to the target page correctly - you need to set the appropriate page items of the target page in the URL definition.
    If the URL is being set properly, make sure that the target page has a page process (before/after header) to load the contents correctly.
    Apex 4.1.1/oracle 11gR2 ; issue happens in FF & IE
    any help please?
    thanks.So, what happens in other browsers - chrome?

  • Cannot get swf file to play in popup window

    The swf file plays fine with the source file (flv) on
    streaming server. see page
    http://www.jobclub.com/testing/healthcare.html
    Open Employment Video Profile in center. All I want to do is to
    have iit play in a popup window.
    But I cannot figure out how to play the swf file in a popup
    window
    <object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0"
    <script type="text/javascript">
    AC_FL_RunContent( 'codebase','
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','wid th','285','height','231','title','HealthSouth','src','eva/evaemp/HC240','quality','high',' pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=Shockwa veFlash','movie','eva/evaemp/HC240'
    ); //end AC code
    </script><noscript><object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0"
    width="285" height="231" title="HealthSouth">
    <param name="movie" value="eva/evaemp/HC240.swf" />
    <param name="quality" value="high" />
    <embed src="eva/evaemp/HC240.swf" quality="high"
    pluginspage="
    http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"
    type="application/x-shockwave-flash" width="285"
    height="231"></embed>
    </object>
    </noscript>
    Thanks
    Mat Media

    When you create the file in Flash, it is usually best to also have it publish an html page.  Copy the embedding code that Flash creates in the html file and paste it into your intended html file.  The Flash code may also be reliant on including a .js file, which it will also create, so that needs to be placed in the site folder.  The header of the Flash html may include a script link to this js file, so you need to copy/paste that in the intended html page as well.

  • Dropdown getting deleted , when called in popup

    Hi All,
    When i press a button on my main view i call a popup view.
    In the popup view i need to add dropdowns on "Add dropdown Button"
    When i press the button once the  dropdown is created.
    When i press the button for second time the second dropdown doesnt gets created.
    In debugging i can just see that the navigation goes to onaction of the add button and then modify view.
    and then nothing happens.
    Can some one please help me with this?
    Edited by: Bhanu  Malik on Mar 21, 2011 4:02 AM
    Edited by: Bhanu  Malik on Mar 21, 2011 5:55 AM

    On Add dropdown
    lo_nd_cn_rulehead_edit2->bind_table( new_items = lt_cn_rulehead_edit2 set_initial_elements = abap_true ).
       cl_wd_dropdown_by_idx=>new_dropdown_by_idx(
      EXPORTING
         bind_texts   = 'CN_RULEHEAD_EDIT2.CA_RULEHEAD_EDIT2'
          id          = 'EDIT_DROP2'
           RECEIVING
          control    = lr_input1 ).
    when i press the button again (this dropdown doesnt gets created)
       cl_wd_dropdown_by_idx=>new_dropdown_by_idx(
      EXPORTING
         bind_texts  = 'CN_RULEHEAD_EDIT3.CA_RULEHEAD_EDIT3'
          id          = 'EDIT_DROP3'
           RECEIVING
          control    = lr_input2 ).
        lr_matrix = cl_wd_matrix_head_data=>new_matrix_head_data( lr_input2 ).
       lr_input2->set_layout_data( lr_matrix ).
        wd_comp_controller->lr_container->add_child(
            the_child = lr_input2
    I think there is some other problem of modify view because when first dropdown is created it works fine
    and when second dropdown is created it gives problem

  • "unsupported image file" when importing RAW images from Olympus E-PL1

    When I try to import images save in RAW format on the camera, the images import but they can't be displayed (all I get is a warning triangle with the words "unsupported image format" below it, though in the import preview the images are displayed properly.
    EDIT: just noticed that the E-PL1 isn't listed as being supported, just the E-P1 & 2
    Message was edited by: drathquark

    Apple have just included RAW support for the Olympus E-PL1 with the Digital Camera Raw Compatibility Update 3.3 - iPhoto can now import RAW files from the E-PL1.

  • Keynote creates separate audio and image file when exporting to quicktime, how can you create one unique file?

    I have a Kenote 09 presentation with a presentation soundtrack, when I export it to Quicktime two files are created one with audio and one with video.
    ¿Is there a way to have this be just one file or to combine this files to have one video+audio file?
    I was able to put them together with iMovie, but the image looses quality.
    Thanks

    Thanks Gary
    I tried fixed timing but I needed different timing for each slide. But I did manage to resolve using the following.
    Since the audio was just music I first set both Input and Output sound setting in preferences to use Soundflower instead of internal mic and speaker, then played the presentation while recording audio so that the music would be recorded. And finally exported using Recorded Timing. This way the output was one unique file!
    Good day

Maybe you are looking for

  • Voice memos won't record

    Aside from my issues with my 4S not playing videos - I can't seem to record Voice memos either.  I hit the red record button, it beeps for like a second then stops.  Siri works fine, I've no issues with making calls so it's not a mic problem - help m

  • Absence quota should not get generate in Time Evaluation

    Hi All, For some employees we lock the payroll. But whenever we run the time evaluation every month employees  who are under lock payroll their absence quota is getting generated every month. It should not happen.. Please provide solution for this...

  • Photoshop Elements 6.0 startet nicht mehr

    Hallo ich habe die Vollversion unter Vista laufen. Die lief bisher immer ganz prima. Jetzt bekomme ich beim starten die Fehlermeldung "Adobe Photoshop Elements 6.0 (Organizer) funktioniert nicht mehr Es wird nach eine Lösung des Problems gesucht" KAn

  • Is there a "pro" version of QuickTime Player 10?

    I'm still using QuickTime Player 7 Pro. Is there a "pro" version of QuickTime Player 10?

  • How to use Vision Box as PVR

    How do I use my Vision Box on another tv to view recordings without being connected to BT? When I power up it tries to search for a connection and goes no further.