Setting a navigation rules in a returnListener from a Dialog doesn't work in ADF 10g (JSF faces 1.1)

I've a confirmation dialog created using the dialog framework. The dialog is opened by a command link and the value selected in tg is returned to a return listener. This is my command link.

              <af:commandLink id="btnSalva" shortDesc="Salva" 
                              binding="#{segnaPrzzDep.btnSalva}"
                              partialSubmit="true" immediate="true"
                              windowHeight="250"
                              windowWidth="350"
                              useWindow="true"
                              action="#{segnaPrzzDep.aclSalvaSegnaPrezzoDep}"
                              returnListener="#{segnaPrzzDep.rtlSalvaSegnaPrezzoDep}"
                              styleClass="btnSalva"/>

In the return listener i try to set a navigation rule, but nothing happens. I do it like this (the return handler does only this):

    FacesContext fc = FacesContext.getCurrentInstance();
    NavigationHandler nh =  fc.getApplication().getNavigationHandler();
    nh.handleNavigation(fc, "", "archivio");

The starnge thing is that if i use the dialog framework but withouth opening the window everything is ok. I f i set-up the command link like this:

              <af:commandLink id="btnSalva" shortDesc="Salva" 
                              binding="#{segnaPrzzDep.btnSalva}"
                              partialSubmit="true" immediate="true"
                              action="#{segnaPrzzDep.aclSalvaSegnaPrezzoDep}"
                              returnListener="#{segnaPrzzDep.rtlSalvaSegnaPrezzoDep}"
                              styleClass="btnSalva"/>

Everything works correctly. I'm using jDev 10.3.1.4 and the same version of ADF.

Answers


I have posted a new bug to https://issues.apache.org/jira/browse/TRINIDAD-2171.

I have find a workaround for this problem. In my project I created a class and a package as org/apache/myfaces/trinidadinternal/application/StateManagerImpl.java.

To this class i have copied everything from corresponding class in trinidad lib. Then i have commented out changes done due to fix in https://issues.apache.org/jira/browse/TRINIDAD-1193.

Finally I make sure that my class gets loaded first before the one from trinidad lib (in tomcat this was done by coping the class to WEB_INF\classes dir, since this dir is called as first one when loading classes, i.e. before loading WEB-INF\libs where trinidad lib are placed).


I have been just writing a very similar question, then i noticed that you have already post it.

I guess that the root cause will be the same in both our cases even that I am using the trinidad lib not ADF. The trinidad lib was actually a fork from ADF so they share quite a lot of code.

In my case, we have migrated from trinidad 1.0.7 to trinidad 1.0.10 (due to this problem).

Because of this upgrade the "commandButton" tag in our jsp files defined as

<tr:commandButton ... returnListener="bean.listenerMethod" ... useWindow="true" />

stops calling the bean.listenerMethod when the dialog where this button is present is closed. Setting useWindow="false" causes the bean.listenerMethod to be called again.

Before the upgrade, the mentioned commandButton worked well in both cases (useWindow="true"/"false").

So as you can see the symptoms are very similar.

Now for the findings that i have made when analysing this issue.

By checking the logs I observed that the LifeCycleImpl class did not invoke all of the phases when returning back to the main page (after closing the dialog).

So 1) the post on the dialog was processed, which means all phases were processed and 2) the main page was called afterwards, but this time the very first phase "restore view" was just processed and then jumped directly to "render response" phase calling the main page without invoking the bean.listenerMethod.

When checking the same logs on trinidad 1.0.7 all of the phases where called also in step 2).

I have debugged the sources of trinindad 1.0.10 and tracked this difference to be caused by this "bug".

The problem here is that the UIViewRoot is being removed from session. When then calling close on the dialog, the "restore view" phase during (described above) step 2) can not find the UIVIewRoot of the main page.

When this happen, LifeCycleImpl decides to skipp directly to the "render phase" since it is probably expecting that due to missing UIViewRoot in the session this is the first call to the page (view) and so it just reloads the main page.

I am quite new to JSF but to me this looks like a bug.

In my case there is quite a high pressure on me to fix this problem somehow, so lets see what i will be able to do with this.


Need Your Help

Run-time error 91: Object variable or With block not set

excel vba excel-vba

I have a macro that searches and copies some date from one sheet back into another, if that value is found, and repeats for every row that's not blank.

Sending a post between servers using ONLY php

php post web

I have three webservers. Two of theses have a snippit of php that needs to be run when a post request is sent in, and the third acts to send commands to the two lower servers. I need to send a post

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.