You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Marcus Büttner <mb...@buett.at> on 2010/04/13 12:08:49 UTC

restoreState problem in primefaces DataTable with MyFaces

Hi,

I have a problem with primefaces dataTable in combination with MyFaces. 
The DataTable restoreState method reads from state Object with index 4:

Object[] savedState = (Object[]) ((Object[]) state)[4];
This causes an IndexOutOfBoundException.

I've seen that Mojarra saves the state of StateHelper at index 4  and so 
it works. But the MyFaces state object has a maximum index of 3.
Does the spec define an order for state saving. e.g. stateHelper at 
index 4 in UIComponentBase? Or is it a PrimeFaces bug to read from state 
of the super class directly?

Thx, regards
Marcus


Re: restoreState problem in primefaces DataTable with MyFaces

Posted by Marcus Büttner <mb...@buett.at>.
Ok, I suspected something like this.

thx,
Marcus

Matthias Wessendorf schrieb:
> I agree, a lame bug
>
> -M
>
> On Tue, Apr 13, 2010 at 2:30 PM, Jakob Korherr <ja...@gmail.com> wrote:
>   
>> Hi Marcus,
>>
>> The spec does not say anything about the ordering of values in the state, so
>> this is by all means a PrimeFaces bug. If PrimeFaces wants to use the state
>> of the super class, it has to save and restore this state too, otherwise it
>> accesses "illegal" data.
>>
>> Regards,
>> Jakob
>>
>> 2010/4/13 Marcus Büttner <mb...@buett.at>
>>
>>     
>>> Hi,
>>>
>>> I have a problem with primefaces dataTable in combination with MyFaces. The
>>> DataTable restoreState method reads from state Object with index 4:
>>>
>>> Object[] savedState = (Object[]) ((Object[]) state)[4];
>>> This causes an IndexOutOfBoundException.
>>>
>>> I've seen that Mojarra saves the state of StateHelper at index 4  and so it
>>> works. But the MyFaces state object has a maximum index of 3.
>>> Does the spec define an order for state saving. e.g. stateHelper at index 4
>>> in UIComponentBase? Or is it a PrimeFaces bug to read from state of the
>>> super class directly?
>>>
>>> Thx, regards
>>> Marcus
>>>
>>>
>>>       
>> --
>> Jakob Korherr
>>
>> blog: http://www.jakobk.com
>> twitter: http://twitter.com/jakobkorherr
>> work: http://www.irian.at
>>
>>     
>
>
>
>   


Re: restoreState problem in primefaces DataTable with MyFaces

Posted by Matthias Wessendorf <ma...@apache.org>.
I agree, a lame bug

-M

On Tue, Apr 13, 2010 at 2:30 PM, Jakob Korherr <ja...@gmail.com> wrote:
> Hi Marcus,
>
> The spec does not say anything about the ordering of values in the state, so
> this is by all means a PrimeFaces bug. If PrimeFaces wants to use the state
> of the super class, it has to save and restore this state too, otherwise it
> accesses "illegal" data.
>
> Regards,
> Jakob
>
> 2010/4/13 Marcus Büttner <mb...@buett.at>
>
>> Hi,
>>
>> I have a problem with primefaces dataTable in combination with MyFaces. The
>> DataTable restoreState method reads from state Object with index 4:
>>
>> Object[] savedState = (Object[]) ((Object[]) state)[4];
>> This causes an IndexOutOfBoundException.
>>
>> I've seen that Mojarra saves the state of StateHelper at index 4  and so it
>> works. But the MyFaces state object has a maximum index of 3.
>> Does the spec define an order for state saving. e.g. stateHelper at index 4
>> in UIComponentBase? Or is it a PrimeFaces bug to read from state of the
>> super class directly?
>>
>> Thx, regards
>> Marcus
>>
>>
>
>
> --
> Jakob Korherr
>
> blog: http://www.jakobk.com
> twitter: http://twitter.com/jakobkorherr
> work: http://www.irian.at
>



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf

Re: restoreState problem in primefaces DataTable with MyFaces

Posted by Jakob Korherr <ja...@gmail.com>.
Hi Marcus,

The spec does not say anything about the ordering of values in the state, so
this is by all means a PrimeFaces bug. If PrimeFaces wants to use the state
of the super class, it has to save and restore this state too, otherwise it
accesses "illegal" data.

Regards,
Jakob

2010/4/13 Marcus Büttner <mb...@buett.at>

> Hi,
>
> I have a problem with primefaces dataTable in combination with MyFaces. The
> DataTable restoreState method reads from state Object with index 4:
>
> Object[] savedState = (Object[]) ((Object[]) state)[4];
> This causes an IndexOutOfBoundException.
>
> I've seen that Mojarra saves the state of StateHelper at index 4  and so it
> works. But the MyFaces state object has a maximum index of 3.
> Does the spec define an order for state saving. e.g. stateHelper at index 4
> in UIComponentBase? Or is it a PrimeFaces bug to read from state of the
> super class directly?
>
> Thx, regards
> Marcus
>
>


-- 
Jakob Korherr

blog: http://www.jakobk.com
twitter: http://twitter.com/jakobkorherr
work: http://www.irian.at