Hi all,
I'm developing a kind of framework able to render on MyFaces (
Jsf 1.2)/IceFaces(Jsf 1.2)/Swing/WinForms/Asp.Net/WPF, using the SAME base logic for everything and a kind of "rendering" face for every environment.
(I'll will show it to the world shortly, right the time to solve a couple of things, like an engine to understand css for Swing and WinForms nearly ready, and the following problem:)
Currently, after some struggling everything works perfectly, all is done completely programmatically, datagrids, dialogs, validation, etc... in all the environment. Only one thing keep resisting the assimilation: i can't remove programmatically an UIComponent (programmatically added of course) from the component tree in
MyFaces. As far as i understood this i caused by the restoration of the ViewState after the postback. The FacesServlet is not able to load the ViewState informations inside an UIComponent that has been destroyed.. If i simply do a refresh, everthing back again to work like a charm. I tried to KILL the ViewState hidden field through javascript but then i have various exception caused by a viewState not in the right format (strange is'n t it :P )
This is the exception i get after the following actions
1) I create the part inside the Form programmatically
2) I click everywhere to do stuffs like CRUD operations, searches and so on (but nothing is removed)
3) I click on the button to remove stuffs, than as before a postback is called
4) Inside the event handler of the button an HtmlPanelGroup (or any other kind of control) is removed from the parent (pareng.getChildren().remove(objToRemove))
4a) Then the rendering is made
4b) AND THE DIRTY object i removed is still there staring at me.....
If at this point i do a refresh (through the browser) everything goes perfectly, the state is lost and all is ok
Instead if i do another postback (thus maintaining the previous state) i get the cute exception below:
May be someone is able to give me an idea on how to manage such a nasty situtation
Enrico