(1) – ELEMENT THAT CONTAINS MAIN FORM BUT WILL BE RE-RENDER
(2) – FORM THAT LOOSES ITS STATE AFTER “ACTION” BUTTON CLICK
(3) – BUTTON THAT MUST BE CLICKED TWICE TO SEND ACTION REQUEST
(4) – OTHER FORM
(5) – BUTTON THAT WILL RE-RENDER ELEMENT THAT CONTAINS MAIN FORM

Analyze request

In firebug or other development tool that records requests you can analyze this problem in POST parameters of the request.
After form re-rendering first request on first click will not have javax.faces.ViewState parameter.
rendered rendered
rendered:button click me twice

second request on second click will have this parameter.
javax.faces.ViewState -7190851117743915418:1300621591202567154
rendered rendered
rendered:button click me twice

This is how you can diagnose problem tiwh view state.

Solution

Main cause of this problem is that h:form looses its view state (javax.faces.ViewState). You rendered it first time when page is loaded, and then you re-render this form when you clicked at “action” button, so it is not the same form “rendered” you wanted to react.

Solution is to load all forms (h:form) once per page load. In other words you must render elements elements that is inside form. To solve example problem I just add h:pandelGroup inside form, and named it with form id.

Since last days I was working hard on my next game and first application.

Game
It is called “Chem-Quest”. I started working on this game 2 month ago, it was my first look on Android. There is no framework in this game. I combine XML layout and drawing on View’s Canvas.
I want to say that it wasn’t simple to handle graphics as using framework, but I want to try this way. Most problems is how to scale on different displays. Still game is not best on smallest devices (less than 180×160).

In this game graphics is more complex, almost beautiful I’d say 🙂 It was not created by me, but my friend.

Still I need to spend some time to test all paths. I hope it will be published tomorrow or day after tomorrow.

Application
First application, but it is almost like game. Actually it is based on other game called “Remember Me: Balls” – this game needs days to finish.

Application is called “Lotto-Blender”. It is a lottery randomiser or lottery number mixer. It is based on AndEngine and it was created in 3 days till now – yes only 3 days.

Graphics is simple but I think quite nice, all created in Gimp using some filters.

This is important application for me because I used AndEngine physics plugin for the first time. This plugin is a fast and free Android physics engine. It is based on JNI calls to Box2D engine.

The great about this engine is simple way to attach this engine to your AndEngine code.

Application is almost ready, but still I get some errors. I hope it will be published till Monday.

Future plans
In free time I was looking for good free engine for Android 3D games and I could not found any.
There is two or tree that simplified some work, but no full game engine or engine that is in final release.
Most advanced is JMonkeyEngine, but in alpha stage.
Most stable is libgdx and jpc – but without 3D physics and all configuration is on developer side.

So I decided to give up 3D games for now.

My topic for next week is more advanced physics in 2D game, with joins, maybe skeleton physics, and some more advanced graphics. And again I want to use AndEngine.