How to refresh an Image component

Hi,
jdev 1.1.1.5
I have a parent page with a table to show employees and a tab to show detail of employees
Detail is in a Region and is sharing the same datacontrol with parent page and i don´t have any parameter in task flow.
Sincronization Parent - Detail works fine using Partialtriggers.
Detail Region has a button for upload an image and another button to process the image and an Image component(by servlet) to show it.
Process button call an operation exposed in AM, This method do Insert or Update in IMAGE TABLE.
The problem is than image is not refreshed until i do full refresh the page.(but only occurs when updating the image, for insert the Image component show the new image)
I tried this code at end of process button logic but i can't achieve refresh the image.
  public void saveFileUploaded() {
      oper =
          bindings.getOperationBinding("myMethodInAM");
       Map args = operaImatge.getParamsMap();
       args.put("empId", empId);
       args.put("imatgeBlob", createBlobDomain(file));
      oper.execute();
// try refresh entire region method 1
       AdfFacesContext.getCurrentInstance().addPartialTarget(JSFUtils.findComponentInRoot("r1"));
   // try refresh image component
       AdfFacesContext.getCurrentInstance().addPartialTarget(JSFUtils.findComponentInRoot("imageEmp"));
  //  try refresh region method 2    
       RichRegion region = (RichRegion)JSFUtils.findComponentInRoot("r1");
       region.refresh(JSFUtils.getFacesContext());
  }Any suggestion?
Thanks in advance
Edited by: DV on 03-sep-2011 17:36
Edited by: DV on 04-sep-2011 11:33

Hi,
I have updated the use case at first message.
you wrote
you have a binding to the component that is holding the image.. and then refresh the container region..
that would refresh the image inside.
can you give two cents?
i just created a binding for image component but
what must i do?
Remember
the button for process image (operation exposed in my AM service) and Image component(by servlet) are in the same .jsff.
Means the changes occurs in same jsff without interaction with parent page.
Thanks,
Edited by: DV on 04-sep-2011 11:43

