0

I have a form with a <t:div> (t: = apache tomahawk) that is initially hidden by it's CSS style class. It acts like a popup. The popup is shown by clicking one of two different <h:commandButton>'s outside this <t:div> that first call a bean method to initialize the values for the controls within that <t:div>, then the <t:div> is re-rendered to show the initialized values via <f:ajax> attached to these <h:commandButton>'s and it's style class is switched to make it visible. That part works.

Inside the <t:div>, I have a <h:selectBooleanCheckbox>, two <h:selectManyListbox>'s and two more <h:commandButton>'s (Cancel / Apply). All but the second <h:selectManyListbox> also have <f:ajax>. The problem is the <h:selectManyListbox> that has no <f:ajax>: It's setter is never called, despite it's immediate=true attribute. I've checked this by adding some log output to all setters.

When I remove the <f:ajax> from the <h:commandButton>'s inside the <t:div>, the setter is called, but the result is ugly, because you see the whole page reloading instead of just hiding the popup.

I'd like to understand why the <f:ajax> in the <h:commandButton>'s prevent the setter from being called. AFAIK, the whole form is always submitted, even with ajax requests.

The next thing is how to solve it ... my Plan B is to add a <f:ajax> to this <h:selectManyListbox> too, but it should do nothing, at least nothing visible. And I don't know how to achieve this. A completely empty <f:ajax/> as well as a <f:ajax event="change"/> (i.e. with an event but without any action) did not work. So I'll either need a working almost-empty <f:ajax/> or a more elegant replacement.

In case you wonder why I'm using these DIY popups at all ... this was the simplest way to replace the rich:popup without rearranging the JSF page when I removed RichFaces from this application a while ago.

0 Answers0