You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-user@incubator.apache.org by Renzo Tomaselli <re...@tecnotp.it> on 2007/04/19 08:35:06 UTC
[Trinidad] tr:table cannot change columns between request and response
Hi all, I'using tr:table successfully since several months, using
c:forEach (Facelets) to render all columns from a dynamic set.
Now I introduced a widget to allow users to select columns, so that
current table might be rendered with a different number/order of columns.
I was fairly surprised to get an IndexOutOfBound exception from Trinidad
(from StampState.restoreChildStampState, after
setRowIndex/postRowDataChange/_restoreStampState).
Basically it seems that the restored view model - built on say N columns
- is used at rendering time where columns where reduced to N - 1,
according to the new DataModel.
The exception is due to a column mismatch, since there are different
column children there.
Also I noticed that - when using the binding attribute to get/set the
table component - these methods are not called while rendering, if the
component has been previously restored. Thus I have no way to return a
null component, to force its creation according to a new DataModel.
Is there any workaround or is this a kind of fixed semantics which does
not allow to change columns ?
Is there any other way to force component re-creation after restore view
phase ?
Thanks -- Renzo
Re: [Trinidad] tr:table cannot change columns between request and
response
Posted by Renzo Tomaselli <re...@tecnotp.it>.
There is a simple workaround to reset component stampState:
- getting the table component by means of the "binding" attribute.
- calling ((UIXTable)table).resetStampState() whenever the model
(columns, rows ?) changes between restore view and next rendering.
I don't know how much this was intentional, nevertheless that method is
public.
-- Renzo
Renzo Tomaselli wrote:
> Well, the issue seems located in UICollection.java, line #1102.
> Current column stampState is retrieved using row key and column
> position as a stampId. This matches a wrong status, since its contents
> do not match children count of the actual column at that position. The
> UI table component seems ok.
> I don't know how to fix it or how to reset stampState after the model
> changed, though.
>
> -- Renzo
>
> Renzo Tomaselli wrote:
>> Hi all, I'using tr:table successfully since several months, using
>> c:forEach (Facelets) to render all columns from a dynamic set.
>> Now I introduced a widget to allow users to select columns, so that
>> current table might be rendered with a different number/order of
>> columns.
>> I was fairly surprised to get an IndexOutOfBound exception from
>> Trinidad (from StampState.restoreChildStampState, after
>> setRowIndex/postRowDataChange/_restoreStampState).
>> Basically it seems that the restored view model - built on say N
>> columns - is used at rendering time where columns where reduced to N
>> - 1, according to the new DataModel.
>> The exception is due to a column mismatch, since there are different
>> column children there.
>> Also I noticed that - when using the binding attribute to get/set the
>> table component - these methods are not called while rendering, if
>> the component has been previously restored. Thus I have no way to
>> return a null component, to force its creation according to a new
>> DataModel.
>> Is there any workaround or is this a kind of fixed semantics which
>> does not allow to change columns ?
>> Is there any other way to force component re-creation after restore
>> view phase ?
>>
>> Thanks -- Renzo
>>
>>
>>
>>
>
>
Re: [Trinidad] tr:table cannot change columns between request and
response
Posted by Renzo Tomaselli <re...@tecnotp.it>.
Well, the issue seems located in UICollection.java, line #1102.
Current column stampState is retrieved using row key and column position
as a stampId. This matches a wrong status, since its contents do not
match children count of the actual column at that position. The UI table
component seems ok.
I don't know how to fix it or how to reset stampState after the model
changed, though.
-- Renzo
Renzo Tomaselli wrote:
> Hi all, I'using tr:table successfully since several months, using
> c:forEach (Facelets) to render all columns from a dynamic set.
> Now I introduced a widget to allow users to select columns, so that
> current table might be rendered with a different number/order of columns.
> I was fairly surprised to get an IndexOutOfBound exception from
> Trinidad (from StampState.restoreChildStampState, after
> setRowIndex/postRowDataChange/_restoreStampState).
> Basically it seems that the restored view model - built on say N
> columns - is used at rendering time where columns where reduced to N -
> 1, according to the new DataModel.
> The exception is due to a column mismatch, since there are different
> column children there.
> Also I noticed that - when using the binding attribute to get/set the
> table component - these methods are not called while rendering, if the
> component has been previously restored. Thus I have no way to return a
> null component, to force its creation according to a new DataModel.
> Is there any workaround or is this a kind of fixed semantics which
> does not allow to change columns ?
> Is there any other way to force component re-creation after restore
> view phase ?
>
> Thanks -- Renzo
>
>
>
>