Similar Messages

  • How to refresh an image's source value

    I have an image component in a page fragment. When the page opens the image's source is set to the URI for a gif
    What I want is to be able to update the URI to another image once a managed bean's property value changes.
    The image component is bound to a managed bean property, pageAnimationImage.
    I'm new to ADF and tried to set the partial trigger when the property value is set and also set the image's clientComponent to true
    AdfFacesContext.getCurrentInstance().addPartialTarget(pageAnimationImage);
    I searched this forum and other blogs but couldn't find anything related.
    I'd really appreciate it if someone has a suggestion or point me to a related case.
    tia

    You can try to bind the component to broader scope e.g. pageFlowScope or applicationScope and see if this works.
    One other thing to try is to search for the component via its id
    // find a jsf component   
    private UIComponent getUIComponent(String name) {
    FacesContext facesCtx = FacesContext.getCurrentInstance();
    return facesCtx.getViewRoot().findComponent(name) ;
    }The method should find the component by its id. If you find it this way use the returned component to set the ppr on it with
    // PPR refresh a jsf component
    UIComponent image = getUIComponent("MyImageID");
    if (image != null)
        AdfFacesContext.getCurrentInstance().addPartialTarget(UIComponent);Timo

  • How to refresh image component JSP?

    hi i am using Netbeans 6.01 and developing a web project.
    I need to do some manipulation on an image according to input and save the image at address in the project/build/resources/image with the same name when user press a button but sometimes page refreshes the image and sometimes it does not refresh.I don't know what to do
    thank you for your interesting and help if u need more details about the problem please just ask me.

    I have just discovered something this is not about the code that i wrote
    double x=0;
    while(x<=1000000000)
    x++;
    super.init();
    init();
    i delete this code when i reload page once after that all of my requests works properly.I mean when i press reload button of the browser once then page works and image is resfreshes.
    Now i can solve the issue if anybody can tell me how to reload a page when i press a button
    i don't wanna use the javascript onclick() window.location.reload().
    Edited by: maniacneron on Dec 24, 2008 2:34 PM

  • How can  i set a image dinamically in a image component (ADF Mobile)?

    Hello everybody,
    I have to consume a rest service and get a url. This url is redirected to one image. After reading this image, how can i set he in a adf mobile image component?

    Hi,
    bind the mobile image component URL to a managed bean and have the managed bean. Then use the bean setter to set a new URL string and ensure (when creating the Java class for the managed bean) you have JDeveloper creating the property change event handlers.
    Frank

  • How to include multiple image components into a single custom component???

    How to include multiple image components into a single custom component???

    Hi Marcel,
    an ABAP transaction can only run or at least be started on one single system. A portal transaction can be assigned using a URL. This doesn't need any logical component.
    Regards
    Andreas

  • Setting source property of Trinidad image component using java script

    Hi,
    Can anyone tell me how to set the source property of Trinidad Image component using javascript.
    i tried document.getElementById("f1:img").source="/images/neha.gif".
    But its not working
    Thanks
    Neha

    Hi,
    Bases on the solution you suggested, i tried the img component to change the image on OnMouseOver and OnMouseOut. Its working fine in a normal browser but doesnt work in Mobile browser. May be because mobile browser supports only trinidad components. I then tried the option of backing bean
    " Or you can expose the component to a backing bean by setting its "binding" attribute. JDeveloper can create a backing bean from the wizard if you don't already have one. This will get you a CoreImage object in the bean, and you can change the source with its setSource method."
    . So i bound the omMouseOver event of the trinidad image component to a backing bean. Inside that i am changing the source and refreshing the component.
    <tr:commandLink id="cl1" action="goAlerts" styleClass="listingLink2">
    <tr:image source="/images/alert.gif" id="i4"
    binding="#{Images.alertOnMouseOver}"
    onmouseover="#{Images.alertOnMouseOver}"/>
    </tr:commandLink>
    Images.java
    public void setAlertOnMouseOver(CoreImage alertOnMouseOver) {
    this.alertOnMouseOver = alertOnMouseOver;
    alertOnMouseOver.setSource("/images/alertSelect.gif");
    RequestContext context = RequestContext.getCurrentInstance();
    context.addPartialTarget(alertOnMouseOver);
    System.out.print("Test");
    So what i found is setAlertOnMouseOver is getting called but not MouseOver event but when the page is loaded. Can you please tell me where i am going wrong?

  • How to refresh the client area

    i used javax.swing.JPanel and drawed many shapes with paintComponent method. i wonder how to refresh the client area.
    ps: i first used paint method to draw shapes, but i found a copy of the menu bar appeared. at last i found paintComponent method works, but when i tried to refresh the client area with repaint, the same scene appears.
    could some one help me?
    thanks in advance!

    when i tried to refresh the client area with repaint, the same scene appears. When you invoke repaint() on a component, the paintComponent() method of that component is invoked. So unless your code in that method is different, the image painted will be the same.

  • How can I draw image in a vbean?

    How can I draw image in a vbean?
    this is my code :
    import java.awt.BorderLayout;
    import java.awt.Image;
    import java.awt.Graphics;
    import java.net.MalformedURLException;
    import java.net.URL;
    import com.sun.jimi.core.Jimi;
    import oracle.forms.handler.IHandler;
    import oracle.forms.properties.ID;
    import oracle.forms.ui.VBean;
    public class PrintEmailLogo extends VBean {
         URL url;
         Image img;
         boolean ImageLoaded = false;
         public void paint(Graphics g) {
              if (ImageLoaded) {
                   System.out.println("yes~~~");
                   g.drawImage(img, 0, 0, null);
              } else
                   System.out.println("no~~~");
         public boolean imageUpdate(Image img, int infoflags, int x, int y, int w,
                   int h) {
              if (infoflags == ALLBITS) {
                   System.out.println("yes");
                   ImageLoaded = true;
                   repaint();
                   return false;
              } else
                   return true;
         public void init(IHandler arg0) {
              super.init(arg0);
              try {
                   url = new URL("file:print/77G.gif");
                   img = Jimi.getImage(url);
                   Image offScreenImage = createImage(size().width, size().height);
                   Graphics offScreenGC = offScreenImage.getGraphics();
                   System.out.println(offScreenGC.drawImage(img, 0, 0, this));
              } catch (MalformedURLException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    but when I run it in forms
    when it run Graphics offScreenGC = offScreenImage.getGraphics();
    It throw a exception:
    java.lang.NullPointerException     at com.avicit.aepcs.calendar.PrintEmailLogo.init(PrintEmailLogo.java:72)     at oracle.forms.handler.UICommon.instantiate(Unknown Source)     at oracle.forms.handler.UICommon.onCreate(Unknown Source)     at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)     at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)     at oracle.forms.engine.Runform.processMessage(Unknown Source)     at oracle.forms.engine.Runform.processSet(Unknown Source)     at oracle.forms.engine.Runform.onMessageReal(Unknown Source)     at oracle.forms.engine.Runform.onMessage(Unknown Source)     at oracle.forms.engine.Runform.processEventEnd(Unknown Source)     at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)     at oracle.ewt.lwAWT.LWComponent.processEvent(Unknown Source)     at java.awt.Component.dispatchEventImpl(Unknown Source)     at java.awt.Container.dispatchEventImpl(Unknown Source)     at java.awt.Component.dispatchEvent(Unknown Source)     at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)     at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)     at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)     at java.awt.Container.dispatchEventImpl(Unknown Source)     at java.awt.Component.dispatchEvent(Unknown Source)     at java.awt.EventQueue.dispatchEvent(Unknown Source)     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)     at java.awt.EventDispatchThread.run(Unknown Source)
    I change it to:
    import java.awt.BorderLayout;
    import java.awt.Image;
    import java.awt.Graphics;
    import java.net.MalformedURLException;
    import java.net.URL;
    import javax.swing.JFrame;
    import com.sun.jimi.core.Jimi;
    import oracle.forms.handler.IHandler;
    import oracle.forms.properties.ID;
    import oracle.forms.ui.VBean;
    public class PrintEmailLogo extends VBean {
         URL url;
         Image img;
         public void paint(Graphics g) {
              try {
                   url = new URL("file:print/77G.gif");
                   img = Jimi.getImage(url);
                   g.drawImage(img, 0, 0, this));
              } catch (MalformedURLException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
         public void init(IHandler arg0) {
              super.init(arg0);
    But it display nothing.
    It isn't paint continuous.
    what's wrong in my vbean?
    please help me.

    The following code works fine for me:
    package oracle.forms.fd;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import oracle.forms.handler.IHandler;
    import oracle.forms.properties.ID;
    import oracle.forms.ui.CustomEvent;
    import oracle.forms.ui.VBean;
    public class test extends VBean {
      private URL url;
      private URL m_codeBase; 
      private Image img;
    public void paint(Graphics g) {
      // draw the image
      g.drawImage(img, 0, 0, this);
    public void init(IHandler arg0) {
       super.init(arg0);
       // load image file
       img = loadImage("file:///c:/coyote.jpg");   
    public test()
        super();
       *  Load an image from JAR file, Client machine or Internet URL  *
      private Image loadImage(String imageName)
        URL imageURL = null;
        boolean loadSuccess = false;
        Image img = null ;
        //JAR
        imageURL = getClass().getResource(imageName);
        if (imageURL != null)
          try
            img = Toolkit.getDefaultToolkit().getImage(imageURL);
            loadSuccess = true;
            return img ;
          catch (Exception ilex)
            System.out.println("Error loading image from JAR: " + ilex.toString());
        else
          System.out.println("Unable to find " + imageName + " in JAR");
        //DOCBASE
        if (loadSuccess == false)
          System.out.println("Searching docbase for " + imageName);
          try
            if (imageName.toLowerCase().startsWith("http://")||imageName.toLowerCase().startsWith("https://"))
              imageURL = new URL(imageName);
            else if(imageName.toLowerCase().startsWith("file:"))
              imageURL = new URL(imageName);
            else
              imageURL = new URL(m_codeBase.getProtocol() + "://" + m_codeBase.getHost() + ":" + m_codeBase.getPort() + imageName);
            System.out.println("Constructed URL: " + imageURL.toString());
            try
              img = createImage((java.awt.image.ImageProducer) imageURL.getContent());
              loadSuccess = true;
              System.out.println("Image found: " + imageURL.toString());
              return img ;
            catch (Exception ilex)
              System.out.println("Error reading image - " + ilex.toString());
          catch (java.net.MalformedURLException urlex)
            System.out.println("Error creating URL - " + urlex.toString());
        //CODEBASE
        if (loadSuccess == false)
          System.out.println("Searching codebase for " + imageName);
          try
            imageURL = new URL(m_codeBase, imageName);
            System.out.println("Constructed URL: " + imageURL.toString());
            try
              img = createImage((java.awt.image.ImageProducer) imageURL.getContent());
              loadSuccess = true;
              System.out.println("Image found: " + imageURL.toString());
              return img ;
            catch (Exception ilex)
                    System.out.println("Error reading image - " + ilex.toString());
          catch (java.net.MalformedURLException urlex)
            System.out.println("Error creating URL - " + urlex.toString());
        if (loadSuccess == false)
          System.out.println("Error image " + imageName + " could not be located");
        return img ;
    }Francois

  • How to embed an image in swf at run time?

    Hi all,
    I have created an Image component in flash which is having a "imageSource" paramter, where in a user can provide the path of his/her image(both from web or from  harddisk). I want that image to be compiled with the swf. how can i do that?......any help will be greatly appreciated
    Thanks,
    Roopesh

    Hi kglad,
    Thanks alot for your quick reply.
    well I have created such a custome component, which user can drag on stage and configure accordingly. If a user provides the path of a image which is on server, things works fine as when i deploy my swf to server it fetches the image properly but if a user provides the path of a image which is present locally on hardisk, image is not loaded when the swf is deployed to server as the path provided is local . So i am searching for a solution for resolving this path conflict issue in desgin and deployment phase. one probable solution is, if the images gets embedded with swf but embedding is not possible at run time. Do you have any other solution for this?

  • How to change the image of a selected File/Directory in JFileChooser while

    Hi all,
    I am trying to customize JFileChooser. Basically, I want to display a checked Icon for a selected directory(s) in JFileChooser
    I know that fileView class returns icon for directory/files, but I am not sure how to change their images on selection.
    your help is appreciated.
    Ramesh

    could you please anyone help me with this. I search all the web but I was not successful to find anything that would help me to create a custom renderer for JList component inside JFileChooser..
    if you can give me some reference websites that would be great.
    Ramesh

  • How do I store images in a jar file to be displayed on a jsp?

    Afternoon all,
    I have created a java component which accepts some parameters and returns a string. The returned string contains html tags to display a table in a webpage when rendered through a browser.
    I want to be able to add this component to any java web project to display my table. The problem is that I want to use images in my table to give the appearance of curved corners.
    How do I store images in my component and render to a webpage?
    Thanks in advance,
    Alex

    You won't be able to make the install of this library as simple as the installation of a jar file. You can't access the images directly in the jar.
    There are a few approaches you can take:
    1 - jar file + resources:
    Have the install as being a jar and a "resources" directory which you store all the images in. Thus the images become part of the web application/web site and are accessible. Probably need to allow an entry in web.xml to configure where/what this directory is called.
    2 - jar file only:
    Provide a servlet to access the images, which will load them from the jar file, using the ClassLoader.getResourceAsStream(). Requires declaration of a servlet in the web.xml file. Won't be as efficient as having the images on disk, but will keep them bundled in the jar file.
    you would generate code such as <img src="myImgServlet?img=.....">
    Cheers,
    evnafets

  • How to set a Swing component as Modal on a SWT Component?

    How to set a Swing component as Modal on a SWT Componen?.I mean, I have a SWt Component window and from that window I am displaying a SWING Component Modal window.
    The problem is my swing window is not working as Modal always.
    When I opened the swing window from SWT window,swing window is working as Modal.But if Idouble click on Menubar or Title bar of the SWT Window then my Swing window goes back.If I click on any other part of the SWT window.. then once again Swing window is working as modal.
    Can any one suggest me to solve this?
    I think this is isuue related with Swing over SWT..

    pradeep.rajadurai wrote:
    I want set the JTable as a background of jframe or jinternalframe , how it is possible One way that may work, you can always extract the image from a rendered JTable and then paint the same image into the JPanel that holds your components via it's paintComponent method, then added the JPanel to the app's contentPane.
    give me simple pgmIs English your second language? Because if so, please understand that this demand can be taken by some as rude.

  • How to refresh the input text value in backing bean

    hi all
    i want to know
    how to refresh the input text value in backing bean?
    i have tried this code ,but it doesnt work
    public void click(ActionEvent actionEvent) {
    tempConId.setValue("111111111111111");
    AdfFacesContext.getCurrentInstance().addPartialTarget(tempConId);
    sb know?
    Edited by: Joe Zou on 2012-4-6 下午9:11

    The code looks good.
    Here is a sample based on your use-case:
    InputTextSample.jspx:
    <af:form id="f1">
            <af:panelFormLayout id="pfl1">
              <f:facet name="footer">
                <af:commandButton text="Ok" id="cb1" partialSubmit="true"
                                  actionListener="#{InputTextSampleBean.onClick}"/>
              </f:facet>
              <af:inputText label="InputText" id="it1"
                            binding="#{InputTextSampleBean.myInputText}"/>
            </af:panelFormLayout>
          </af:form>
    InputTextSampleBean.java:
    import javax.faces.event.ActionEvent;
    import oracle.adf.view.rich.component.rich.input.RichInputText;
    import oracle.adf.view.rich.context.AdfFacesContext;
    public class InputTextSampleBean {
        private RichInputText myInputText;
        public InputTextSampleBean() {
        public void setMyInputText(RichInputText myInputText) {
            this.myInputText = myInputText;
        public RichInputText getMyInputText() {
            return myInputText;
        public void onClick(ActionEvent actionEvent) {
            this.myInputText.setValue("1234");
            AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
            adfFacesContext.addPartialTarget(this.myInputText);
    }

  • How to store photo images and thumbimpressions in oracle 10g database

    Hi all
    I have an web application running in Oracle 10g rel 1 database server in RHEL3. It has application server with forms and j2ee component as middle tier. I need to store centrally photo images and thumb impressions and use it in our application without any overhead on retrieval and performance of web application. what will be optimized method of storage of photo and thumb impressions. Awaiting your valuable suggestions.
    Regards
    Vijay Kumar

    Hi Vijay,
    How to store photo images and thumbimpressions in oracle 10g database I have working code here for storing photos in Oracle tables that you may find useful:
    http://www.dba-oracle.com/t_storing_insert_photo_pictures_tables.htm
    Hope this helps . . .
    Donald K. Burleson
    Oracle Press author
    Author of "Oracle Tuning: The Definitive Reference"
    http://www.rampant-books.com/book_2005_1_awr_proactive_tuning.htm

  • How to store the images in KM using Code

    Hello,
    i retreived the images from KM using the following code.
    import com.sapportals.portal.prt.component.AbstractPortalComponent;
    import com.sapportals.portal.prt.component.IPortalComponentRequest;
    import com.sapportals.portal.prt.component.IPortalComponentResponse;
    import com.sapportals.portal.prt.resource.IResource;
    public class ThumbnailTes extends AbstractPortalComponent {
         /* (non-Javadoc)
    @see com.sapportals.portal.prt.component.AbstractPortalComponent#doContent(com.sapportals.portal.prt.component.IPortalComponentRequest, com.sapportals.portal.prt.component.IPortalComponentResponse)
         public void doContent(IPortalComponentRequest request,IPortalComponentResponse response) {
    String path =request.getResource(IResource.IMAGE,"images/sap1.gif").getResourceInformation().getURL(request);
                   response.write("<img src = "path"/>");
    but i want to store the images in KM using code.Can anybody help me.
    acutally the image is my location(c:/images/sap1/jpg).i want to upload this image to KM using code.
    Can anybody help me how to do that?

    Hi Kasturi,
    > not accepting the points
    It worked on this and on one other thread, but this is still open: How to upload the image
    > want upload the images from the client side machine
    > to KM
    In the thread I just referred to, I already provided information about the HTMLB upload control. With this at hand, you'll get the file from the client to the server.
    At server side, get an ICollection instance where you want to store the file and create the corresponding resource. See https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/javadocs/nw04/sp12/knowledge management/com/sapportals/wcm/repository/icollection.html#createresource(java.lang.String,%20com.sapportals.wcm.repository.IPropertyMap,%20com.sapportals.wcm.util.content.IContent)
    Hope it helps
    Detlev

Maybe you are looking for

  • Options icon

    i noticed i was being charged 17p for sms delivery receipt so i have tried to turn this off on my blackberry curve. i was told to go onto the options icon and click on sms text but when i go onto the options icon nothing to do with sms comes up! how

  • Connexion to itunes

    Hi, I can't connect my ippod nano anymore to iTunes. When I connect to my computer, I see the Nano getting power but cannot see it in iTunes. I can't see it on myComputer neither. Can u help ?

  • Photos blurry on iPhoto album

    My iPhoto book has a bunch of pictures that printed out blurry. It looks as though the colour channels have split. The original pictures are not out of focus and were shot with at least a 5 MP camera (1248px x 936px and up). The scanned film shots we

  • Xsan 2 Licence and 1.42

    Will a Xsan 2 license number work with a 1.42 client? If not how do I add a Tiger client? Thanks Ma

  • How to I get rid of virus's on my mac book pro?

    is there any way to get rid of virus's on my macbook pro without making an appointment with apple?