[JBoss Seam] - Re: Trinidad PPR/Ajax and Seam
by dajevtic
Hi Chane,
we used Seam and Trinidad in several of our POCs. No production applications yet, though.
I remember that we had to incorporate an additional phase listener along with an action listener configured in faces-config when using the dialog framework of Trinidad / ADF, because the conversation id was not propagated to the dialog.
Otherwise, there are no known incompatibility issues.
We even use AJAX4JSF to "ajaxify" non-ajax components.
Here is the code to get dialogs of trinidad to work w/ seam:
PhaseListener:
| private static final String CONVERSATION_ID_SESSION_PARAMETER = "conversationId";
|
| private Map createParameterMapForConversationRestore(String conversationId) {
| Map paramterMap = new Hashtable();
| paramterMap.put(CONVERSATION_ID_SESSION_PARAMETER, conversationId);
| return paramterMap;
| }
|
| private void restoreConversation(Context context) {
| if (context.isSet(CONVERSATION_ID_SESSION_PARAMETER)) {
| String convId = context.get(CONVERSATION_ID_SESSION_PARAMETER).toString();
| Manager.instance().restoreConversation(createParameterMapForConversationRestore(convId));
| context.remove(CONVERSATION_ID_SESSION_PARAMETER);
| }
| }
|
| public void afterPhase(PhaseEvent event) {
| try {
| if (event.getPhaseId().equals(PhaseId.RESTORE_VIEW)) {
| UIViewRoot root = event.getFacesContext().getViewRoot();
| if (root != null) {
| String viewId = root.getViewId();
| if ((viewId != null) && viewId.endsWith("_dlg.jspx")) {
| restoreConversation(Contexts.getSessionContext());
| }
| }
| } else {
| log.info("after " + event.getPhaseId());
| }
| } catch (Exception e) {
| log.error("Could not restore Seam conversation", e);
| }
| }
|
Here is the code for the action listener:
| public void processAction(ActionEvent actionEvent)
| throws AbortProcessingException {
|
| if (actionEvent.getComponent() instanceof CoreCommandLink) {
| CoreCommandLink link = (CoreCommandLink)actionEvent.getComponent();
| if (link.isUseWindow()) {
| Contexts.getSessionContext().set("conversationId", Manager.instance().getCurrentConversationId());
| }
| }
| super.processAction(actionEvent);
| }
|
The example above assumes that popup dialogs end with a _dlg.jspx extensions, which you may alter to your desire.
Please remember, those were quick and dirty hacks in order to get conversations working with Trinidad.
This issue may have already been resolved, and if not there might be far better solutions.
Hope it helps.
Kind regareds,
dj
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995439#3995439
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995439
19 years, 4 months
[JBoss Seam] - Seam explicit conversationId
by pdpantages
I am Using Seam 1.0.1GA, ajax4jsf 1.0.2, Jboss 4.0.4.GA
Hello Forum,
I have tried to use the "explicit conversationId" feature but am a bit puzzled by the behaviour.
Section 3.6 of the Seam 1.0.1GA reference seems to state that if the "explicit" conversation already exists, Seam will decline to begin a new converstion and will simply re-direct to the existing one. This is what I want to do.
But, if I try something like
@Begin(id="myConvId")
and execute the annotated method from a LR conversation, I get the familiar exception, explaining that I am already in a LRC and need to use join=true. Note that the LR conversation is not the one identified by "myConvId".
This seems to contradict the documentation, or am I mis-reading something. ? If I put join=true, I would expect to stay with the LRC and not redirect to "myConvId", no?
Thank you for your help, PdP
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995429#3995429
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995429
19 years, 4 months