Converter Element - converter-for-class

I assume a converter can be registered statically on a UI-Component, e.g. one can only remove the converter using java methods. In JSP code, one then does not have to add the converter each time.
Again, the attribute and property elements confuse me. Can anyone explain the difference`?

If you have not explicity registered a converter for a component, but you have declared a value binding expression for the "value" attribute, JavaServer Faces can examine the data type of your model data property and determine if it has a by-class converter that knows how to handle that data type. This is why, for example, you can simply point at an int property with your "value" attribute, and not have to specify an explicit converter.
If you have explicitly specified a converter, or you did not use a value binding expression for the "value" attribute (so JavaServer Faces does not know what the model data type is), then no by-class converter is searched for.
Craig McClanahan
1

Similar Messages

  • Use of converter-for-class

    Hello,
    I start to use Jdev11 TP4.
    I have written my own converter which performs "trims" on character fields. This converter works fine when I apply it to the adf input texts which are present on my jspx pages.
    But I would like to apply this converter on all "adf input text" fields.
    To do this I have added the following lines in my faces-config.xml files :
    <converter>
    <description>Trim the fields</description>
    <display-name>FieldTrimer</display-name>
    <converter-for-class>oracle.adf.view.rich.component.rich.input.RichInputText</converter-for-class>
    <converter-class>lu.ehl.lp.converter.MyFieldTrimer</converter-class>
    </converter>
    The tag <converter-for-class> is always underlined in "red" saying that Reference to oracle.adf.view.rich.component.rich.input.RichInputText is not found.
    And the input fields on my jspx pages are not trimed...
    Could somebody help me to solve this problem ?

    Hi,
    please send me a testcase. Put the testcase in a zip and rename the zip to unzip. my mail address is in my profile
    Frank

  • Converter-for-class

    Is converter-for-class or any other "-for-class" attributes required to match against subclasses of the specified class, or just the class itself?
    It you specify converter-for-class as Object, is the converter required to apply to every subclass of Object (i.e. every class), or just to those properties with a runtime value of exactly Object?
    Thanks.

    Hello BalusC,
    thanks for reply. I'm definitely use JSF RI 1.2_13.
    The problem is, that the converter-method public String getAsString( FacesContext p_ctx, UIComponent p_comp, Object p_value ) is never called.
    But the other method public Object getAsObject( FacesContext p_ctx, UIComponent p_comp, String p_value ) is called.
    BalusC, which JSF implementation do you use?
    regards, Joerg

  • Custom converter for h:selectManyCheckbox, no getAsObject call

    Hello.
    I have a strange problem with my PersonConverter. This converter should convert object of type Person. Implementatin of these classes is not important. So I defined it to faces-config.xml:
    <converter>
      <converter-for-class>x.y.Person</converter-for-class>
      <converter-class>x.y.PersonConverter</converter-class>
    </converter>In my jsp page I have:
    <!-- List<Person> Bean.getSelectedPersons() -->
    <h:selectManyCheckbox id="xyz" value="#{bean.selectedPersons}">
      <!-- List<SelectItem> Bean.getPersons() -->
      <!-- SelectItem oneItem = new SelectItem(person, person[i].getName()) -->
    <f:selectItems value="#{products.persons}"/>
    <h:message for="xyz"/>
    </h:selectManyCheckbox>
    When I access this page I get requested result, eg. checkboxes with names. There are printlns in  getAsString() and getAsObject() so I see that getAsString() was called. However when I submit page I cannot see call to getAsObject() (eg. the println) and on page I get:Conversion Error setting value 'Thomas' for '#{bean.selectedPersons}'. (Assuming that I checked checkbox with label 'Thomas', If I don't check anything, there is '').
    What am I doing wrong please?
    I also tried giving the converter id and adding <f:converter id="personConverterId"/> between h:selectManyCheckbox tags, but it was same.
    Thank you.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Thanks for your support.
    I found that #{bean.selectedPersons} evaluated to Set so I added selectedPersonsList property which just creates ArrayList from Set. This is pretty stupid, I'm sorry. Next time I'll look twice before posting.
    By the way, thanks for tutorials on your blog. It helped me a lot with understanding JSF.

  • I have a Nikon D600 and D800 and I shoot everything in Raw. I use Photoshop Elements 9 for processing but I have been unable to convert any RAW files to open in PSE. Says unable to parse the file. What does this mean and how do I fix it?

    I have a Nikon D600 and D800 and I shoot everything in Raw. I use Photoshop Elements 9 for processing but I have been unable to convert any RAW files to open in PSE. Says unable to parse the file. What does this mean and how do I fix it?

    Since pse 9 can only use up to camera raw 6.5 and the d600 needs at least 7.3 and the d800 needs at least 6.7, you can use the
    8.6 adobe dng converter to convert those files to dng copies, which then pse 9 should open.
    8.6 dng converter
    windows
    Adobe - Adobe Camera Raw and DNG Converter : For Windows : Adobe DNG Converter 8.6
    mac
    Adobe - Adobe Camera Raw and DNG Converter : For Macintosh : Adobe DNG Converter 8.6
    Note:
    If you have windows xp or vista or mac os x 10.6, then you'll need to use the 8.3 dng converter instead
    windows
    Adobe - Adobe Camera Raw and DNG Converter : For Windows : Adobe DNG Converter 8.3
    mac
    Adobe - Adobe Camera Raw and DNG Converter : For Macintosh : Adobe DNG Converter 8.3
    how to use the dng converter
    Camera Raw: How to use Adobe DNG Converter - YouTube
    more info on supported cameras and camera raw plugins required
    Camera Raw plug-in | Supported cameras
    Camera Raw-compatible Adobe applications

  • Convert Photoshop Elements 7 for Windows to a Mac version?

    I have Photoshop Elements 7 for Windows and just got a Mac.  I was wondering if Adobe would convert Elements to a Mac version for a fee.  Anyone had experience with that?  Thanks. tialldplucy

    For PSE it's not worth it. You'd have to pay the upgrade fee and right now you can buy the full version of PSE from amazon and so on for less than the upgrade.

  • I have photoshop elements 10 for PC is possible to convert the license for MAC?

    I have photoshop elements 10 for PC is possible to convert the license for MAC?

    Good evening I do not have disc version, I by in Internet and attached I send the license number can I use?
    I have downloaded the version 10 but when I insert the license number the program say that is wrong.
    May I resolve the problem??
    byby
    Thanks
    Leandro Duranti
    [email protected]
    Il giorno 08/feb/2015, alle ore 01:15, Barbara B. <[email protected]> ha scritto:
    I have photoshop elements 10 for PC is possible to convert the license for MAC?
    created by Barbara B. <https://forums.adobe.com/people/Barbara+B.> in Photoshop Elements - View the full discussion <https://forums.adobe.com/message/7173380#7173380>
    That depends. If you bought the disc version, you're good to go, since your serial number works on both platforms, so just install the mac version. If you lost the discs or your mac doesn't have a disc drive, you can download it here:
    Download Photoshop Elements products | 13, 12, 11, 10 <https://helpx.adobe.com/photoshop-elements/kb/photoshop-elements-10-11-downloads.html>
    However, if you bought the windows version as a download, you're out of luck. Adobe does do a crossgrade, but for older versions you have to pay to upgrade to current version on the new platform, and that's more expensive than just buying it, if you search around for a good price.
    If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7173380#7173380 and clicking ‘Correct’ below the answer
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/7173380#7173380
    To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, & "Stop Following"
    Start a new discussion in Photoshop Elements by email <mailto:[email protected]ware.com> or at Adobe Community <https://forums.adobe.com/choose-container.jspa?contentType=1&containerType=14&container=33 47>
    For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624 <https://forums.adobe.com/thread/1516624>.

  • SelectOneMenu: Error finding converter for component

    I keep getting an error in my selectOneMenues saying
    "Error finding converter for component myselectone".
    The SelectOne elements contains both key and value as String.
    The value that is to be set in my bean is also a String.
    Why do I need a converter here and what is that converter supposed to be??
    Beacause of this, the selectOneMenu want post.

    Is the value which is bound to the selectOneMenu reachable?
    Try logging the getter-method of the bound value. When you bind the value to a nested bean, the bean might have not been initialized.
    I had the same problem with something like this
    I had a Person class with a nested person-attribute object.
    I bound the value of the selectOneMenu to one of the attributes of the nested person-attribute object, without instantiating the object first in the faces-config. After instantiating not only the person class as a managed bean but also the nested person-attribute object, all was well.

  • Cannot convert type class java.lang.String to class oracle.jbo.domain.Clob

    Cannot convert type class java.lang.String to class oracle.jbo.domain.ClobDomain.
    Using ADF Business Components I have a JSFF page fragment with an ADF form based on a table with has a column of type CLOB. The data is retrieved from the database and displayed correctly but when any field is changed and submitted the above error occurs. I have just used the drag and drop technique to create the ADF form with a submit button, am I missing a step?
    I am using the production release of Jdeveloper11G

    Reproduced and filed bug# 7487124
    The workaround is to add a custom converter class to your ViewController project like this
    package oow2008.view;
    import javax.faces.application.FacesMessage;
    import javax.faces.component.UIComponent;
    import javax.faces.context.FacesContext;
    import javax.faces.convert.Converter;
    import javax.faces.convert.ConverterException;
    import oracle.jbo.domain.ClobDomain;
    import oracle.jbo.domain.DataCreationException;
    public class ClobConverter implements Converter {
         public Object getAsObject(FacesContext facesContext,
                                   UIComponent uIComponent,
                                   String string) {
           try {
             return string != null ? new ClobDomain(string) : null;
           } catch (DataCreationException dce) {
             dce.setAppendCodes(false);
             FacesMessage fm =
               new FacesMessage(FacesMessage.SEVERITY_ERROR,
                                "Invalid Clob Value",
                                dce.getMessage());
             throw new ConverterException(fm);
         public String getAsString(FacesContext facesContext,
                                   UIComponent uIComponent,
                                   Object object) {
           return object != null ?
                  object.toString() :
                  null;
    }then to register the converter in faces-config.xml like this
    <faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee">
      <application>
        <default-render-kit-id>oracle.adf.rich</default-render-kit-id>
      </application>
      <converter>
        <converter-id>clobConverter</converter-id>
        <converter-class>oow2008.view.ClobConverter</converter-class>
      </converter>
    </faces-config>then reference this converter in the field for the ClobDomain value like this
              <af:inputText value="#{bindings.Description.inputValue}"
                            label="#{bindings.Description.hints.label}"
                            required="#{bindings.Description.hints.mandatory}"
                            columns="40"
                            maximumLength="#{bindings.Description.hints.precision}"
                            shortDesc="#{bindings.Description.hints.tooltip}"
                            wrap="soft" rows="10">
                <f:validator binding="#{bindings.Description.validator}"/>
                <f:converter converterId="clobConverter"/>
              </af:inputText>

  • Thiz iz Urgent..........How to convert a .class file to a .java file

    Hi Everybody,
    I want to convert back a .class file (a compiled servlet) into .java (source code) file. How do I do it???
    Note using javap has not been of any help.
    Thanks in Advance
    Rajib

    Why don't you look at this thread:
    http://forums.java.sun.com/thread.jsp?forum=31&thread=143500
    If thats not enough, try searching all the forums for:
    "convert .java .class" That'll give yu a bunch of other threads...
    Sjur

  • How to convert java class file version without decompiling

    Hi,
    Oracle R12.1.3 i am having illegal access error while try to access the class file version Java 1.3 uses major version 47,So how to convert the class file version without using decompiling.
    Current java version is 1.6.0_07
    Is there any tool or API for converting class file version?
    Thanks,
    Selvapandian T

    Beside this I wonder where you get your error from since AFAIK 12c comes with java 1.6.
    Well wonder no more!
    OP isn't using Oracle 12c database.
    They are using Oracle R12.1.3 - which is the E- Business Suite.

  • How to convert a .class file?!!

    sorry guys,
    but I've a question in knowing the code of some file,
    I've zipped file, when I unzip it, it contains an html page with a .class files
    (passing parameters to applet)
    my problem is that I want to know the code of the .java file (which is not included)
    but the program is working well, coz I have the .class file,
    so, can I convert this .class file into a java file, so its java code could be readable (to understand it)
    thanks in Advance :)

    sorry man, but Can't u send me a specific link for downloading this "Java decomplier"
    coz I found my self in something called (jad decompiler) with lots of versions and this is confusing
    and Is that mean, that there's a decompiler which can convert the .class file into .java one?
    and thanks alot man.....u help me always!
    (I'm still begginner in java)

  • How to convert a class file to exe file and how to cteate a class file to d

    how to convert a class file to exe file

    Hi Bhaskarq,
    Hi,
    It is not at all possible.
    But it is a really worst method.
    Please go through it.
    This is a very common question asked in the comp.lang.java newsgroup. Its often useful to have an
    executable application when deploying your
    applications to a specific platform, but remember to
    make your .class files available for users running
    Unix/Macintosh/other platforms.
    Microsoft provide a free system development kit (SDK),
    for Java, which includes the jexegen tool. This
    will convert class files into a .EXE form. The only
    disadvantage is that users need a Microsoft Java
    Virtual Machine (JVM) installed. If your target
    platform is Win32, you can either redistribute the
    virtual
    machine, or raise the level of your system
    requirements, to include Windows 98, or Windows 95
    with
    Internet Explorer 4. Systems matching these
    requirements will already have a copy of the Microsoft
    Java Virtual Machine installed.
    Note : You must specify all of the class files your
    application needs (except for standard java packges)
    as a parameter, so if you have third party libraries,
    you'll need to include them as well. You can use wildcards * though, and you don't need the original source code.
    Also please see this Forum which will give a good idea
    http://forum.java.sun.com/thread.jsp?forum=31&thread=149733
    I hope this will help you.
    Thanks
    Bakrudeen
    Technical Support Engineer
    Sun MicroSystems Inc, India

  • Converting a class file to a dll

    Hai please help me..
    I am trying to convert my .class file to a .dll file.
    This is my java code:
    public class DateFunctions {
         public int getTimeInSeconds(int i){
              return i;
         public int addNumbers(int i, int j) {
              return (i+j);
         public static void main(String[] args) {
              DateFunctions df=new DateFunctions();
              df.getTimeInSeconds(
    Created class file DateFunctions.class.
    Created jar DateFunctions.jar using:
    jar cvf DateFunctions.jar DateFunctions.class
    Generated dll file using bimp tool like this (Visual J# .NET tool):
    jbimp DateFunctions.jar /t:library
    I got the file: DateFunctions.dll
    Now loaded this dll into my code (say, TSL code in WinRunner) using load_dll("DateFunctions.dll");
    When I try to access the method like:
    j=getTimeInSeconds(int i);
    I am getting the error RPC error.
    Note: DLL is loading fine. but while accessing the functions I am getting the RPC error..
    What could be the reason..?
    Please help...?
    Thanks,
    Satish

    Your answer lies in the documentation for WinRunner and whatever else is calling the DLL.
    Certainly Java JNI has requirements for DLLs called from Java: They have to be C++ bindings that use the native header that Java generates, right?
    So now you need to look at the requirements for your WinRunner and make sure that the program translating your .class file to a DLL does it in a such a way that the bindings WinRunner expects are indeed there.
    But none of that has anything to do with Java. If your Java class compiles and tests successfully, then your questions about Java are satisfied. You have to figure out what WinRunner needs and what's missing from what you supplied.
    %

  • Error: could not be converted to [class java.lang.Class].

    I am newbie to JDeveloper (10.1.2) on winxp and i was trying to setup the example from the following url http://radio.weblogs.com/0129487/2003/09/19.html
    It is a how to on "Executing Toplink Queries using JavaBean DataControl "
    Any help would be greatly appreciated.
    Near the bottom on step "In StrutsPageFlow diagram, select allEmpsDA Data Action, right mouse and chooe Run" i get a the following runtime errors:
    Validation Error
    You must correct the following error(s) before proceeding:
    JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught: oracle.toplink.exceptions.ConversionException, msg= Exception Description: The object [mypackage.Employees], of class [class java.lang.String], could not be converted to [class java.lang.Class]. Please ensure that the class [class java.lang.Class] is on the CLASSPATH. You may need to use alternate API passing in the appropriate class loader as required, or setting it on the default ConversionManager Internal Exception: java.lang.ClassNotFoundException: mypackage.Employees
    JBO-29000: Unexpected exception caught: oracle.toplink.exceptions.ConversionException, msg= Exception Description: The object [mypackage.Employees], of class [class java.lang.String], could not be converted to [class java.lang.Class]. Please ensure that the class [class java.lang.Class] is on the CLASSPATH. You may need to use alternate API passing in the appropriate class loader as required, or setting it on the default ConversionManager Internal Exception: java.lang.ClassNotFoundException: mypackage.Employees
    Exception Description: The object [mypackage.Employees], of class [class java.lang.String], could not be converted to [class java.lang.Class]. Please ensure that the class [class java.lang.Class] is on the CLASSPATH. You may need to use alternate API passing in the appropriate class loader as required, or setting it on the default ConversionManager Internal Exception: java.lang.ClassNotFoundException: mypackage.Employees

    This error is happening on a read.
    Here is the mapping descriptor:
    <database-mapping>
    <attribute-name>SuppItemCollection</attribute-name>
    <read-only>false</read-only>
    <reference-class>package.SuppItem</reference-class>
    <is-private-owned>false</is-private-owned>
    <uses-batch-reading>false</uses-batch-reading>
    <indirection-policy>
    <mapping-indirection-policy>
    <type>oracle.toplink.internal.indirection.NoIndirectionPolicy</type>
    </mapping-indirection-policy>
    </indirection-policy>
    <container-policy>
    <mapping-container-policy>
    <container-class>java.util.Vector</container-class>
    <type>oracle.toplink.internal.queryframework.ListContainerPolicy</type>
    </mapping-container-policy>
    </container-policy>
    <source-key-fields>
    <field>SUPP.REQ_NUM</field>
    </source-key-fields>
    <target-foreign-key-fields>
    <field>SUPP_ITEM.REQ_NUM</field>
    </target-foreign-key-fields>
    <type>oracle.toplink.mappings.OneToManyMapping</type>
    </database-mapping>
    Object model has a Supp class that has a collection of SuppItem(s). I was allowing the Mapping Workbench to create the Java Source. I'm not to fond of that, but I thought it would be easiest to get things going.
    The datamodel is similiar to the class model.
    Thanks for the help,
    Mike

Maybe you are looking for

  • How can I get the music on my iphone onto my laptop?

    So, a while back, my father and I switched laptops. Since we did this, I have HIS itunes account on my laptop. He told me to uninstall itunes and reinstall it and then log into a new account that I've made. I did so, several times. Every time I open

  • I cannot import photos from hard drive

    LR cant see all my folders in My Pictures to Add photos

  • Apple Caching Server 403 errors

    I have a caching server enabled for a IOS installation Im doing. The mac has been at the customers for a while and I don't know its origin. It is running 3.2.1 Server OS Ive had a lot of trouble with the upstream proxy and the fact that its some kind

  • Every time I open Photoshop on my iMac?

    Photoshop opens every file I have worked on and I have to clue each one before I can work on the present one. Why is this and can I stop it easily?

  • Can't connect to sqlldr

    I usually connect to sqlplus on a personal oracle database (or two other databases) with the usual string user: myname password: mypass host id: Geology1 if I try to log on to sqlldr with sqlldr userid=myname/mypass parfile=myparfile.par I get an ORA