Currently, I try to make a game based on JSF 2.x with XHTML, JavaScript and Java as back-end. This game is round based with up to 6 players. Creating player (objects) and make some settings on it (like the name) works well with the getter and setters. But at the end of the round I have some troubles. I have the following plan:
When a player has finished his inputs, he clicks on "end round". With this button he sets his player status in his player object to "ready". Now a modal dialog appears (made with Bootstrap) where he can see whether the other players are ready or not(feature nearly finished with hidden commandbutton and AJAX command). This view updates every 5 seconds. I plan to use the setinterval feature of JavaScript for this. And now the problem: JSF resolves all "#{xxx}" tags when loading the page. So I can not call a method with "#{}" multiple times, because its already gets resolved on loading. I also can not use AJAX to call the methods multiple times, because the method for example"#{player.setready}" would fire at startup and set the player to ready state. I also can not use a commandbutton. This button works only with the result of reloading the complete page.
Maybe I misunderstand the way JSF works.
Is it possible to have a functon, which gets not resolved at loading and can be called multiple times?
I am really desperate at this moment, because I am not able to solve this problem alone.