SelectOneMenu dropdown list Validation Error

I've been trying to get a selectOneMenu working properly for a while now. I've added a "blank" value at the top, but it seems to be causing me a lot of problems.
If I click the "Cancel" button on my page, which navigates away from the current page, I get this error: "Validation Error: Value is not valid" if I've selected "None" from the dropdown list.
Here's my code for my selectOneMenu :
<h:selectOneMenu binding="#{task.dropDownCategoryNew}" id="dropDownCategoryNew" style="position: absolute; left: 576px; top: 480px" value="#{SessionBeanTask.intSelectedValue}">                                                       
<f:selectItem itemLabel="None"  itemValue="0"/>                           
<f:selectItems binding="#{task.dropdown1SelectItems}" id="dropdown1SelectItems" value="#{task.task_categoryDataProvider.options['task_category.id,task_category.name']}"/>                                                       
</h:selectOneMenu>Does anyone have any idea why this might not be working?
Thanks so much

Alright I got it.
You were perfectly right, I was storing the first item as a string with the value "0". What confused me was that in the HTML source code they all were represented as:<option value="0" selected="selected">None</option>
<option value="1">Sales</option>All I had to do was bind the selectItem to an int value like this:
<f:selectItem itemLabel="None" itemValue="#{task.intNoneValue}"/>Thank you BalusC

