0

I have a problem where I am using a SelectOneMenu for navigation:

<p:selectOneMenu value="#{navigator.outcome}">
    <f:selectItem itemLabel="Select item.." />
    <f:selectItems value="#{navigator.menuItems}" />
    <p:ajax event="change" listener="#{navigator.navigate}" />
</p:selectOneMenu>

This works fine except when I navigate back it doesnt display "Select Item.."

The navigator bean is request scoped (I've tried view scoped as well). I've disabled caching using a WebFilter.

DD.
  • 21,498
  • 52
  • 157
  • 246
  • Since you haven't cached the page, when you go back in your browser, your `navigator` managed bean must be recreated, have you tried to debug this behavior as well? – Luiggi Mendoza Feb 21 '13 at 22:45
  • Yup the bean is recreated...I'm not sure why the browser isnt updating. Not sure how to debug that. – DD. Feb 21 '13 at 23:43
  • When the bean is recreated, is `navigator.menuItems` filled? – Luiggi Mendoza Feb 21 '13 at 23:46
  • I think this is a problem with browser caching select options. Apparently adding autocomplete=off fixes this but not sure if I can do this. – DD. Feb 21 '13 at 23:52

1 Answers1

1

You need to turn autocomplete off at the form level. With JSF 2.1 you cannot do this.

Either wait until JSF 2.2 or uses omnifaces:

See link: how to do autocomplete="off" at form level in JSF

Community
  • 1
  • 1
DD.
  • 21,498
  • 52
  • 157
  • 246