On Thu, 2005-01-20 at 09:27 +0530, Sunil Tiwari wrote:
> Hi,
> I have also faced the same problem.
> if the scope of the bean is request then the data is lost.
> But i can get the values of checkbox correctly. This is because i m getting 
> the value of checkbox by calling getValue method of checkbox component.
> on the other hand, the rows are empty as the data is fetched from the 
> database.
> i think the bean is refreshed if the scope is request.
> So, i used getSessionScope.remove() method to remove the bean once i am done 
> with the particular page.
> you could also try session scope and then remove the bean.

Thanks for the suggestion but for now I solved the problem using a
x:saveState on the list (maybe your solution is better because my way
could be less efficient having to serialize the datas).

The problem I want to understand is if that is the intended behaviour (I
hope not) or a bug, and hence open it on Jira.

I crosspost on -dev since I see not much activity today ;)

I hope someone with deeper understanding can give an advice on that.

Thanks for the reply,
Alex

> ----- Original Message ----- 
> From: "Alessandro Polverini" <[EMAIL PROTECTED]>
> To: "MyFaces Discussion" <[email protected]>
> Sent: Wednesday, January 19, 2005 11:42 PM
> Subject: Strange problem with dataTable and checkboxes
> 
> 
> > Hello,
> > I'm facing a strange problem and since I'm not yet expert of JSF I don't
> > understand if this is a bug or the right behaviour.
> >
> > I'm rendering a form with a text field (call it t1), a checkbox (call it
> > b1) and a dataTable.
> > On every row of the table I have a checkbox, so that I can choose which
> > elements to operate on when I press on the appropriate command button.
> > Think to usual web mail systems where you select messages in the index
> > page and then you press a button to delete them.
> >
> > If the backing bean of the form has session scope, in the actionListener
> > associated to the command button I'm able to check the state of all the
> > rows, and so to operate on them correctly.
> > Now, the problem is that the array of rows is empty if I set the backing
> > bean to have request scope: is this the correct behaviour?
> > If it is, why I can correctly get the state of t1 and b1, and be unable
> > to get the values of the others components? That's what seems strange to
> > me.
> >
> > I try to not use session beans because if the user has multiple open
> > windows to the same application, bad things can happens on pages like
> > that one.
> >
> > An advice would be much appreciated :)
> >
> > Alex
> >
> > P.S.: Please excuse me for my poor English 
> 

Reply via email to