myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Robinson" <andrew.rw.robin...@gmail.com>
Subject Re: [Trinidad] setActionListener before actionListener or partialSubmit with action
Date Tue, 15 Apr 2008 22:48:48 GMT
FYI, you should not use tr:setActionListener if you are on JSF 1.2,
ignore this comment if you are still on 1.1.

-Andrew

On Tue, Apr 15, 2008 at 4:47 PM, Andrew Robinson
<andrew.rw.robinson@gmail.com> wrote:
> Response inline
>
>
>  >  > Use action instead of actionListener? Actions are always fired last.
>  >
>  >  Yes, I know. But if I use actions, PPR won't work. The whole page is
>  >  refreshed, regardless of the action outcome. But I'd like to use PPR.
>
>  Returning null is the correct way to ensure that the navigation
>  handler does not change the current view root. I have used it with
>  Trinidad without issues, so I know it works. If the action is non-null
>  it should only navigate if there is a match. Do you have any "catch"
>  all navigation rules (where the outcome or action are not specified)?
>
>
>  >  I found a solution by myself. Instead of declaring the actionListener as a
>  >  commandLink parameter, I'v implemented ActionListener in the backing bean
>  >  and used f:actionListener after tr:setActionListener. Now the execution
>  >  order is correct.
>  >
>  >  <tr:commandLink text="Neu" partialSubmit="true" immediate="true">
>  >         <tr:setActionListener from="${entity}" to="#{pageFlowScope.finding}"
>  >  />
>  >         <f:actionListener binding="#{backingBean}" />
>  >  </tr:commandLink>
>  >
>  >  IMHO: setActionListener should be executed before any UIComponent
>  >  actionListener. Shall I open a JIRA?
>
>  No, the action listeners should be invoked in the order that they are
>  added to a component. A setActionListener should not get preferential
>  treatment. If you need listeners to be invoked in a specific order,
>  you need to make sure they are added in that order. And even then, the
>  JavaDoc of UIComponent does not guarantee that the listeners will be
>  returned in any specific order:
>  http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/javax/faces/component/UIComponent.html#getFacesListeners(java.lang.Class)
>
>  Maybe the spec. says something?
>
>
>
>
>  >
>  >  --
>  >  Kind regards,
>  >  Mathias
>  >
>  >
>  >
>  >  >
>  >  > On Tue, Apr 15, 2008 at 3:51 PM, Mathias Walter
>  >  > <mathias.walter@gmx.net> wrote:
>  >  > > Hi,
>  >  > >
>  >  > >  is it possible to use partialSubmit without an
>  >  > actionListener and only with
>  >  > >  an action on a tr:commandLink? I tried it, but the whole
>  >  > page is refreshed
>  >  > >  not only the relevant part.
>  >  > >
>  >  > >  I'd like to use actionListener, but unfortunatelly a
>  >  > tr:setActionListener
>  >  > >  will be executed after actionListener. In such case, it's
>  >  > impossibel to set
>  >  > >  a pageFlowScope variable with setActionListener.
>  >  > >
>  >  > >  Example:
>  >  > >
>  >  > >  <tr:commandLink actionListener="#{backingBean.add}" text="Neu"
>  >  > >  partialSubmit="true" immediate="true">
>  >  > >         <tr:setActionListener from="${entity}"
>  >  > to="#{pageFlowScope.data}" />
>  >  > >  </tr:commandLink>
>  >  > >
>  >  > >  This does not work, because backingBean.add is fired before the
>  >  > >  setActionListener.
>  >  > >
>  >  > >  --
>  >  > >  Kind regards,
>  >  > >  Mathias
>  >  > >
>  >  > >
>  >
>  >
>

Mime
View raw message