myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Broekelmann, Mathias" <MBroekelm...@PSI.DE>
Subject RE: Why HtmlDataTablePhaseListener?
Date Thu, 02 Jun 2005 08:26:50 GMT
IMO it would be the best to find out why a phase listener is used for the HtmlDataTable. Because
this might not be related to the alias bean component only.
It´s also an performance issue for the existing phase listener for the datatable. Since every
faces request if the page contains the datatable or not will call the listener which traverses
the component tree to find a HtmlDataTable component.

-----Original Message-----
From: Sylvain Vieujot [] 
Sent: Thursday, June 02, 2005 5:54 AM
To: MyFaces Development
Cc: Broekelmann, Mathias;; Manfred Geiler
Subject: Re: Why HtmlDataTablePhaseListener?

I'm not 100% sure I fully understand how this works for the HtmlDataTable, but if I'm right,
the only solution would be to also have a phaseListener for the alias bean.

This would still raise some other problems :

1) A performance issue

2) I'm not sure we could set/remove the aliases in a reliable manner in the phase listener
as we have no way to know the enclosing tags.

My suggestion is to rather avoid such cases :-(

Maybe there is a better solution though ??


On Mon, 2005-05-30 at 16:12 +0200, Manfred Geiler wrote: 

Yes, I (the author of this class ;-) know that this phase listener is

absolutely necessary for the extended data table to work properly.

This listeners purpose is to make sure that the refresh method for

each extended HtmlDataTable in the component tree is called right

before the render phase begins.

There is no way to make this sure other than by means of this phase

listener, because the render phase can be initiated by different

incidents (see Lifecycle).

Now, why is the refresh method important?

The refresh method clears the internal DataModel of the HtmlDataTable

when all children are valid and therefore there is no need to longer

preserve the DataModel. What is more, we even must omit the internal

DataModel, so that the actual data from the backing bean is taken

during rendering - could have been changed in the meantime by some

application event.

Seems like this is rather an aliasbean issue. Sylvain, are you listening?


2005/5/30, Broekelmann, Mathias <>:

> Hi,


> The x:datatable component uses a phase listener

> (HtmlDataTablePhaseListener) for validation issues. I don't know why

> this is necessary but it causes problems when a aliased bean (through

> aliasbean component) is used in a nested datatable.


> Due to the implementation of the aliasbean component the aliased bean is

> only available in the process phases but not in the before or after

> phase in which the phase listener is called.


> To solve this problem for our application I just commented the phase

> listener out of faces-config.xml. The application is still working as

> expected but I want to make sure that there is no hidden issue which I

> haven't seen so far.


> Does anyone know why this phase listener is necessary?


> Mathias


View raw message