JSF 2.3 - How to update parts of the view from a backing bean

85 views Asked by At

The application itself is about generating word-search puzzles. On the view (index.xhtml), there is a form collecting parameters such as rows, cols, etc. Clicking the "generate a puzzle" button invokes the "generate" method in the backing bean. The algorithm can run for a while, so I want to display message like "generating your puzzle, please wait" on the view. After the puzzle is generated, the message should disappear and the puzzle should show. Basically the application works fine but the waiting message is not showing. I did similar things very easily with Angular but so far failed to get it work with JSF (some of my projects have to use JSF that's why I'm investigating JSF).

Core of my question is, how to ask the view to observe some boolean flags in the backing bean, and update parts of the view immediately when the boolean flags change. Those boolean flags are all set within the "generate" method, and they change value from true to false or vice versa within the same method, the view should change accordingly.

Here is the source code of my application:

Any enlightenment will be highly appreciated!

0

There are 0 answers