Getting DPI of a JPEG with JAI

I need to get width / height in cm or inches and the DPI of a JPEG using JAI.
I'm currently getting the width and height in pixels using getWidth() and getHeight() of a RenderOp, but it apparently hasn't similar methods to get the DPI (which will suffice).
I'm still seeking into all of the JAI classes, but i'm kind of lost within it.

The reason why i want to try to do it with JAI is the following.
We have a huge collection of JPEG images, that our customer creates daily.
To retrieve image size and resolution, i initially had used a public domain class, whose source is identified by this header:
* ImageInfo.java
* Version 1.5
* A Java class to determine image width, height and color depth for
* a number of image file formats.
* Written by Marco Schmidt
* <http://www.geocities.com/marcoschmidt.geo/contact.html>.
* Contributed to the Public Domain.
* Last modification 2004-02-29
*/It worked fine, but we discovered that it fails with JPEG our customer created before a certain date.
Then i tried with javax.imageio.ImageIO, like this:
Iterator readers = ImageIO.getImageReadersByFormatName("jpeg");
ImageReader reader = (ImageReader)readers.next();
FileInputStream source = new FileInputStream("my.jpeg");
ImageInputStream iis = ImageIO.createImageInputStream(source);
reader.setInput(iis, true);
IIOMetadata meta = reader.getImageMetadata(0);
IIOMetadataNode nodes = (IIOMetadataNode) meta.getAsTree("javax_imageio_1.0");
NodeList nl = nodes.getElementsByTagName("HorizontalPixelSize");
if ((nl != null) && (nl.getLength() > 0))
    xDPI = Math.round(25.4f / Float.parseFloat(nl.item(0).getAttributes().item(0).getNodeValue()));
nl = nodes.getElementsByTagName("VerticalPixelSize");
if ((nl != null) && (nl.getLength() > 0))
    yDPI = Math.round(25.4f / Float.parseFloat(nl.item(0).getAttributes().item(0).getNodeValue()));Same identical problem. The new JPEGs work, the old ones don't.
In this case, javax.imageio.ImageIO throws an exception saying:
javax.imageio.IIOException: Not a JPEG file: starts with 0x55 0x72Quite explicit. The problem is that these JPEGs are correctly rendered, without a bit of complaining, by all the browsers, by all the imaging programs we tried (Adobe Photoshop, Adobe ImageReady, Paint, whatever) and also by the preview feature of Windows Explorer. We never found a single application which complains about these JPEGs. Also the size and resolution are correctly retrieved by these imaging programs.
If javax.imageio.ImageIO says it's a bad JPEG, it's a bad JPEG; however i'd need to make the whole thing work because of the above reason. That's why i'd like to try with JAI too.

