You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Matthias Kahlau <mk...@web.de> on 2006/01/25 12:34:09 UTC

Problem with UIData access in session scope when UIData is transient because of serialization

Hi!


I have the following problem:

- Backing-Bean property of type UIData (component-binding)
- Backing-Bean is in session-scope
- Backing-Bean implements Serializable
- Backing-Bean has deleteSelected() method to delete selected rows in the
UIData
- Backing-Bean has scroll() method to scroll the UIData after deletion
- deletion is not performed immediately when processing the postback, but a
confirmation dialogue is shown first
- so deletion is performed after confirming the dialogue

There are two scenarios:
1) Backing-Bean property of type UIData (component-binding) is transient
-> That's necessary to make the Backing-Bean serializable
-> Marked as transient, the UIData can only be accessed in the postback -
later, it is null!
-> That's a problem when the UIData selection evaluation or the scrolling is
performed after showing the confirmation dialogue...
(I can temporarily store the selected objects by accessing UIData before the
confirmation dialogue, but it's bad to scroll before showing the
confirmation dialogue, because the user may decide ro not delete, and the I
cannot scroll back because UIData is null (or is this possible in any way?))

2) Backing-Bean property of type UIData (component-binding) is NOT transient
-> My Backing-Bean is not serializable anymore
-> JBoss throws NotSerializable Exceptions
-> But I can access the UIData after showing the confirmation dialogue, too
(not only when processing the postback)

My Backing-Beans should all be serializable, so do you have an idea of how
to access UIData in requests after the postback, when UIData is marked
transient?


(By the way: Can you explain why UIData not marked transient is accessible
in requests after the postback and not accessible when it's marked
transient?)




Any help would highly be appreciated...


Regards,

Matthias


AW: Problem with UIData access in session scope when UIData is transient because of serialization

Posted by Matthias Kahlau <mk...@web.de>.
Hi!


Does anybody of you have tried to scroll  a data table (setting the first
property) when processing another page, not the page with the data table. Is
this possible?

My problem is that the reference to the data table is null when processing
another request, because the reference is declared as transient. This is
necessary because the related Backing-Bean does have to implement
java.io.Serializable.


Regards,

Matthias

> -----Ursprüngliche Nachricht-----
> Von: users-return-15950-mkahlau=web.de@myfaces.apache.org
> [mailto:users-return-15950-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> von Matthias Kahlau
> Gesendet: Mittwoch, 25. Januar 2006 12:34
> An: Users MyFaces
> Betreff: Problem with UIData access in session scope when UIData is
> transient because of serialization
>
>
> Hi!
>
>
> I have the following problem:
>
> - Backing-Bean property of type UIData (component-binding)
> - Backing-Bean is in session-scope
> - Backing-Bean implements Serializable
> - Backing-Bean has deleteSelected() method to delete selected rows in the
> UIData
> - Backing-Bean has scroll() method to scroll the UIData after deletion
> - deletion is not performed immediately when processing the
> postback, but a
> confirmation dialogue is shown first
> - so deletion is performed after confirming the dialogue
>
> There are two scenarios:
> 1) Backing-Bean property of type UIData (component-binding) is transient
> -> That's necessary to make the Backing-Bean serializable
> -> Marked as transient, the UIData can only be accessed in the postback -
> later, it is null!
> -> That's a problem when the UIData selection evaluation or the
> scrolling is
> performed after showing the confirmation dialogue...
> (I can temporarily store the selected objects by accessing UIData
> before the
> confirmation dialogue, but it's bad to scroll before showing the
> confirmation dialogue, because the user may decide ro not delete,
> and the I
> cannot scroll back because UIData is null (or is this possible in
> any way?))
>
> 2) Backing-Bean property of type UIData (component-binding) is
> NOT transient
> -> My Backing-Bean is not serializable anymore
> -> JBoss throws NotSerializable Exceptions
> -> But I can access the UIData after showing the confirmation
> dialogue, too
> (not only when processing the postback)
>
> My Backing-Beans should all be serializable, so do you have an idea of how
> to access UIData in requests after the postback, when UIData is marked
> transient?
>
>
> (By the way: Can you explain why UIData not marked transient is accessible
> in requests after the postback and not accessible when it's marked
> transient?)
>
>
>
>
> Any help would highly be appreciated...
>
>
> Regards,
>
> Matthias
>