This content has been marked as final. Show 2 replies
Yes it is possible and this is exactly what Dynamic Faces does. DynaFaces in an open source project lead by the JSF spec lead, Ed Burns. More information about the project can be found at https://jsf-extensions.dev.java.net
Another way to accomplish the task the way you are going is to get the state restored to be used in your phaselistener. To accomplish this you have to make sure that the listener is called after the restore-view phase. Also, you need to send back the jsf specific field "javax.faces.ViewState" in your request so the FacesServlet can restore the view using that infomation.
Once you have the view restored, you can look up the component by invoking findComponent of the view root you get from the facescontext. Then with the response you have to reset the client's state, so the next request will work properly.
Using Dynamic Faces, should be much easier.
This can be a complex subject, so for further reading I would recommend Ed Burns' co-authored book "JavaServer Faces: The Complete Reference".
Hope this helps - Thanks - Mark
I have also similar question related to this. that's why i am posting to this same request.
The scenario that I am trying out is, (we are using XHTML as UI for JSF)
I have a form which displays data table (custom component). this is in one xhtml and in another xhtml I have similar kind of data table. These two xhtmls are included in a outer page.
Now the problem is, if I do any action(or form submission) or clicking on any command links page doesn't work and reloads the same page with initial rows (as it was a fresh request). but doing any operation on parent row works fine.
what I doubt on this approach is, view root on the server did not get updated when I make AJAX call (as it goes a separate request) to get child rows.
If I am suspecting right, can some body please suggest me how to update view root of the JSF when I make AJAX call. If my assumption on the issue is not correct, then please advice me how to work with this kind of scenario.
thanks in advance.