0 Replies Latest reply on Jan 25, 2008 10:40 AM by Romain Taz

    [ModalPanel] The Javascript erases combobox values?

    Romain Taz Newbie

      Hi all,

      Let's take the following code as an example for my problem:

      <rich:modalPanel id="waitingMessagePopup"...>
       ...
      </rich:modalPanel>
      
      <h:selectOneMenu value="#{fake.choice}">
       <f:selectItems value="#{fake.choices}"/>
      </h:selectOneMenu>
      <h:commandButton action="#{fake.doIt}" value="Go!" onclick="Richfaces.showModalPanel('waitingMessagePopup');"/>
      


      I want to see my modal panel when I click on the button. The problem is that when I click on that button, the modal panel is dispalayed, and when the page is rerendered (the whole page as I don't use Ajax here), the combobox has an empty value.
      Indeed, the bean receives, from the request, a null value for the bean property choice.

      I suspect that the Javascript that shows the modal panel change the value of the combobox to an empty value. That's why I get a null for the property choice on my bean.
      Am I right?

      If I use a <a4j:commandButton .../> instead of the <h:commandButton .../>, then the behavior is correct (i.e. I get the correct value for choice on my bean).

      However, for some reason, I don't want to use an A4J CommandButton here, just a "basic" one.

      So, is there a way to solve my problem?

      Thanks.