Selected element in HtmlSelectOneMenu is not correctly set

Hi,
I have multiple dropdown lists in a jsf page. It seems that there is a problem with the generated html regarding the "selected" attribute of
the "option" html tag. It does not corresponds to the value of the
h:selectOneMenu id ="tests" value="#{test.test}" ....
Actually there is no selected attribute in the generated HTML.
In general the question is how to force an element from h:selectOneMenu to be selected.
Thnaks

here I have three dropdown lists with the following semantic
the first list specifies a season, the second specifies a country according the season in the first list and the third lists specifies the resorts according the country and the season
the problem is the if you switch twice the seasons the winter-> summer->winter the resorts and the country list are out of sink. despite the fact that the bean properties in the managed bean are synced.
THIS IS THE MANAGED BEAN
package test.htmlselectone;
import test.htmlselectone.data.Data;
import javax.faces.model.SelectItem;
import javax.faces.event.ValueChangeEvent;
import javax.faces.context.FacesContext;
import javax.faces.application.FacesMessage;
import java.util.ArrayList;
import java.util.Map;
public class ResortPage {
    Data data = new Data();
    private Object single = new Object();
    private String season = "";
    private ArrayList seasons = new ArrayList();
    private String country = "";
    private ArrayList countries = new ArrayList();
    private String resort = "";
    private ArrayList resorts = new ArrayList();
    public ResortPage(){
        initSeason();
    public String getSeason() {
        return season;
    public void setSeason(String season) {
        this.season = season;
    public ArrayList getSeasons() {
        return seasons;
    public void setSeasons(ArrayList seasons) {
        this.seasons = seasons;
    public String getCountry() {
        return country;
    public void setCountry(String country) {
        this.country = country;
    public ArrayList getCountries() {
        return countries;
    public void setCountries(ArrayList countries) {
        this.countries = countries;
    public String getResort() {
        return resort;
    public void setResort(String resort) {
        this.resort = resort;
    public ArrayList getResorts() {
        return resorts;
    public void setResorts(ArrayList resorts) {
        this.resorts = resorts;
    public void setSeason(ValueChangeEvent ev){
        FacesContext ctx = FacesContext.getCurrentInstance();
        Map map = ctx.getExternalContext().getRequestMap();
        FacesMessage msg = new FacesMessage(ev.getNewValue().toString());
        ctx.addMessage(null,msg);
        if (map.get(single) != null){
            return;
        season = (String)ev.getNewValue();
        initCountry((String)ev.getNewValue());
        map.put(single,single);
        ctx.renderResponse();
    public void setCountry(ValueChangeEvent ev){
        FacesContext ctx = FacesContext.getCurrentInstance();
        Map map = ctx.getExternalContext().getRequestMap();
        FacesMessage msg = new FacesMessage(ev.getNewValue().toString());
        ctx.addMessage(null,msg);
        if (map.get(single) != null){
           return;
        country = (String)ev.getNewValue();
        initResort(season, (String)ev.getNewValue());
        map.put(single,single);
        ctx.renderResponse();
    public void setResort(ValueChangeEvent ev){
        return;
    private void initSeason() {
        seasons.clear();
        String[] s_tmp = data.getSeaons();
        for(int i = 0; i < s_tmp.length;i++){
            season = s_tmp;
seasons.add(new SelectItem(season,season,""));
initCountry(season);
private void initCountry(String season) {
countries.clear();
String[] s_tmp = data.getCountry(season);
for(int i = 0; i < s_tmp.length;i++){
country = s_tmp[i];
countries.add(new SelectItem(country,country,""));
initResort(season,country);
private void initResort(String season,String country) {
resorts.clear();
String[] s_tmp = data.getResorts(season,country);
for(int i = 0; i < s_tmp.length;i++){
resort = s_tmp[i];
resorts.add(new SelectItem(resort,resort,""));
THIS IS THE JSP
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<html>
    <head>
      <meta http-equiv="Content-Type"  content="text/html; charset=windows-1252"/>
      <title>Resort Page</title>
    </head>
    <body>
         <f:view>
         <h:form id="resortForm">
        <table cellspacing="0" cellpadding="0" border="1" width="50%">
         <tr>
            <td>Season</td>
            <td>
                <h:selectOneMenu id ="seasons" value="#{resortPage.season}" valueChangeListener="#{resortPage.setSeason}" onchange="submit()" immediate="true">
                    <f:selectItems value="#{resortPage.seasons}"/>
                </h:selectOneMenu>
            </td>
          </tr>
         <tr>
            <td>Country</td>
             <td>
                <h:selectOneMenu id ="countries" value="#{resortPage.country}" valueChangeListener="#{resortPage.setCountry}" onchange="submit()" immediate="true">
                    <f:selectItems value="#{resortPage.countries}"/>
                </h:selectOneMenu>
            </td>
          </tr>
          <tr>
            <td>Resort</td>
            <td>
                <h:selectOneMenu id ="resorts" value="#{resortPage.resort}" valueChangeListener="#{resortPage.setResort}" onchange="submit()" immediate="true">
                    <f:selectItems value="#{resortPage.resorts}"/>
                </h:selectOneMenu>
            </td>
          </tr>
        </table>
            <h:messages/>
      </h:form>
      </f:view>
      </body>
  </html>

Similar Messages

  • Firefox 33 HTML select elements do not display correctly

    HTML form <select> elements do not display options correctly in Firefox 33.
    For example:
    <select id="field_4" class="mainForm" name="field_4">
    <option value=""></option>
    <option value="submitted"></option>
    <option value="pending"></option>
    <option value="discarded"></option>
    <option value="all"></option>
    </select>
    should display a drop down with 5 elements (first one blank) but no elements at all are displayed.
    The bounding box does not seem to be computed correctly so no options display.
    I have observed this issue on multiple pages. These pages displayed correctly in older version of Firefox and they display correctly under IE. The problem occurs with no addons or additional themes installed. The problem does not occur in SafeMode so I suspect that it is theme related but the Default 33.0 theme is the only installed theme and it cannot be disabled outside of SafeMode. I tried installing and changing multiple themes without success. The problem persists after restarting Firefox and after rebooting the computer and even after uninstalling and re-installing Firefox.
    I can supply a screen shot if needed.

    You can try to disable hardware acceleration in Firefox.
    *Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available"
    You need to close and restart Firefox after toggling this setting.
    *https://support.mozilla.org/kb/upgrade-graphics-drivers-use-hardware-acceleration
    If it works in Safe Mode and in normal mode with all extensions (Firefox/Tools > Add-ons > Extensions) disabled then try to find which extension is causing it by enabling one extension at a time until the problem reappears.
    Close and restart Firefox after each change via "Firefox > Exit" (Windows: Firefox/File > Exit; Mac: Firefox > Quit Firefox; Linux: Firefox/File > Quit)
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • When using the google translate js api to dynamically translate a webpage the chosen option in a select element does not show up. This happens to me only in FF (using v4)

    I am asking you this because I did not find this problem in any of the other browsers I have (chrome, opera, ie, safari).
    I uploaded a simple html file to show this problem here: http://rvyu.com/mKLG
    Notice that if you don’t change the language you have no problem changing the value in the select element (the original one with 3 options, not the one generated by google translate) but if you do when you switch values the selected one does not show up.

    Ok thank you so much, for your timely response.
    RESPONSES:
    1)   When I set up my iMac, I did not transfer any data directly from my windows PC.  I simply used the same iTunes login and account.  I have access to all of the files via the "Purchased" section of the iTunes store.  If I click "Download Previous Purchases"  text, I can download ALL of the purchases I have ever made.
    2)   I have the Apple TV 2, so good news, question answered.  I thought maybe it was the Apple TV 1, but it is the Black model, so bam.  Good response for you.  Well the whole damned reply is an awesome response, just pointing out that one piece of awesome.  I stated that it was an Apple TV 2, and yet you were still good enough to figure I could be mistaken, and provide me with knowleedge just incase.
    QUESTIONS:
    3)   So can my iMac not stream the data directly from itunes, without download?  Apple TV can, but perhaps that is something among many things that maker it unique, and awesome.
    SERIOUSLY.... THANK YOU... 
    I work in the computer support section for the Military.  The only problem is we use Windows , lol.  Well that and i've been gone for nearly 6 months on recover.  I go back next month though I hope.  But working in that field gives me the abilty to judge responses that run inside the same vein.  Your response was so awesome that I half thought I might have written it myself. 

  • I bought elements 13 and downloaded it , but when asked to sign into my adobe account as requested at initial set up of elements 13 , I know my correct password etc and i have a good internet connection But nothing happens even if i wait an hour or so. An

    i bought elements 13 and downloaded it , but when asked to sign into my adobe account as requested at initial set up of elements 13 , I know my correct password etc and i have a good internet connection But nothing happens even if i wait an hour or so. Any help would be appreciated.

    Hi Michael,
    Thanks for posting on the Adobe forums.
    Please follow these steps :
    Go to following location:
    for Win
    C:\Program Files (x86)\Common Files\Adobe
    C:\Users\username\AppData\Local\Adobe
    for MAC
    Finder> Go > Go to Folder
    \Library\Applicaiton Support\Adobe
    ~\Library\Applicaiton Support\Adobe
    Locate folder OOBE and rename it OOBE.old
    Download and install�
    Adobe - Adobe Application Manager : For Windows : Adobe Application Manager
    Adobe - Adobe Application Manager : For Macintosh : Adobe Application Manager
    After the installation
    Try to Open Adobe Application Manager / Creative Cloud App.
    Log in that with Adobe ID and Password.
    If it does not work first try couple of times more.
    Let me know if this resolves the issue.
    Regards,
    Sandeep

  • Select element not found

    Hi,
     i am using vugen 11.00 for recording an application.. It is recording correctly but while replaying the script it is showing error as " SELECT element not found in the list"... The version of IE is 8.. is it application bug or vugen recording problem?
    please tell me how to resolve the bug... we are using Web( CLICK & SCRIPT) protocol..
     The error is occring in the below code line which is made bold ( web_list ).
        web_list("wddlOccurBeat",
            "Snapshot=t18.inf",
            DESCRIPTION,
            "Name=wddlOccurBeat",
            ACTION,
            "Select=BEAT 3",
            LAST);
        web_list("wddlOccurVillage",
            "Snapshot=t19.inf",
            DESCRIPTION,
            "class=sSfocus"
            "Name=wddlOccurVillage",
            ACTION,
            "Select=GOWDAKARANAGANAHATTI",
            LAST);
    Thanks,
    shrinivas

    I'm using another keyboard model (not vim-like). I often prefer to navigate with [shift]+[arrows] with [tab] in case of form. So this browsers are not suitable for me because it is not acting in a way that I like.

  • Abort element structure is not correct?

    hi all?
    I am getting the following error abort element structure is not correct?
    how to recity if ? while opening a query?  and can anyone let me know what are the error messages that turns up while you work oon  designer?
      and how to debug it nor rectify it.
    regds
    hari

    Hari,
    Any chance you have some key figures in your structure but not in all the selections?
    Try running RSRT and run your query that contains the structure in it here.
    When do you get the message?
    Regards
    Gill

  • The user or users have been added successfully, but there was an error in sending the e-mail message. The server may not be set up correctly to send e-mail. To verify that e-mail is configured correctly, contact your server administrator

    I got this problem when I tried to configure out-going email and add an account to farm administrator group.
    I configure out-going email according to this website http://technet.microsoft.com/en-us/library/cc288949.aspx
    Here are the screen shots.
    The SMTP server and email accounts work out OK when I use Outlook 2010 to test.
    Anyone can help me about it? Thanks.
    Here is the log.
    09/20/2012 09:21:00.36 w3wp.exe (0x1F7C)                      
    0x1138
    SharePoint Foundation         E-Mail                        
    8gsf
    High    
    #160008: The e-mail address 'admin3.sharepoint@domain' contains illegal
    characters. df98555c-612f-4a58-9443-ab6e9a4fcc53
    09/20/2012 09:21:00.36 w3wp.exe (0x1F7C)                      
    0x1138
    SharePoint Foundation         General                      
    8kh7 High    
    Cannot complete this action.  Please try again.
    df98555c-612f-4a58-9443-ab6e9a4fcc53
    09/20/2012 09:21:00.36 w3wp.exe (0x1F7C)                      
    0x1138
    SharePoint Foundation         E-Mail                        
    7946 Critical
    Cannot complete this action.  Please try again.
    df98555c-612f-4a58-9443-ab6e9a4fcc53
    09/20/2012 09:21:00.36 w3wp.exe (0x1F7C)                      
    0x1138
    SharePoint Foundation         Runtime                      
    tkau Unexpected
    Microsoft.SharePoint.SPException: The user or users have been added successfully, but there was an error in sending the e-mail message. The server may not be set up correctly to send e-mail. To verify that e-mail is configured correctly, contact your
    server administrator.    at Microsoft.SharePoint.ApplicationPages.AclInv.SendEmailInvitation(EntityEditor picker, String subject, String message)     at Microsoft.SharePoint.ApplicationPages.AclInv.BtnOK_Click(Object sender, EventArgs e)
        at System.Web.UI.WebControls.Button.OnClick(EventArgs e)     at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)     at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String
    eventArgument)     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStage...
    df98555c-612f-4a58-9443-ab6e9a4fcc53
    The e-mail address I have tested it for several times and there is no problem.
    Anyone has any clue about this error?

    Hi.
    This I have seen before...
    It can be that the SMTP relay server is configured to only allow certain IP ranges or addresses.
    It can be that the firewall on the SP server does not allow for SMTP traffic (normally 25, for example for Exchange).
    It can be that there is an Antivirus on the SP server(Client AV) that prohobits the Timer service to send email from this server. I have seen MacAfee do this. Needed an policy change.
    If, its the builtin SMTP service you are using, check this link:
    http://blog.sharepointrx.com/2010/11/18/setting-up-the-iis-smtp-server-for-sending-email-from-sharepoint-2010-on-server-2008-r2/
    Check that and try again.
    Regards
    Thomas Balkeståhl - Technical Specialist - SharePoint -
    http://blog.blksthl.com
    Download the SharePoint Branding Project here
    Download the SharePoint 2010 Site Settings Explained here

  • When opening Bridge (CS6) I get the following message: "Bridge encountered a problem and is unable to read the cache. Please try purging the central cache in Cache Preferences to correct the situation" I tried and after selecting purge cache it does not a

    When opening Bridge (CS6) I get the following message: "Bridge encountered a problem and is unable to read the cache. Please try purging the central cache in Cache Preferences to correct the situation" I tried and after selecting purge cache it does not allow me to select OK. Also Bridge keeps saying "Building Criteria" with the spinning wheel and nothing happens. I tried uninstalling and reinstalling to no avail. Please help:)

    Maybe a Preferences reset can help:
    Numerous program settings are stored in the Adobe Bridge preferences file, including display, Adobe Photo Downloader, performance, and file-handling options.
    Restoring preferences returns settings to their defaults and can often correct unusual application behavior.
    Press and hold the Ctrl key (Windows) or the Option key (Mac OS) while starting Adobe Bridge.  
    In the Reset Settings dialog box, select one or more of the following options:  
      Reset Preferences 
    Returns preferences to their factory defaults. Some labels and ratings may be lost. Adobe Bridge creates a new preferences file when it starts.
    Purge Entire Thumbnail Cache
    Purging the thumbnail cache can help if Adobe Bridge is not displaying thumbnails properly. Adobe Bridge re-creates the thumbnail cache when it starts.
    Reset Standard Workspaces
    Returns Adobe predefined workspaces to their factory default configurations.
    Click OK, or click Cancel to open Adobe Bridge without resetting preferences.   

  • Now, in photoshop elements 9 when editing, colours displayed are not correct, seems gama number has changes ?

    up to now I had no problem when editing photos with photoshop elements 9. Due to an  unknown  reason/event the colours displayed , now, are not correct : it looks like the gama adjustment has been changed and the photo rendition is uncorrect. If I display the same photos with other photo editing software ( DPP from Canon for example, or Xnview) , the colours are correct !!... Can you help me ?
    Thanks  a lot !
    JJ Etienne

    Thank you for trying to help me. In fact, I resolved my problem by changing the default ICC profile for my screen : I entered the parameters settings panel, screen definition and then advanced settings where I could choose another ICC profile.
    Thank you anway !!
    JJ

  • I right-click in a Yahoo e-mail window and select Languages - Spanish (Mexico) and start typing in Spanish, but it is not correcting my mistakes, or offering alternative spellings.

    I speak English. I am living in Chile and have a Dell/MS Windows Vista (English) laptop. I have Firefox 3.6.12. I have installed the Spanish (Mexico) dictionary. I right-click in a Yahoo e-mail window and select Languages - Spanish (Mexico) and start typing in Spanish, but it is not correcting my mistakes, or offering alternative spellings.
    I don't know if I have the correct plug-in, correct settings, or am expecting something that isn't possible.

    Do other dictionaries work if you select them in the Languages menu?
    See:
    * http://kb.mozillazine.org/Spell_checking
    * http://kb.mozillazine.org/Dictionaries
    * [[Using the spell checker]]

  • I currently own and use Photoshop Elements 9, which does not sync at all with my Adobe Revel account and library.  Is Photoshop Elements 13 able to be set to sync automatically with a Revel library? Thank you.

    I currently own and use Photoshop Elements 9, which does not sync at all with my Revel library.  Is Elements 13 able to be set to sync automatically with a Revel library?
    Thank you.

    I currently own and use Photoshop Elements 9, which does not sync at all with my Revel library.  Is Elements 13 able to be set to sync automatically with a Revel library?
    Thank you.

  • How to tackle the error - " The Lead Selection has not been set in view "?

    Hi Guys,
    I'm getting this error " The Lead Selection has not been set in view " . If any one has faced the same problem , then please guide me . I am new to WD ABAP so finding it difficult to track the reason.
    TIA,
    Vishesh

    Hi Pradeep,
    I have already checked  "Initialisation Lead Selection" property . I have faced the same problem in another view also there it got solved by changing the cardinality.  In this case, I had tried both cardinality and Lead selection property  but nothing  is working.
    Thanx.

  • Getting "The Lead selection has not been set in view"Error during runtime

    Hi Guys,
    I'm getting  this error " The Lead Selection has not been set in view " . If any one has  faced the same problem , then please guide me .  I am new to WD ABAP so finding it difficult to track the reason.
    TIA
    Moderator Message: Please search the forum before posting basic messages. Thread locked
    Edited by: Neil Gardiner on Oct 1, 2010 3:48 PM

    Hi Pradeep,
    I have already checked  "Initialisation Lead Selection" property . I have faced the same problem in another view also there it got solved by changing the cardinality.  In this case, I had tried both cardinality and Lead selection property  but nothing  is working.
    Thanx.

  • I have set a passcode for my iphone and later I forgot it, and I tried it so many times but it was not correct now the iphone is disable it doesn't work in tune, can anyone solve this problem??

    I have set a passcode for my iphone and later I forgot it, and I tried it so many times but it was not correct now the iphone is disable it doesn't work in tune, can anyone solve this problem??

    You can solve this problem. Just follow these instructions:
    http://support.apple.com/kb/ht1212

  • PT880 Bios Setting Not Correct After Bios Flash

    Hey guys. Flashed bios from 1.1 to beta 1.5 and am now experiencing this problem. I get the message Bios settings not correct. After loading defaults all I get is my monitor going in to "sleep" mode. The only way to get PC to post is to clear the CMOS jumper. I find it odd that my PC booted to Windows fine with 1.1 and now this problem. The reason I flashed to beta is because I have a 2.4a prescott and heard that the beta is more compatible. Any ideas?

    Quote
    Originally posted by rsix
    I am running at 3.06 right now. Dont ask me what I did.. it just started accepting my OC changes in bios. The only thing I did was install core center and play a bit. After finding that it sucked I uninstalled it. Went into bios and upped my FSB in 5mhz increments. I also loaded optimized defaults first disabling the dynamic OC and the usual settings and changed vcore to 1.425. I still cant get past 3.06, when I try higher, the PC restarts when trying to load windows. Ive tried bumping vcore in increments to 1.5, Northbridge up two notches, AGP at 1.7, RAM at 1.75 all with no luck. I dont want to get too gready but as my temps idle at 40C I feel I have more room to work with. I am going to try and manually enter my mem timings if I can find them and see what happens.
    Another thing I've found. When you change the FSB in the bios and it does not boot, wait a while and see what happens. For me about a minute later it finally rebooted and posted but the FSB setting went back to default. You may not have to clear cmos if you wait long enough.
    Good point about letting it sit----and then it will finally reboot after about a minute----back to FSB 200---this worked for me a couple of times.
    In Bios-----one of the tricks I did was to set the DDR to 466 and 500 and then see how that affected other bios settings----without going ahead and posting.
    It showed me that it jumped up my voltages on AGP, VDIMM and Northbridge (and I think soutbridge as well)
    Anyway----went back into bios and reset the DDR to 400----1:1----then raised all those voltages---then set my FSB up to about 230.  That was really about the highest I could get with any stability.  And that just doesn't cut it with a 2.4c which I've known to easily overclock to around 3.2 on an 875 or 865 board.
    That's why I think a 3.0c is a good chip for this VERY inexpensive board.   At 230 FSB You are doing 3.45 Mghtz which ain't too shappy
    Best timings for me were Cas 2.5 4,4,8 and changing the Vlink settings really did nothing that I could tell for performance or stability.
    Good Luck----let's us know how it turns out-----John

Maybe you are looking for

  • Configure security with principals.xml

    Hello! I'm trying to configure security in Oracle IAS 9.0.4. I have two applications into an OC4J instance. I've configured an admin user with RMI connection permission in the intance's principals.xml file. I've configured another admin user with RMI

  • What if I have purchased an upgrade without the basic software?

    Today I purchased the upgrade for adobe acrobat pro XI.  I thought I had adobe acrobat on my computer.  When I was prompted to verify the serial number to my existing adobe product, I realized I only had the free Adobe Reader.  Do I now have to purch

  • Adding Effects to text in individual cells of a table

    Hello every one, I am creating a five day calendar for a larger day timer. I have used a table to format all my information now I just wanted to add effects to some of the text( drop shadow to the name of the month and what not). Is there a good way

  • Setting the Varinace Reporting Property Through Load Rule

    Hi, I have built a Dimension build rule to build the accounts dimension(Parent Child) and also the Properties like "Data Stroage" and "variance reporting Expense" and also UDA.The dimension is getting build perfectly and also the "data Storage" prope

  • MapServer is not ready. Please try again later

    Hi I've been using MapViewer successfully in development but now i'm moving to production on a Solaris server and am having some trouble. The OC4J server is 9.0.3.1 and the mapviewer is the latest off of OTN. It deploys fine and the "welcome" page ap