Guy deLyonesse wrote:
For JSF to do a form submit you need an ActionListener, usually triggered by a commandButton or commandLink control with a type="submit" attribute.
Listeners are used too much in JSF. A simple action method is usually sufficient, simpler to code, and doesn't tie the backing bean as strongly to a particular technology. I think the whole listener thing came about because stale information has a remarkable way of hanging around the Internet forever. Listeners have their uses, but not as often as people think. I don't think I've
ever done an ActionListener, for example, since the only real reason to would be to fire multiple methods from a single command.
The original post misses the point, however. It's an attempt to apply legacy design to an entire new paradigm. JSF is intended to allow people to be able to design a View, present it to the client, go through a series of postbacks until all submitted data in the form passes validation, then fire an Action to act on the submitted data. You don't
retrieve data, it's
presented to you. The more logic you code in JSF, the more likely you're doing it wrong. And the more times you explicitly reference classes in the javax.faces package tree - excepting the datamodel classes - the more likely you're doing it wrong.
JSF is designed to make things simple and easy, and the biggest problem with it is that too many people keep trying to make it not be simple and easy.