Similar Messages

  • Open Tiff, rotate, resize and save as JPEG (using JAI)

    I 'm having a hard time getting my arms around the JAI classes to perform
    this transform. I've looked at the tutorial and api, etc and did not get
    very far.
    I have the code to open the TIFF, and save as a JPEG. My question is how to
    go from there to do the manipulations (rotate, resize)?
    If anyone knows how to do this with JAI classes, please let me know.
    Thanks,
    Bill Pfeiffer
    My code:
    try
    SeekableStream input = new FileSeekableStream("C:\\S1000000.TIF");
    FileOutputStream output = new FileOutputStream
    ("C:\\S1000000.jpg");
    TIFFDecodeParam TIFFparam = new TIFFDecodeParam();
    ImageDecoder decoder = ImageCodec.createImageDecoder("tiff",
    input ,TIFFparam);
    JPEGEncodeParam JPEGparam = new
    JPEGEncodeParam();
    ImageEncoder encoder = ImageCodec.createImageEncoder
    ("jpeg",output,JPEGparam);
    RenderedImage ri = decoder.decodeAsRenderedImage();
    encoder.encode(ri);
    input.close();
    output.close();
    catch (IOException e)
    e.printStackTrace();

    For Rotation....
    1) add the following function to your code.
    private RenderedImage rotate(int degrees, RenderedImage src, Interpolation interpRotate) {          
                             try {               
                                       float radians = (float)(degrees * (Math.PI/180.0F));
                                       ParameterBlock pb = new ParameterBlock();
                                       pb.addSource(src);
                                       pb.add(0.0F);
                                       pb.add(0.0F);
                                       pb.add(radians);
                                       pb.add(interpRotate);
                                       src = (RenderedImage)JAI.create("rotate", pb, null);
                                       pb = new ParameterBlock();
                                       pb.addSource(src);
                                       pb.add((float)-(src.getMinX()));
                                       pb.add((float)-(src.getMinY()));
                                       pb.add(interpRotate);
                                       return (RenderedImage)JAI.create("translate", pb, null);
                             }catch (Exception e) {               
                                       return src;
    2. call this function before the "encoder.encode(ri);" line in your code. I pass "new InterpolationBilinear()" for the interpolation parameter of the function.
    For scaling...
    1) add the following lines to your code after or before you rotate the image.
    ParameterBlock pb = new ParameterBlock();
    pb.addSource(ri);
    pb.add(1.1F); //play with these 4 lines to make the image bigger or smaller (1.0F is actual size)
    pb.add(1.1F);
    pb.add(0.0F);               
    pb.add(0.0F);               
    pb.add(new InterpolationNearest() );
    t = (RenderedImage) JAI.create("scale",pb,null);
    hope this helps. Just play with it a bit. You'll get it.

  • Loading large JPEGs usinga JAI

    I am loading images using JAI. I first load the image into a RenderedOp class and I then get the bounds of that RenderedOp before I put it into the DB. I am monitoring the tile caching using the TCTool. I am able to load large TIFF files (128 MB) no problem. However, when I try to load a large(ish) JPEG fi[le (25MB) I get a "Occurs in: javax.media.jai.ThreadSafeOperationRegistry
    java.lang.reflect.InvocationTargetException: java.lang.OutOfMemoryError" error or a "java.lang.RuntimeException: Waiting thread received a null tile." if the TCTool (tile cache monitoring tool) is turned on. This error occurs when I attempt to get the bounds of the RenderedOp object. Is there a known bug with loading JPEG images using JAI? Small JPEG images load no problem. Is this a problem with the tile cache and does anyone know how I get around it?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

    How does getting the bounds of the image help? Well I can get it to render large tiff files easily (80mb). But I can't get it to render out 20mb jpeg. I haven't tried tiling the image yet, but I'm working on that code as we speek. That's the only thing I can think of that would render tiff's and not jpeg's.
    The size of the jpegs are about 3072p x 2048p. Any ideas?
    Thanks for your input.

  • "Save image" button of Camera Raw does not save JPEG with modifications made.

    I am using Bridge CC to process my RAW images and make modifications to some JPEG images as well.  I have no need to further alter images in Photoshop at the moment, so I do all modifications in Camera Raw. After altering my images, I then press the "save image" button at the left bottom corner of Camera Raw and choose the settings to save in JPEG.  However, when I upload these JPEG images to a website or when I email them, the image is uploaded without the modifications I had done!  It seems to me that Camera Raw is saving JPEGs the same way it does for RAW images, in a non-destructive manner, only attaching instructions for the images to be displayed properly on Photoshop. But when I save an image in JPEG, I expect the image to be saved entirely with the modifications I made while still keeping the original RAW file.  What goes on then?  What is Camera Raw doing and how do I get to save a modified image in JPEG with Camera Raw?  Would you please explain?
    Many thanks for your help,
    Beza

    Hi,
    What version of camera raw and operating system are you using?

  • When round tripping with photoshop cc, i get a saved psd file with my original raw,the problem is these are high file sizes and taking a lot of space,can i stop this?

    when round tripping with photoshop cc, i get a saved psd file with my original raw,the problem is these are high file sizes and taking a lot of space,can i stop this?

    That's not the workflow that I use. I have my Lightroom preferences set to create TIF images when going to Photoshop. I keep the original raw file and the TIF image (usually reduced to an 8-bit image) and only export JPEG's when they are needed to send to a lab or to send to someone over the Internet. JPEG files are highly compressed. I only create them when they are needed, and they are discarded as soon as they have been used for their intended purpose. I keep the raw file and the Photoshop-created TIF in my library. This requires extra disk space. But I always have the highest quality files available.

  • Editing JPEGs with the RAW interface

    I discovered a way to edit JPEG images using the RAW interface. I go to File > Open As... instead of File Open.., change the format in the lower window to "Camera RAW" and click open.
    I am fully aware of the benefits of shooting in RAW as compared to JPEG and I'm not approaching this with the expectation that I'll get better results editing JPEGs using this approach. What I am addressing is the fact that the tools in the RAW interface are more consolidated and faster to use then going through a typical workflow using Levels - Hue/Saturation - Shadows/Highlights etc.
    The other benefit seems to me is you can use the same RAW controls numerous times while editing, while you're only suppost to use Levels Hue/Saturation controls once so as to minimize the impact these tools have on image degradation.
    Am I on to something here or out in left field?
    Opinions please...
    Deep Woods

    Does two minor changes not equal one major change? I'm not sure. This also begs the question... at what point in using Levels, contrast or saturation tools does editing change from minor to major? Maybe I'm splitting hairs, but I don't believe everyone out there would agree at what point this is defined.
    True, major and minor is subjective, but I can see how you adjust the black point in levels, and then you come back into the photo later and decide to slide it a little more, I don't have any particular qualms about doing this, and I don't think anyone can look at the resulting image and say -- see, right there, quality degradation because you used levels twice.
    The place where levels is most dangerous is when you either do ridiculous things, like move the sliders almost all the way to the middle, and then move them back almost all the way to the edges; or when you are getting posterization (which can happen from even a single use of levels).
    Many publications I came across over the years indicate single adjustments only when using these tools on JPEGs, unless of course one is using Adjustment Layers.
    Never read that. Can you please provide a reference?
    This is why I was hoping for lots of feedback like yours on the issue of using the RAW interface to edit JPEGs. I've received very little feedback on this issue which tells me it is a little known option to users of Photoshop. It is so much easier to edit a JPEG using the RAW interface, rather than go through the conventional workflow with the other tools in Photoshop. So far no one has given me reason to think otherwise.
    Yes, I agree editing JPGs in the raw interface has a number of advantages, ease of use being one of them. Non-destructive editing is another advantage. My guess as to why so few people use this tool is that: 1) PSE is a very overwhelming program, and once you learn the traditional way to do things (which is what you get from most books and tutorials), you don't want to bother learning another way to edit your photos; and 2) RAW scares many people.

  • How can we get Dynamic columns and data with RTF Templates in BI Publisher

    How can we get Dynamic columns and data with RTf Templates.
    My requirement is :
    create table xxinv_item_pei_taginfo(item_id number,
    Organization_id number,
    item varchar2(4000),
    record_type varchar2(4000),
    record_value CLOB,
    State varchar2(4000));
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'USES','fever','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'HOW TO USE','one tablet daily','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'SIDE EFFECTS','XYZ','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'DRUG INTERACTION','ABC','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'OVERDOSE','Go and see doctor','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'NOTES','Take after meal','TX');
    select * from xxinv_item_pei_taginfo;
    Item id Org Id Item Record_type Record_value State
    493991     224     1265-D30     USES     fever     TX
    493991     224     1265-D30     HOW TO USE     one tablet daily     TX
    493991     224     1265-D30     SIDE EFFECTS     XYZ     TX
    493991     224     1265-D30     DRUG INTERACTION     ABC     TX
    493991     224     1265-D30     OVERDOSE      Go and see doctor     TX
    493991     224     1265-D30     NOTES     Take after meal     TX
    Above is my data
    I have to fetch the record_type from a lookup where I can have any of the record type, sometime USES, HOW TO USE, SIDE EFFECTS and sometimes some other set of record types
    In my report I have to get these record typpes as field name dynamically whichever is available in that lookup and record values against them.
    its a BI Publisher report.
    please suggest

    if you have data in db then you can create xml with needed structure
    and so you can create bip report
    do you have errors or .... ?

  • If I click on an e-mail address link in a web page instead of a blank message opening I always get a pop up screen with a log-in for googlemail. I do not have and do not want a googlemail account. I just want to be able to send e-mails using Outlook.

    If I click on an e-mail address link in a web page instead of a blank message opening I always get a pop up screen with a log-in for googlemail. I do not have and do not want a googlemail account. I just want to be able to send e-mails using Outlook.

    OUtlook was already set as the mail client for FF, and is my operating system (XP)'s default mail programme. therefore problem not solved at all. what I get whenever I follow a link in a webpage to send an e-mail is a little pop up window asking me to sign in to gmail or open an account. any other suggestions?

  • Update to kichat: FAQ 3 - How do I get Video and Audio Chats with PCs ?

    kichat: FAQ 3 - How do I get Video and Audio Chats with PCs ?
    (To Replace http://discussions.apple.com/thread.jspa?threadID=406147 if Accepted. )
    How do I get Video and Audio Chats with PCs ? iChat FAQ 3 (Updated 7/12/2008)
    Applies to iChat 2.x, iChat 3.x and iChat 4.x to any version of AIM on a PC before AIM 6.1
    This piece is designed for those trying to connect Mac to PC for Video and Audio chats. Any iChat version Panther and up.
    Glossary For This FAQ
    This bit is designed for clarity.
    Video is the sending and /or recieving of pictures and sound.
    Audio is the sending and or receiving of sound only.
    One-Way is the ablity to start either an Audio or Video chat from one end to a receipient who can not match your capabilities (or Vice Versa)
    What is needed
    At the Mac end
    A Mac running OS 10.3.x and iChat AV ver 2.1 or 10.4 plus iChat 3 or Leopard and iChat 4
    A DSL/Cable/Fibre (Broadband) connection of at least an up link speed of 256kbs.
    An AIM , @mac.com or MobileMe (@me.com) account name.
    (hosting Multiple person Mac to Mac AV chats requires higher specs and broadband uplink speed).
    At the PC end
    1 PC running windows XP (home or Pro). THIS A MUST
    The AIM Standalone Application, currently at ver. 5.9 at this link. AIM (the Site) now call this version Classic and it cannot be Installed On Vista
    Note: there is also Trillian which has a Pro version for $25 that can also Video and Audio chat. The Basic version just Texts and Audio Chats (AIM does not Audio chat)
    Some need the aimrtc12.exe file from Here Mostly Earlier than XP or Pre Service Pack 2 XP versions of Windows
    Note: It has been noted that this file is now apparently included in Windows XP after Service Pack 2 and above.
    An AIM account/screen name (AOL or Netscape count as well)
    Service Pack 2 info. This info will allow the PC user to enable AIM thorough the XP Firewall. The Windows Firewall did not exist as such before this
    Between both of you.
    At least one camera (Mac end)
    A sound input device (the camera, if it has one is ok)
    Your Buddies screen/account name in each others Buddy Lists
    Other tweaks
    For some people, using AIM on a PC, may also have to make sure their preferences (properties) are set in the AIM Buddy list, for their camera and /or Mic. (Tuning at Message 570)
    This is an icon button lower right on the Buddy List marked "Prefs" (AIM 5.5). This leads to the Preferences. Drop down the list until you read Live Video. Click on this. In the new window that opens click the button that says Tuning Video and Audio. Follow the instructions in the wizard that opens up. Access in AIM 5.9 for this is in the My AIM menu at the top of the Buddy list and then Options
    To Start
    You should now be able to chat to each other.
    If each of you has a camera it can be full Video , as described in the Glossary at the top.
    To start from the Mac end, select (highlight) your Buddy with one click. His camera icon should be dark. Click on the icon near his name or the one at the bottom of the Buddy List. (You do not have to start a text chat).
    To start from the PC end you need to start a text chat, then select the Video icon at the bottom of the chat window.
    If one of you has a camera and the other has a Mic then you will be able to chat One Way but have sound will be both ways.
    To start this type of chat from the Mac end you will have to go to the menu item "Buddies" and drop down to the item "Invite to One Way Video Chat"
    To start this from a PC follow the directions in the pargraph above. You may need to change the tab to the incoming Video at the back of the two to see the Video. These tabs are added when the Video chat starts and the front one normally states you do not have a camera and shows a connection to buy one.
    It is also possible to chat One Way if the other person does not have a Mic: replies will have to be typed in a Text chat.
    No Camera and No Mic will cause iChat to End the chat with "No Data Received for 10 Secs"
    Summary
    For any sort of sound to a PC using AIM, (Talk in PC or Audio in iChat) the Mac will need a camera. The other person can have a Mic and then live chats with sound both ways and Pictures (Video) the other.
    NOTE: At This Time It Is NOT Possible to Audio (sound only) between Mac & PC with AIM & iChat
    Trillian Basic can Audio. Trillian Pro can Video and has a bigger picture and can do Full Screen.
    Another explanation of the set up can be found Here about AIM 5.5 but is transferable.
    And Also here
    My Web Pages particularly all of Page 12: What if your Girlfriend Lives a Long Way Away ? have more information.
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.
    4:24 PM Sunday; December 7, 2008

    kichat: FAQ 3 - How do I get Video and Audio Chats with PCs ?
    (To Replace http://discussions.apple.com/thread.jspa?threadID=406147 if Accepted. )
    How do I get Video and Audio Chats with PCs ? iChat FAQ 3 (Updated 7/12/2008)
    Applies to iChat 2.x, iChat 3.x and iChat 4.x to any version of AIM on a PC before AIM 6.1
    This piece is designed for those trying to connect Mac to PC for Video and Audio chats. Any iChat version Panther and up.
    Glossary For This FAQ
    This bit is designed for clarity.
    Video is the sending and /or recieving of pictures and sound.
    Audio is the sending and or receiving of sound only.
    One-Way is the ablity to start either an Audio or Video chat from one end to a receipient who can not match your capabilities (or Vice Versa)
    What is needed
    At the Mac end
    A Mac running OS 10.3.x and iChat AV ver 2.1 or 10.4 plus iChat 3 or Leopard and iChat 4
    A DSL/Cable/Fibre (Broadband) connection of at least an up link speed of 256kbs.
    An AIM , @mac.com or MobileMe (@me.com) account name.
    (hosting Multiple person Mac to Mac AV chats requires higher specs and broadband uplink speed).
    At the PC end
    1 PC running windows XP (home or Pro). THIS A MUST
    The AIM Standalone Application, currently at ver. 5.9 at this link. AIM (the Site) now call this version Classic and it cannot be Installed On Vista
    Note: there is also Trillian which has a Pro version for $25 that can also Video and Audio chat. The Basic version just Texts and Audio Chats (AIM does not Audio chat)
    Some need the aimrtc12.exe file from Here Mostly Earlier than XP or Pre Service Pack 2 XP versions of Windows
    Note: It has been noted that this file is now just another link to the Standalone application. This might be an error by AIM or a newer version that includes the file.
    An AIM account/screen name (AOL or Netscape count as well)
    Service Pack 2 info. This info will allow the PC user to enable AIM thorough the XP Firewall. The Windows Firewall did not exist as such before this
    Between both of you.
    At least one camera (Mac end)
    A sound input device (the camera, if it has one is ok)
    Your Buddies screen/account name in each others Buddy Lists
    Other tweaks
    For some people, using AIM on a PC, may also have to make sure their preferences (properties) are set in the AIM Buddy list, for their camera and /or Mic. (Tuning at Message 570)
    This is an icon button lower right on the Buddy List marked "Prefs" (AIM 5.5). This leads to the Preferences. Drop down the list until you read Live Video. Click on this. In the new window that opens click the button that says Tuning Video and Audio. Follow the instructions in the wizard that opens up. Access in AIM 5.9 for this is in the My AIM menu at the top of the Buddy list and then Options
    To Start
    You should now be able to chat to each other.
    If each of you has a camera it can be full Video , as described in the Glossary at the top.
    To start from the Mac end, select (highlight) your Buddy with one click. His camera icon should be dark. Click on the icon near his name or the one at the bottom of the Buddy List. (You do not have to start a text chat).
    To start from the PC end you need to start a text chat, then select the Video icon at the bottom of the chat window.
    If one of you has a camera and the other has a Mic then you will be able to chat One Way but have sound will be both ways.
    To start this type of chat from the Mac end you will have to go to the menu item "Buddies" and drop down to the item "Invite to One Way Video Chat"
    To start this from a PC follow the directions in the pargraph above. You may need to change the tab to the incoming Video at the back of the two to see the Video. These tabs are added when the Video chat starts and the front one normally states you do not have a camera and shows a connection to buy one.
    It is also possible to chat One Way if the other person does not have a Mic: replies will have to be typed in a Text chat.
    No Camera and No Mic will cause iChat to End the chat with "No Data Received for 10 Secs"
    Summary
    For any sort of sound to a PC using AIM, (Talk in PC or Audio in iChat) the Mac will need a camera. The other person can have a Mic and then live chats with sound both ways and Pictures (Video) the other.
    NOTE: At This Time It Is NOT Possible to Audio (sound only) between Mac & PC with AIM & iChat
    Trillian Basic can Audio. Trillian Pro can Video and has a bigger picture and can do Full Screen.
    Another explanation of the set up can be found Here about AIM 5.5 but is transferable.
    And Also here
    My Web Pages particularly all of Page 12: What if your Girlfriend Lives a Long Way Away ? have more information.
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.
    9:19 PM Friday; December 12, 2008

  • How do I get my Apple ID affiliated with my institute?

    I work at a University and want to access the new iTunes U course manager (https://itunesu.itunes.apple.com/coursemanager). Does anyone know how I go about getting my apple id affiliated with my institute?
    When I try to log into Course Manager I get an error "iTunes Store Account Required". My apple id is my iTunes Store Account, so I assume it is not affiliated with my institute. My apple id is also my developer account, which is linked to my education institute. So I'm not sure what the issue is.
    Any suggestions will be greatly appreciated
    cheers,
    Andrew

    I've tried every way to log in today, using an Apple ID that is registered with the iTunes Store and is associated with our college's iTunes U site as a contributor, then as one that's associated with the public site administrator. This has failed in various ways throughout the day, like others have described.
    Examining the debug console in Safari is showing that one of the objects from the login page is giving a 404 Not Found response when you try to log in, leading to the "iTunes Store Account Required" error. I believe something must have broken after they launched this site yesterday, and the varying errors throughout the day would seem to indicate that they're trying to fix it right now.
    We'll probably just have to wait until this is repaired.

  • How do I fix a initializing problem with my macbook pro? I only get to the blank screen with the apple logo and the "processing something"sign... it just doesn't start the system....

    How do I fix a initializing problem with my macbook pro? I only get to the blank screen with the apple logo and the "processing something" sign... it just doesn't start the system....
    Please help
    Marcelo

    If there is no loading bar, it's usually a problem with a third party kext file in OS X itself.
    You can press the power button down to force a hardware shutdown, then reboot holding the shift key down on a wired or built in keyboard, this will disable them and you go around and update your third party software.
    Gray, Blue or White screen at boot, w/spinner/progress bar
    Also take this time to backup your users files off the machine if possible.
    Most commonly used backup methods
    Sometime that won't work and you need to do more
    ..Step by Step to fix your Mac

  • How to get my custom controller updated with the global custom controller?

    Hi all,
    I'm new to CRM Web UI and need some advice from the expert. Currently I'm working on component ICCMP_BT_DATES and noticed something weird with this component. When this component is first launch it display the dates of a service ticket correctly. However when I navigate to another screen, save a new ticket and back, the dates are not reflected. When I went in and debug the component, I noticed that the context is still tied to the previous ticket. I think the custom controller is not updated with the latest from the global custom controller.
    My question is how do I get my custom controller updated with the latest.
    Regards,
    Ricky

    You have to bind your custom controllers context node to the event NEW_FOCUS of the collection wrapper on the global custom controller.
    Best place to do this might be the CONNECT_NODES of the context of your custom controller.
    Get the global CuCo with GET_CUSTOM_CONTROLLER() and then the appropriate context node. Now:
    SET HANDLER yourMethod for lr_global_cuco->typed_context->thecontextnode->collection_wrapper activation iv_activate.
    Of course you have to implement a method similar to ON_NEW_FOCUS as it is on many other nodes.
    cheers Carsten

  • How to get real value from selectOneChoice with javascript?

    Hi,
    How to get real value from selectOneChoice with javascript? The event.getNewValue() only gets me the index of the selected item, not the value/title.
    JSF page:
    <af:resource type="javascript">
    function parseAddress(event)
    alert("new value: " + event.getNewValue());
    </af:resource>
    <af:selectOneChoice label="Location:" value="" id="soc4">
    <af:clientListener type="valueChange" method="parseAddress" />
    <f:selectItems value="#{Person.locations}" id="si7"/>
    </af:selectOneChoice>
    HTML :
    <option title="225 Broadway, New York, NY-10007" selected="" value="0">225 Broadway (Central Office)</option>
    <option title="90 Mark St., New York, NY-10007" value="1">90 Mark St. (Central Office)</option>
    Thanks a lot.

    Something I was missing ,
    You need to add valuePassThru="true" in your <af:selectOneChoice component. I have personally tested it and got the actual value in alert box. I hope this time you got the real solution. You can also test the following code by your end.
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:panelBox text="PanelBox1" id="pb1">
    <af:selectOneChoice label="Set Log Level" id="soc1"
    value="#{SelectManagedBean.loggerDefault}"
    valuePassThru="true">
    <af:selectItem label="select one" value="First" id="s6"/>
    <af:selectItem label="select two" value="Second" id="s56"/>
    <af:clientListener method="setLogLevel" type="valueChange"/>
    </af:selectOneChoice>
    <af:resource type="javascript">
    function setLogLevel(evt) {
    var selectOneChoice = evt.getSource();
    var logLevel = selectOneChoice.getSubmittedValue();
    // var logLevelObject = AdfLogger.NONE;
    alert("new value is : " + logLevel);
    //alert(evt.getSelection);
    //alert(logLevelObject);
    evt.cancel();
    </af:resource>
    </af:panelBox>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>

  • I followed all the directions to get Norton 360 to work with Firefox 8, but nothing works. I love Firefox, but if my Norton 360 won't work with it I'll be stuck with IE, which I do not like. Please Help Me!

    I followed all the directions to get Firefox 8 to work with my Norton 360, but nothing has worked. Is there anything else I can do? I didn't know there was an issue when I first upgraded to Firefox 8 so didn't choose the Norton plug ins immediately so I uninstalled Firefox hoping to be able to do it correctly when I Downloaded it again. Unfortunately it didn't ask me any thing regarding Norton so I went to Plug ins as directed to Enable Norton 360's plug ins, but none were listed.
    What can I do now? I LOVE Firefox! If we can't make it work I'll be stuck with Internet Explorer which I do not care for at all!
    I need to have Norton Security to protect my computer. Please help me find a solution to this problem ASAP.
    Thank you,
    Susan L Woods
    [email protected]

    Hi Susie, I use Norton 360 and have the latest Firefox 8 installed is working fine for me. Firefox 8 support for [http://community.norton.com/t5/Norton-360/Firefox-8-Support-for-Norton-Toolbar/td-p/581640 Norton Toolbar] was released on Nov 8th. Install the appropriate add-ons based on the version of Norton 360 you're using (see official Norton link above). Hope this helps.

  • I have tried to install Creative Cloud but I just get a blank white screen with a black Creative Cloud bar at the top.  There are no options to choose 'Apps' etc.  Can anyone help?

    I have tried to install Creative Cloud but I just get a blank white screen with a black Creative Cloud bar at the top.  There are no options to choose 'Apps' etc.  Can anyone help?

    What happened yesterday may have been caused by the SOPA protest action that was joined by a lot of sites yesterday and such an action won't happen that often.
    * http://en.wikipedia.org/wiki/Wikipedia:SOPA_initiative/Learn_more
    *http://en.wikipedia.org/wiki/Wikipedia:Bypass_your_cache

Maybe you are looking for

  • *** Can't connect a d-link DL-524 router...

    I've been using my iBook and my airport express base station to connect to the 'net no problem, but I would like to incorporate a DL-524 as my router because I'd like to move my airport express near my stereo to have it there to receive streamed musi

  • Fourpoint Surround FPS 2000 Digital - Replacement AC Adapter?

    Yeah, anyone reading this is thinking, "That system is ancient! Didn't that come out around EAX 1.0?" Indeed, friends, indeed. And a faithful and wonderful system it has been. I would love for it to continue its service in my home, too, if I can loca

  • Doubt in IDOC Regarding Process codes

    Please check the link http://idocs.de/www5/books/IDocBook/cook_A5.pdf In page no: 32 (Topic: 8.5 Assigning a processing function ) ,FM is assigned directly to Message type and Idoc type combination. But in the next page, Process code is created for t

  • When I place an EPS image it shows White background

    Hi Please help me urgent!!!! im using CS5 when i place an EPS image in Indesign, a white background shows. First in PS, i clip mask the image and then flatten the image....I was told to do this. the i save it as below: Save As: Photoshop EPS EPS OPTI

  • Error "Motion patch failed to render"

    Hi all. I am trying to approach the same topic I approached a while ago here but with no cuccess. This problem has ground my productivity to a halt. Every time I go to render a sequence that has any motion template files in it I get this error "Motio