Leo,

So I just did a little digging through the facelets code, and it looks like in the facelets case, we already are doing something similar to what you are proposing. ViewHandlerImpl's writeState method looks like it only gets called by the encodeEnd on HtmlFormRendererBase. So I think we are probably ok in the facelets case.

The problem as far as I can tell would only be one that affects JSP. This might actually make the change simpler as we might be able to re-use some of the logic from facelets and update the JSP view handler to function the same way. The key appears to be in the call to StateWriter.getCurrentInstance().writingState(); and the subsequent check by the facelets VDL to StateWriter.isStateWritten() to determine whether or not to save the state. We don't do such a call in the JSPViewHandler.

regards,
Mike

On 6/11/2010 12:29 PM, Leonardo Uribe wrote:
Hi

In theory, if there is no form there is no state saved, so the ajax received will not have the state and no postback could be sent. Ok, if the view state is saved in some different way by other alternate ajax component, the point in common is that any component that writes the state should call viewHandler.writeState() method (and stateManager.writeState() method).

Instead do something on the renderer, I think it is possible to do something on viewHandler.writeState() or stateManager.writeState() and keep the same proposed behavior. In jsf 2.0, we have to keep into account the method getViewState().

regards,

Leonardo Uribe

2010/6/11 Werner Punz <[email protected] <mailto:[email protected]>>

    What about ajax and http get which perse do not post a form in all
    cases
    but can post data back into the lifecycle?

    OK,http get is handled, but still there is ajax which can trigger
    a  post without a form.



    Werner


    Am 11.06.10 16:13, schrieb Martin Marinschek:

        Hi Mike,

            2) do something in the form renderer to indicate that the
            state needs to be
            saved, maybe setting a request attribute that can be
            checked in saveView to
            determine whether to actually save state or just return null.


        I would lean towards option 2 - I don“t see how the saved
        state would
        be used at all if there is no form on the page - there cannot be a
        postback to it, so this memory is anyways wasted.

        best regards,

        Martin





Reply via email to