Can I ReRender a JSF Component from backing bean code?

Posted by Ben on Stack Overflow See other posts from Stack Overflow or by Ben
Published on 2010-04-11T15:08:40Z Indexed on 2010/04/11 15:13 UTC
Read the original article Hit count: 709

Filed under:

Hi,

Can I rerender a jsf ui component when a valuechangelistener method is run? The reason i'm asking is that my valuechangelistener method changes the values of the input boxes but when I run it, they don't seem to be rerender.

The following doesn't work:

<h:inputText id="inputbox_id"/>
<h:selectOneMenu valueChangeListener="#{myBean.changeCountryMenu}">
  <a4j:support event="onchange" rerender="inputbox_id" action="#{bean.test}>
</h:selectOneMenu>

Notice that bean.test() is never run. So the solution I thought of is to rerender the inputbox from the valueChangeListener. If there is some other better solution i'd be glad to hear...

Thank you! Ben.

© Stack Overflow or respective owner

Related posts about jsf