Similar Messages

  • Selecting a Role from dropdown list throws error

    Hi,
    I'm using CRM Web UI 7.0. I'm facing problem selecting a Role from dropdown list in the assignment block Roles in the screen Employee. The problem is that the dropdown list doesn't show any value on clicking and gives an error message "Error on page" at the bottom of page. The roles exist in the system and also I'm able to see them for Accounts screen & in the GUI.
    Kindly help.
    Regards,
    Shaili

    Hi,
    Just to add to this issue: WebUI-> Account Management-> Contacts-> Roles-> Edit list. When we try to add a role from dropdown in Firefox, it works fine but same throws an error in Internet Explorer related to some script.
    Did someone face similar issue and how was it solved?
    Regards,
    Shikha

  • Use of Validation tab in Dropdown list properties

    Hi All,
    I have created input form  with 2 dropdown fields and submit button. While clicking submit button i need a  message if dropdown lists are not selected. So that I have entered one condtion in validation tab in dropdown list properties. But this validation is not working while clicking submit button.
    Can you please guide how to use validation in VC?
    Thanks,
    Venkatesh R

    Hi
    'Validation Tab' is use to validate the values for that UI control. In case of 'Dropdown list' it is used to show invalid values in perticular cases. Example -
    1. You have dropdown list on 'Country' & it is based on fiscal year input.
    then
    If fiscal year is 2008 values should be X, Y & Z. If value apart from this its invalid. You can configure this with the formula in 'Validation Tab' & if user selects the value apart from theses, system will through the error message as you have set.
    Please also look at the link below -
    http://help.sap.com/saphelp_nw04s/helpdata/en/47/7a46502823199ae10000000a42189d/frameset.htm
    I hope this is what you were looking for, if you want anything else please let me know.
    Regards
    Sandeep

  • Validation Error after updating a SelectOneMenu via Ajax (DWR)

    I have a <t:selectOneMenu> that is bound to a backing bean together with a <f:selectItems> that is bound to a SelectItems[] attribute in the same backing bean. See below:
    <t:selectOneMenu forceId="true"
    id="department"
    value="#{DeptBean.departmentId}">
    <f:selectItems value="#{DeptBean.departmentList}" />
    </t:selectOneMenu>
    When the user changes another field on my page, I use DWR to retrieve a new list of departments and update the <t:selectOneMenu> accordingly. That works just fine.
    The problem is that if I select a value from the updated department list and then submit the page I get a "Validation Error".
    I suspect that the JSF Component Tree still has the old list of values and does some validation which obviously fails.
    Has anyone dealt with this before? Any ideas would be appreciated!

    <t:selectOneMenu forceId="true"
    id="department"
    value="#{DeptBean.departmentId}">
    <f:selectItems value="#{DeptBean.departmentList}"
    />
    </t:selectOneMenu>What is the type of departmentId ? If it is not a String, then try making it a String and see if the issue is resolved. I am not sure if this will help you. But its worth a try.

  • Dynamic values for JSF selectOneMenu using javascrpt. JSF validation error.

    Hi,
    Im using Myfaces 1.2 (tomahawk) . I have a very bulky page having lot of drop down menus. It has a datatable containing four drop downs in a row and the datatable has close to 40 rows (with pagination) . Each of the drop downs have close to 100 items . This makes the page size very huge and not suitable for an internet application.
    Im thinking of a way to have the drop downs populated using javascript in body onload event so that the page size reduces drastically. I have defined a selectOneMenu without selectItems. So before page load there will be no items in the drop down. The body onLoad method populates the drop downs and the page gets rendered as expected. All the javascript events related to these drop downs works fine. When page is submitted i want the selected value in the bean variable.
    But when the page gets submitted im getting the error
    Validation Error: Value is not valid
    Can someone let me know the reason behind this and a way to solve this problem . Its really URGENT...
    Please help....
    Thanks,
    Swami.

    JSFdeveloper wrote:
    Validation Error: Value is not valid During validations phase, the submitted value of UISelectOne/UISelectMany will be tested against the current SelectItems. If it is not covered by the SelectItems, you will get this error.
    Its really URGENT...This is your own problem, not our problem. This way you're only trying to move the problem/pressure to us and pushing us to respond soon. This is considered very rude in terms of netiquette. Next time you do so, I have no problem adding you to my ignore list. [Just ask questions the smart way|http://catb.org/esr/faqs/smart-questions.html].

  • Getting error to bind data to dropdown list

    hay dear,
    i bind data to a dropdown list, everything gonna ok but when i run the project the web page containing the bellow error message. could anyone help me
    Exception Handler
    Description: An unhandled exception occurred during the execution of the web application. Please review the following stack trace for more information regarding the error.
    Exception Details: java.sql.SQLException
    Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : oracle.jdbc.pool.OracleDataSource
    Possible Source of Error:
    Class Name: com.sun.gjc.spi.base.DataSource
    File Name: DataSource.java
    Method Name: getConnection
    Line Number: 112
    Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.
    Exception Details: java.lang.RuntimeException
    java.sql.SQLException: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : oracle.jdbc.pool.OracleDataSource
    Possible Source of Error:
    Class Name: com.sun.data.provider.impl.CachedRowSetDataProvider
    File Name: CachedRowSetDataProvider.java
    Method Name: setCursorRow
    Line Number: 343
    Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.
    Exception Details: com.sun.rave.web.ui.appbase.ApplicationException
    java.sql.SQLException: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : oracle.jdbc.pool.OracleDataSource
    Possible Source of Error:
    Class Name: com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl
    File Name: ViewHandlerImpl.java
    Method Name: cleanup
    Line Number: 603
    Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.

    I'm not a guru, but I would say : your jdbc isn't working. Make sure that it's functioning properly.
    The errormesages suggest that the application can not find the datasource.
    Best Regards,
    Martijn

  • JHeadstart 10.1.3: selection required error on mandatory dropdown list

    Situation:
    - JHeadstart 10.1.3 build 059
    - One JHeadstart Group containing three item regions
    - All items are in the item regions and the regions are stacked (generated as tabs)
    - In the first region (tab) a mandatory item generated as a dropdown list, using a dynamic domain
    When the page starts, the dropdown list displays the meaning value correctly and the list is populated with the correct values. There is no blank option in the list, which is also correct.
    If no changes are made to the list and we navigate to the second tab, an error occurs, displayed at the top of the page: status (which is the field name) - selection required.
    Under the status field a red message reads: A value must be entered. Even when we change the field's value to another list entry and navigate to the next tab, the error reappears. The error does not appear when we change the field back to a simple textImput item.
    Why does this error occur although the field has a correct value?
    Jean-Paul van der Meer and Toine van Beckhoven

    Steven,
    I do also have this problem. It occurs when the VO contains lookup attributes from another enitity.
    In the form I have an table with two stacked tabs as overflow. In the context part I do have 4 dropdownlist. Now when I change one of the lookup items (using a LOV group) and press the save button, the first two dropdownlists become empty and the message 'Selection required' is shown. After entering the values and saving again the other two dropdownlists become empty (no message is shown because those are optional). When I'm only changing other items (non lookup items) the form works fine. At first startup the mandatory dropdownlist do have a NULL-value.
    As temporary solution I moved all the dropdownlists to the stacked tabs and that also works fine. When three are moved and one remains in the context part, the problem still occurs.
    With kind regards,
    Martin Schaap

  • Error/fault when using reader and digitial signatures combined with dropdown list

    I'm working on a time card form for my company and they want me to have the form calculate the dates for the two week pay period when the ending day of the pay period is selected, that part I have down through code.  The problem I am running into though is that when the user is using Adobe reader to digitally sign and send the file to their supervisor the file is changing the selection date field back to the first selection in the drop down list after the first digital signature is applied and the file saved.  This error does not occur when the user is utilizing Adobe Pro though.  Does anyone have any ideas?  I'm wondering if it is something to do with the dropdown list settings or some kind of locking feature not working properly with the reader version.  I am editing/creating the form through LiveCycle Designer ES4. 

    Hi,
    The drop down list box, by default will have a blank value. If you can declare that as obligatory then the report will force the user to enter the value in it.
    Regards,
    Ravi
    Note : Please mark the helpful answers

  • Cluster Creation Validation Error - List Services

    Good Afternoon All,
    I am setting up a simple two node Windows 2008 SP2 Failover cluster.  The nodes are brand new and patched with all updates.  Having gone through this process many times before I was confident it would be quick and painless.  However I am getting
    the following validation error that I have never seen before:
    An error occurred while executing the test. There was an error getting information about the running services on the nodes. There was an error retrieving information about the Services from node 'Node.domain'. Object reference not set to an instance of an
    object
    I'm at a complete loss as to where to start.  If the task is to simply obtain a list of running services I would have thought that would be relatively straight forward.  A simple Get-Service from Powershell will display those details.  I have
    located a KB article that refers to this exact error and there is a hotfix available but this is strictly for Windows 2008 R2 not R1 (SP2).
    http://support.microsoft.com/kb/2559392
    Has anyone seen this error before?

    Hi valleydoofer,
    This error some time occur when you installed Powershell 3, please try to uninstall Powershell 3 from the nodes then rerun the validation.
    More information:
    Install and Configure Windows PowerShell
    http://msdn.microsoft.com/en-us/library/cc952756(v=exchsrvcs.149).aspx
    Best Regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Dropdown list error - in table

    Hi,
    I�m trying to make a table with different fields, with one database. For example:
    Name product Number of products
    So i want to put in the number of products�s a dropdown list. For example, if the product chocolate has 6 units, in the dropdowlist may appear 1-2-...6 and i will select what i want. The database has a field withs these fields.
    So, what i have done is this:
    private void vinos(){
       int noofDBRows = vinosDataProvider.getRowCount();
       listOptionsVinos = new Option[noofDBRows + 1];
       int rowcount = 0;
       if (noofDBRows > 0) {
           // Build the Options Array with the data
           // from DataProvider plus Dummy Value
          vinosDataProvider.cursorFirst();
          do{
              String linea=vinosDataProvider.getCursorRow().getRowId(); 
              int aux=Integer.parseInt(vinosDataProvider.getValue("nUds").toString());
           for (int i=0;i<aux;i++){
                String i2=String.valueOf(i);
               listOptionsVinos=new Option(i2);
    } while (vinosDataProvider.cursorNext());
    // Add Dummy Value to Array at the end,
    // Use Dummy Value ("999") as Value for the Dummy!!
    // Note : - You could add the Dummy value at
    // any position of your choice
    listOptionsVinos[rowcount] = new Option("999", "-------");
    } else {
    listOptionsVinos[rowcount] = new Option("999", "No Rows from DB");
    } public void init() {
    vinos();
    }I have based in this page:
    http://www.netbeans.org/kb/55/dropdowncomp.html
    I know that it is erroneous because the listOptionVinos is common for all the rows, so if anyone could help me i will be pleased.
    Thanks you very much!
    *if anyone understand spanish please say to me because i�ll explain better.
    *si alguien entiende espa�ol que me diga y le intentare explicarselo mejor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi, again!
    The two columns are from the same table, yes. Here is an example of the database:
    Name number
    chocolate 3
    In the db only appear the number 3, so what i want is that in the dropdown appear numbers from 0 to N, in this case 3. So i will choose the number what i want. To do this, i have done a function in mysql which functionalitty is to return numbers from 0 to N. So if i send the number 3, it must send numbers from 0 to 3.
    After that, to prove it, I have created a new one dropdown sending a random value to the procedure. But when i run it, the dropdown doesn`t show anything. This is the code that i have done:
    public SessionBean1() {
    public void init() {
            a3();
    public void a3(){
            try{
                String num="3";
                cantidadRowSet.setCommand("CALL sp_NumberList(?)");
                cantidadRowSet.setObject(0,num);
               cantidadDataProvider.refresh();
               int noofDBRows = cantidadDataProvider.getRowCount();
              opcionesprueba2 = new Option[noofDBRows+1];
               int rowcount = 0;
               if (noofDBRows > 0) { 
                cantidadDataProvider.cursorFirst();
               do {
               opcionesprueba2[rowcount] = new Option(cantidadDataProvider.getValue("1").toString());
               rowcount++;
                while (cantidadDataProvider.cursorNext());
                opcionesprueba2[rowcount] = new Option("999", "---------");
                }else{
            opcionesprueba2[rowcount] = new Option("999", "No Rows from DB");
            }catch(SQLException e){}
       }Thank you very much

  • Validation error while trying to change a value in a request scope bean

    - JBoss 4.2.3.GA
    - JSF 1.2_09-b01-BETA1 (Mojarra)
    - Java 5 Update 17
    Hello, everybody!
    I'm having the following problem in my JSF web application:
    I have a request scope backing bean. The first time this bean is loaded (I check
    this with the ResponseStateManager.isPostBack() method) I fill a list of SelectItem
    instances that are to be displayed in the JSF page in a +<h:selectOneMenu>+ component.
    The list goes, of course, to the +<h:selectOneMenu>+'s +<f:selectItems>+ facet child
    component. In the constructor I also define the value that goes to the value property
    of the +<h:selectOneMenu>+ component. This value is a property in the backing bean, as
    is the list of SelectItem instances. Until now we have something like this:
    The backing bean declaration in faces-config.xml:
    <managed-bean>
        <managed-bean-name>solicitacaoGeral</managed-bean-name>
        <managed-bean-class>br.urca.solicitacoes.web.PaginaSolicitacaoGeral</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    The relevant parts of the JSF page:
    <h:form id="form">
        <h:selectOneMenu value="#{solicitacaoGeral.setorOrigem}" id="foco">
            <f:selectItems value="#{solicitacaoGeral.setoresOrigem}" />
        </h:selectOneMenu>
    </h:form>
    The relevant parts of the backing bean class:
    public class PaginaSolicitacaoGeral
        private final List<SelectItem> fSetoresOrigem = new ArrayList<SelectItem>();
        private Setor fSetorOrigem;
        public PaginaSolicitacaoGeral()
            if (primeiraExibicao()) // First load (!ResponseStateManager.isPostBack())
                // Fill fSetoresOrigem...
                fSetorOrigem = ...
            else // Page submitted
                // Read below...
        public List<SelectItem> getSetoresOrigem()
            return fSetoresOrigem;
        public Setor getSetorOrigem()
            return fSetorOrigem;
        public void setSetorOrigem(Setor setorOrigem)
            fSetorOrigem = setorOrigem;
        private boolean primeiraExibicao()
            String idFerramentaExibicao =
                FacesContext.getCurrentInstance().getViewRoot().getRenderKitId();
            ResponseStateManager gerenciadorEstadoResposta =
                RenderKitUtils.getResponseStateManager(
                FacesContext.getCurrentInstance(), idFerramentaExibicao);
            return !gerenciadorEstadoResposta.isPostback(
                FacesContext.getCurrentInstance());
    }But when the user submits the form and the bean constructor is called again
    (this time the method ResponseStateManager.isPostBack() returns true ),
    in the else block in the constructor above, I need to fill fSetoresOrigem with
    other values and also the fSetorOrigem field because, of course, the fSetorOrigem
    field has to be a valid value that exists in the new fSetoresOrigem list.
    JSF is not complaining about the change to the list items, but it is complaining
    to the change to the fSetorOrigem field (the list value), even though it is a
    valid value present in the list. So I'm getting this error message:
    08:23:54,312 INFO  [lifecycle] WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
    sourceId=form:foco[severity=(ERROR 2), summary=(form:foco: Validation Error: Value is not valid), detail=(form:foco: Validation Error: Value is not valid)]I suppose that JSF is comparing the new value of the field fSetorOrigem with the value
    it has in the view state. As the value is different it is raising the error. That's
    what I suppose. But am I not able the change the value in the postback? I've already
    checked and the value is valid. It corresponds to a value that exists in the list.
    I really need a solution to this problem as I'm stuck with this and can't proceed until
    I find a solution to this. What I am doing wrong and how can I solve this?
    Thank you very much.
    Marcos

    BalusC wrote:
    It is comparing the selected value against the List<SelectItem> returned by getSetoresOrigem() as it is during the apply request values phase of the form submit request.Ok. That's what I supposed JSF was doing.
    BalusC wrote:
    If the selected value isn't in there, then you will get this error.I can understand this, but is this right? As I said, the old value isn't really there because I changed the list values to new ones. But the new value (the value of fSetorOrigem ) corresponds to a value that exist in the new list items, so a valid value. So JSF is not considering that I also changed the list, not just the value. It is comparing the new value with the old list, not the new one. Acting like this JSF is making the page looks like a static HTML page, not a dynamic one. If I can't change the list and the value, what's the point of that? In my point of view I'm not doing anything wrong, I'm not violating any JSF rules.
    Marcos

  • Fill the second Dropdown List based on user selection

    Hi All,
    I am using Web Services to populate Dropdownlists. This works fine for me.
    I have a table with the column "Core Category" and "SUB Category", "Core Category" can have 1 or more SUB Categories.
    The SQL statement in the Web Service for "Core Category" looks like this: "Select DISTINCT [core category] from table", this returns a list of categories.
    In this example, I want to achieve the following:
    When I select a "Core Category' in the first Dropdownlist, the application fires an event or action to fill the second Dropdownlist "SUB Category" with ONLY values that belongs to the selected "Core Category" in the first Dropdown list.
    Is this possible with Visual Composer? Please let me know how I can achieve this?
    Many Thanks,
    Ridouan

    Hi Ridouan,
    Yes it is possible. [Example of Ship and Engine|http://img146.imageshack.us/img146/2968/shipenginezt9.jpg]. Kindly note there is a web service for getting ship and on basis of ship-id selected, engine is filled, which is also deliverd by web service
    The intial state of application is ship drop down is enabled but not the engine, that gets enabled only when ship is selected.
    Here the steps: Please replace it with your fields:
    1. Place the 2 drown down controls.
    2. For Ship, Select the web service in the dynamic list of the dropdown, remember at runtime, if those input parameters are not valid it will give the data service error, make use of if statement.
    3. Define Store -> shipid, engineid and boolean show_engine  - default false
    4.  Action of ship -> ASSIGN action -> true to show_engine from data store
    5.  Value of ship ->
    =store@SHIP
    6.For engine, Select the web service in the dynamic list of the dropdown, remember at runtime, if those input parameters are not valid it will give the data service error, make use of if statement. Where the paramter for shipid is to be filled
    =IF(store@SHIP!="",UPPER(store@SHIP),"AVRA")
    7. Value of engine ->
    =store@ENGINE
    Let me know, if helps.
    Best regards,
    Dharmi
    Edited by: Dharmi Tanna on Jun 27, 2008 3:23 PM

  • Validation error when using a cutsomer converter

    Hey i'm trying to use a customer converter to convert between an object and a string, i can get it to display but when i submit my form i get the error Validation Error: Value is not valid.
    Here is my jsp code
    <h:selectManyCheckbox value="#{AddModuleBean.selectedSchemes}" converter="schemeConverter" id="scheme" >
    <f:selectItems value="#{AddModuleBean.schemeList}" id="schemeList" />
    </h:selectManyCheckbox>

    Maybe you just did something incredibly wrong. If I copy my "Objects in selectOneMenu" example and make small changes to your needs accordingly (Foo --> Scheme, selectOneMenu --> selectManyCheckbox and Foo selectedItem --> List<Scheme> selectedItems), then it just works flawlessly.
    Here it is:
    JSF<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <f:view>
        <html>
            <head><title>Test</title></head>
            <body>
            <h:form>
                <h:selectManyCheckbox value="#{myBean.selectedItems}">
                    <f:selectItems value="#{myBean.selectItems}" />
                    <f:converter converterId="schemeConverter" />
                </h:selectManyCheckbox>
                <h:commandButton value="Submit" action="#{myBean.action}" />
                <h:messages />
            </h:form>
        </body>
        </html>
    </f:view>MyBeanpackage mypackage;
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.model.SelectItem;
    public class MyBean {
        // Init ---------------------------------------------------------------------------------------
        private static SchemeDAO schemeDAO = new SchemeDAO();
        private List<SelectItem> selectItems;
        private List<Scheme> selectedItems;
            fillSelectItems();
        // Actions ------------------------------------------------------------------------------------
        public void action() {
            System.out.println("Selected Scheme items: " + selectedItems);
        // Getters ------------------------------------------------------------------------------------
        public List<SelectItem> getSelectItems() {
            return selectItems;
        public List<Scheme> getSelectedItems() {
            return selectedItems;
        // Setters ------------------------------------------------------------------------------------
        public void setSelectedItems(List<Scheme> selectedItems) {
            this.selectedItems = selectedItems;
        // Helpers ------------------------------------------------------------------------------------
        private void fillSelectItems() {
            selectItems = new ArrayList<SelectItem>();
            for (Scheme scheme : schemeDAO.list()) {
                selectItems.add(new SelectItem(scheme, scheme.getName()));
    }Schemepackage mypackage;
    public class Scheme {
        // Init ---------------------------------------------------------------------------------------
        private String name;
        // Constructors -------------------------------------------------------------------------------
        public Scheme() {
            // Default constructor, keep alive.
        public Scheme(String name) {
            this.name = name;
        // Getters ------------------------------------------------------------------------------------
        public String getName() {
            return name;
        // Setters ------------------------------------------------------------------------------------
        public void setName(String name) {
            this.name = name;
        // Helpers ------------------------------------------------------------------------------------
        public String toString() {
            // Override Object#toString() so that it returns a human readable String representation.
            // It is not required by the Converter or so, it just pleases the reading in the logs.
            return "Scheme[" + name + "]";
    }SchemeDAOpackage mypackage;
    import java.util.ArrayList;
    import java.util.LinkedHashMap;
    import java.util.List;
    import java.util.Map;
    public class SchemeDAO {
        // Init ---------------------------------------------------------------------------------------
        private static Map<String, Scheme> schemeMap;
        static {
            loadSchemeMap(); // Preload the fake database.
        // Actions ------------------------------------------------------------------------------------
        public Scheme load(String name) {
            return schemeMap.get(name);
        public List<Scheme> list() {
            return new ArrayList<Scheme>(schemeMap.values());
        public Map<String, Scheme> map() {
            return schemeMap;
        // Helpers ------------------------------------------------------------------------------------
        private static void loadSchemeMap() {
            // This is just a fake database. We're using LinkedHashMap as it maintains the ordering.
            schemeMap = new LinkedHashMap<String, Scheme>();
            schemeMap.put("schemeName1", new Scheme("schemeName1"));
            schemeMap.put("schemeName2", new Scheme("schemeName2"));
            schemeMap.put("schemeName3", new Scheme("schemeName3"));
    }SchemeConverterpackage mypackage;
    import javax.faces.component.UIComponent;
    import javax.faces.context.FacesContext;
    import javax.faces.convert.Converter;
    public class SchemeConverter implements Converter {
        // Init ---------------------------------------------------------------------------------------
        private static SchemeDAO schemeDAO = new SchemeDAO();
        // Actions ------------------------------------------------------------------------------------
        public Object getAsObject(FacesContext context, UIComponent component, String value) {
            // Convert the unique String representation of Scheme to the actual Scheme object.
            return schemeDAO.load(value);
        public String getAsString(FacesContext context, UIComponent component, Object value) {
            // Convert the Scheme object to its unique String representation.
            return ((Scheme) value).getName();
    }faces-config.xml<?xml version="1.0" encoding="UTF-8"?>
    <faces-config xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
        version="1.2">
        <converter>
            <converter-id>schemeConverter</converter-id>
            <converter-class>mypackage.SchemeConverter</converter-class>
        </converter>
        <managed-bean>
            <managed-bean-name>myBean</managed-bean-name>
            <managed-bean-class>mypackage.MyBean</managed-bean-class>
            <managed-bean-scope>request</managed-bean-scope>
        </managed-bean>
    </faces-config>

  • Disabling/greying out some values in dropdown list

    Hi All -
    I have a dropdown select list (LOV from a table) and it lists all the employees and contractors from a table.
    How do I greyout/disable contractors only i.e. user shouldn't be able to select the contractor from the list but it should be displayed in the dropdown list.
    I am using ApEx 3.2 version.
    Please share your expertise.
    -Seenu

    I wasn't going to comment first, but next time search the forums before posting a question and then when it is necessary to post, please give people adequate time to respond. Oracle's forums were having technical problems which prevented me from posting earlier -- not that a 4 hour turn around is bad for free advice anyway....
    My original planned response:
    Patrick's response in this thread helped me:
    Select List With Heading
    I spiced it up a bit by actually changing the color of the option within the select list...
    I added
    <style>
    .graySelect
    color: gray;
    font-size: 12px;
    </style>
    to the HTML Header and
    modified Patrick's query by using something similar to (took my solution and put it in his example):
    , JOB_ID||DECODE(JOB_ID, 'AC_MGR', '" class="graySelect" disabled="disabled') AS R
    But you need to account for differences in browsers...
    1) firefox (version 3 from my testing) will not let you select the disabled/grayed out option...
    2) internet explorer (version 6 from my testing) WILL let you select the disabled option...it actually then sends in a NULL value for that HTTP POST parameter...so as patrick says you will need to have a page item validation to make sure they didn't submit a gray option (and return an error if they did)...
    good luck!

  • Read-only radio group losing value on validation error

    It took quite a while to track this down, but I think I've got it narrowed down properly. I have an APEX form for updating a record in a databse table with a radio group which is conditionally read-only. If that radio group has a value AND is read-only, when the form is submitted and hits a validation error, the value of the radio group is lost.
    For example, the radio group SUBMITTED_FOR_APPROVAL is set to Y and is read-only for a given user. That user then changes something else on the form and submits it. However, the form now hits a validation error for some field. When the form reloads with the validation error displayed, all the fields are restored except the read-only radio group which is now blank. If a select list is used with the identical read-only condition, it works fine. Likewise, if a radio group is used, but the read-only condition is removed, it works fine. It is only when it is a radio group and it is read-only, that the value does not appear to be submitted to the session with all the form values whent he form is submitted.
    Is this a bug or am I simply missing something?
    Apex 3.1.2
    Rgds/Mark M.

    It's using a shared component LOV cleverly called LOV_YN which consists of a static LOV with
    1 Display=Yes, Return=Y
    2 Display=No, Return=N
    The settings in the LOV section on the item iteself:
    Named LOV: LOV_YN
    Display Extra values: No Dynamic translation: Not translated
    Number of columns: 2 Display null: No
    Null display value is blank as is null return value
    Item was setup as a radio group and was only converted over to a select list to work around this issue. Let me know what else you need and thanks again.
    Rgds/Mark M.

Maybe you are looking for

  • How to read Group ID from Value Mapping Context in Cache Monitoring ?

    Hi friends,     In RWB --> Cache Monitoring --> Integration Server (Java) -> (Search for Value Mapping Groups) in this each item is identified by Value Mapping Group (GroupID, Context, Identifier/Agency, Identifier/Scheme). Either we create Value Map

  • Message menu bug

    i have made a video explaining the bug link:  http://www.youtube.com/watch?v=HGHU6x0nglU coment please nokia mobiles: n80 --- n81 8gb -- n97 -- n8

  • Contacts' Status Changes when I change mine

    I'm a newbie to Skype.  I mostly use the desktop version on a Windows 8.1 laptop but also have the Skype app on my Android phone.   The problem occurs on the laptop. When I sign into Skype and change my status to "online" the status of one of my cont

  • Problem charging battery of a Zen MicroPh

    Hi, from some weeks on, I have problems trying to charge the battery of my Zen MicroPhoto. If I connect it to my PC, it charges without problems, but if I try to charge it using the wall charger (I have this: http://www.creative.com/products/product.

  • Multiclip Keypad Problem

    Hi. When I use the keypad during multiclip editing it will add the markers as I cut but when I stop it will not convert the markers into cuts. When I edit using the mouse it creates the markers and then converts them to cuts as it sould. Has anyone r