1

So before anything just to make it clear this is an issue that happens with firefox even in the showcase https://www.primefaces.org/showcase/ui/input/oneMenu.xhtml to replicate just select any value and hit f5 and the value will remain. Also check forum.primefaces.org/viewtopic.php?t=17525 for the details also check how to do autocomplete="off" at form level in JSF other solutions that didn't work for me

I have a little problem when hitting f5 to refresh page for some reason my selectOneMenu its keeping the previously selected value,I need him to have the default value or first one on the array again... any idea how can I fix this? or why does that happen? every other element of the page is succesfully reseting its value, this is the code of my selectOneMenu:

<p:panel styleClass="cds-panel-reset">
                    <p:selectOneMenu id="somOrigenConsulta" tabindex="1"
                        binding="#{consultaPagoPremiosMB.somOrigenConsulta}"
                        label="Origen" widgetVar="wvSomOrigenconsulta"
                        style="width: 140px !important;">
                        <p:ajax event="change" process="somOrigenConsulta"
                            update=":accordion:tbwPagarPremio:frmConsultapagopremioscod:pnlGrdDatosConsulta
                :accordion:tbwPagarPremio:frmConsultapagopremioscod:dtbPagopremios"
                            listener="#{consultaPagoPremiosMB.mostrarDialogoOrigen()}" />
                        <f:selectItems
                            value="#{consultaPagoPremiosMB.aOrigenConsulta}" />
                        <p:ajax process="@this"
                            render=":accordion:tbwPagarPremio:frmConsultapagopremioscod:pnlGrdDatosConsulta" />
                    </p:selectOneMenu>
                </p:panel>

Also it refreshes succesfully if I refresh by using CTRL+SHIFT+R, any idea why F5 doesn't???

could it be cache? https://www.saicharanreddy.com/whats-the-difference-between-f5-ctrlr-ctrlshiftr-ctrlf5-and-shiftf5-in-google-chrome-browser/

how can I deal with that in a selectonemenu holy..

I did some searching the problem seems to be mozilla, https://forum.primefaces.org/viewtopic.php?t=17525

But im not able to implement the autocomplete=off because it just doesn't appear to be an attribute of my selectonemenu (primefaces 7.0) please help another way to implement this

BugsOverflow
  • 386
  • 3
  • 19

2 Answers2

1

You can use dynamic="true" attribute. I got the same problem solved using this attribute.

Noah
  • 68
  • 1
  • 7
0

The problem is firefox, it also happens in the showcase.

So I had a headache with this problem and I tried the first solution of this on the selectOneMenu but it didn't work, so I had to use javascript like this:

<script type="text/javascript">
            $(document).ready(function(){
                var oneMenu = document.getElementById('accordion:tbwPagarPremio:frmConsultapagopremioscod:somOrigenConsulta_input');    
                oneMenu.value="1";

                })
    </script>

and it started having always default value 1 when I hit F5, but I'm not 100% sure if this is a good solution.

BugsOverflow
  • 386
  • 3
  • 19