What is the better way to end a ajax request in JSF?

Hi, i hav a question.Im working with AJAX inside JSF, using a phaseListener, when i finish my work i do:context.responseComplete( );But i want to save the view, i dont want lose the changes ive made in my backbeans, what can i do?tkz.
[269 byte] By [CasMeirona] at [2007-11-26 15:57:13]
# 1
Your values stay on the components in the server. How you're losing them?
amitteva at 2007-7-8 22:18:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Ok, ill try to explain in better way:

AJAX goes to the server and update the model, server response xml and update the client, i hav tags in my jsp like saveState (save the state of object), its a tomahawk component, the jsf_sequence goes with AJAX, i need save the view state using that sequence, because another sequence will be back to the client.

When client go with normal request (get, post), the server doenst restore my previous state (because i think ajax ended the lifecycle first).

Some time ago, i did something like this:

Map map = context.getExternalContext().getRequestMap();

Integer sequence = (Integer) map.get(RendererUtils.SEQUENCE_PARAM);

if (sequence == null || sequence == 1) {

logger.warn("JSF_SEQUENCE error");

} else {

sequence--;

synchronized (context.getExternalContext().getSession(true)) {

context.getExternalContext().getSessionMap().put(

RendererUtils.SEQUENCE_PARAM, sequence);

}

synchronized (map) {

map.put(RendererUtils.SEQUENCE_PARAM, sequence);

}

}

context.getApplication().getStateManager().saveSerializedView(

context);

The code back the jsf_sequence and i dont touch in the jsf_sequence on cliente, so when client post with normal away, everything is fine because faces saved the last view in that sequence. I dont wanna do that again, i wanna discover a soft way.

tkz.

Message was edited by:

CasMeiron

CasMeirona at 2007-7-8 22:18:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...