You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Catalin Kormos <ca...@yahoo.com> on 2004/12/09 11:40:43 UTC

dataTable rows deletion problem, urgent! :(

Hi,

I have a x:dataTable that displays rows over multiple
pages...the scenario is pretty simple, i think, a
table with many rows, the user can select one or more
rows by selecting a coresponding checkbox on the firs
column, and hit a "delete" button, or link to remove
those rows from the table. The value, selection, of
the check box is bound to a boolean property of the
row's bean, that has getter and setter.

The first time the user selects some checkboxes (rows)
and hits "delete", everything works fine, the rows are
removed, page reloaded...; then, the user does nothing
else, just selects some rows again, then hits
"delete"... nothing happens!, because the backing bean
is not informed about the new selections. 

The problem disapears if after the first delete
action, the user uses the dataScroller to navigate to
a another page, or does a page reload by hand...

Maybe has do to with the following things : i use
client side state saving, the x:dataScroller,
preserveModel is false for me, i use the x:saveState
to save the table data list displayed between
requests....

Any ideeas would be appreciated, i realy think this is
a bug in myfaces, i saw some other threads about
dataTable updating children components, could be the
same problem? 

Thanks


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250

Re: dataTable rows deletion problem, urgent! :(

Posted by Catalin Kormos <ca...@yahoo.com>.
 
I don't know how the second bean which returns the selected items list, know which rows exacly to return. You're saying that the first bean should keep the entire list of items, and some info about which items that are selected so the second bean knows what to extract from it? after, let's say, a delete action, the first bean needs to propagate the changes to the first bean, correct? i would like to use x:saveState, then x:saveState should save the entire list of items and the info about the selected items (let's say indices list), getted from the first bean?

Manfred Geiler <ma...@apache.org> wrote:
Catalin,
Just an idea:
What about doing a two-level caching?
Cache the data in a model bean and put it in session scope or use 
x:saveState. Then bind your dataTable to another bean that provides the 
data via the getter (internally gets data from the first bean) and 
processes the changed data in the setter and propagates the modified row 
beans back to the first bean.

Manfred


Catalin Kormos schrieb:
> Maybe there is no need to avoid such thing, even if i think it's better 
> to keep and reuse the data when updates from other users its not 
> relevant; in my scenario, the user can choose from an existing list of 
> items the ones he needs, when he chooses them, these are place in 
> another data table (add rows action) and then he can also remove some 
> choosed items (the delete action). So, until he doesn't hit the "finish" 
> button, there is nothing saved into the database yet, and in the 
> meantime a series of actions can be performed on the data. How can i 
> keep the choosed items list between requests? should i save the 
> temporary list into the database and every action made, should execute 
> actions on the database?
> 
> Thanks again, for your interest, i realy appreciate it.
> 
> */Manfred Geiler /* wrote:
> 
> Catalin Kormos schrieb:
> > Yes, that's possible when using preserveDataMode=true; but then
> how can
> > i avoid loading the entire table data from the database after each
> > action?
> 
> Do you really want to avoid loading the table data (i.e. refresh) from
> the database after each action?
> What if another user removed or added a row in the meantime?
> If you only want to avoid loading the *whole* table again when using
> the
> dataScroller, you should rather try to use jdbc features that allow you
> to only load the number of rows you really need.
> 
> 
> > preserveDataModel won't pass the entire table data between
> > requests, so every time i make some changes (delete some rows), the
> > backing bean which holds the table data is reinstantiated and then
> > getTableData is invoked...so if i don't initialize (get it out
> from the
> > database) the table data in the contructor or in the getTableData
> method
> > then nothing gets displayed after the user hits the delete button...
> >
> > I think, an example of a data table in which are showned these basic
> > actions that need to be made on a data table, add or remove some
> rows,
> > and the entire table data is passed between requests not kept in the
> > user session, would be very usefull. In don't know if this is
> possible
> > right now.
> 
> Thomas Spiegl has some really nice table example he will add to the
> MyFaces examples for the next release, as he told me.
> 
> Manfred
> 
> 
> >
> > */Manfred Geiler /* wrote:
> >
> > Catalin,
> > Do not use x:saveState for the dataTable list.
> > Use preserveDataModel attribute in x:dataTable instead and let your
> > model bean get updated by implementing a setter method
> ("setList") for
> > the value property that is responsible for providing the list for the
> > dataTable. This way you will get back the updated dataList with the
> > right checkbox boolean properties.
> >
> > Manfred
> >
> >
> > Catalin Kormos schrieb:
> > > Hi Manfred, thanks for you interest,
> > >
> > > The dataTable is nested inside of a form, and the delete
> > button(link)
> > > doesn't have the "immediate" attribute set to "true" unless this
> > is the
> > > default value, because i have't specified it at all.
> > >
> > > I've resolved the problem by keeping the list of data the table
> > displays
> > > in the user session, because i've realized that x:saveState won't
> > get
> > > the right state, it does't get the data with the selections
> made; it
> > > seems that x:saveState gets the table data before any changes are
> > made
> > > on the items of that list (the selection value is not submited
> > yet). Is
> > > this possible?
> > >
> > > Thanks
> > >
> > > */Manfred Geiler /* wrote:
> > >
> > > Catalin,
> > > Please make sure:
> > > - that your dataTable is nested within a form
> > > - that your delete button does *not* have the immediate
> attribute set
> > > (necessary to get the checkboxes updated)
> > >
> > > Manfred
> > >
> > >
> > > Catalin Kormos schrieb:
> > > > Hi,
> > > >
> > > > I have a x:dataTable that displays rows over multiple
> > > > pages...the scenario is pretty simple, i think, a
> > > > table with many rows, the user can select one or more
> > > > rows by selecting a coresponding checkbox on the firs
> > > > column, and hit a "delete" button, or link to remove
> > > > those rows from the table. The value, selection, of
> > > > the check box is bound to a boolean property of the
> > > > row's bean, that has getter and setter.
> > > >
> > > > The first time the user selects some checkboxes (rows)
> > > > and hits "delete", everything works fine, the rows are
> > > > removed, page reloaded...; then, the user does nothing
> > > > else, just selects some rows again, then hits
> > > > "delete"... nothing happens!, because the backing bean
> > > > is not informed about the new selections.
> > > >
> > > > The problem disapears if after the first delete
> > > > action, the user uses the dataScroller to navigate to
> > > > a another page, or does a page reload by hand...
> > > >
> > > > Maybe has do to with the following things : i use
> > > > client side state saving, the x:dataScroller,
> > > > preserveModel is false for me, i use the x:saveState
> > > > to save the table data list displayed between
> > > > requests....
> > > >
> > > > Any ideeas would be appreciated, i realy think this is
> > > > a bug in myfaces, i saw some other threads about
> > > > dataTable updating children components, could be the
> > > > same problem?
> > > >
> > > > Thanks
> > > >
> > > >
> > > >
> > > > __________________________________
> > > > Do you Yahoo!?
> > > > Yahoo! Mail - Find what you need with new enhanced search.
> > > > http://info.mail.yahoo.com/mail_250
> > > >
> > > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam? Yahoo! Mail has the best spam protection around
> > > http://mail.yahoo.com
> > >
> >
> >
> ------------------------------------------------------------------------
> > Do you Yahoo!?
> > Yahoo! Mail
> >
> > - Helps protect you from nasty viruses.
> 
> ------------------------------------------------------------------------
> Do you Yahoo!?
> Take Yahoo! Mail with you! 
> 
> Get it on your mobile phone.


		
---------------------------------
Do you Yahoo!?
 Yahoo! Mail - 250MB free storage. Do more. Manage less.

Re: dataTable rows deletion problem, urgent! :(

Posted by Manfred Geiler <ma...@apache.org>.
Catalin,
Just an idea:
What about doing a two-level caching?
Cache the data in a model bean and put it in session scope or use 
x:saveState. Then bind your dataTable to another bean that provides the 
data via the getter (internally gets data from the first bean) and 
processes the changed data in the setter and propagates the modified row 
beans back to the first bean.

Manfred


Catalin Kormos schrieb:
> Maybe there is no need to avoid such thing, even if i think it's better 
> to keep and reuse the data when updates from other users its not 
> relevant; in my scenario, the user can choose from an existing list of 
> items the ones he needs, when he chooses them, these are place in 
> another data table (add rows action) and then he can also remove some 
> choosed items (the delete action). So, until he doesn't hit the "finish" 
> button, there is nothing saved into the database yet, and in the 
> meantime a series of actions can be performed on the data. How can i 
> keep the choosed items list between requests? should i save the 
> temporary list into the database and every action made, should execute 
> actions on the database?
>  
> Thanks again, for your interest, i realy appreciate it.
> 
> */Manfred Geiler <ma...@apache.org>/* wrote:
> 
>     Catalin Kormos schrieb:
>      > Yes, that's possible when using preserveDataMode=true; but then
>     how can
>      > i avoid loading the entire table data from the database after each
>      > action?
> 
>     Do you really want to avoid loading the table data (i.e. refresh) from
>     the database after each action?
>     What if another user removed or added a row in the meantime?
>     If you only want to avoid loading the *whole* table again when using
>     the
>     dataScroller, you should rather try to use jdbc features that allow you
>     to only load the number of rows you really need.
> 
> 
>      > preserveDataModel won't pass the entire table data between
>      > requests, so every time i make some changes (delete some rows), the
>      > backing bean which holds the table data is reinstantiated and then
>      > getTableData is invoked...so if i don't initialize (get it out
>     from the
>      > database) the table data in the contructor or in the getTableData
>     method
>      > then nothing gets displayed after the user hits the delete button...
>      >
>      > I think, an example of a data table in which are showned these basic
>      > actions that need to be made on a data table, add or remove some
>     rows,
>      > and the entire table data is passed between requests not kept in the
>      > user session, would be very usefull. In don't know if this is
>     possible
>      > right now.
> 
>     Thomas Spiegl has some really nice table example he will add to the
>     MyFaces examples for the next release, as he told me.
> 
>     Manfred
> 
> 
>      >
>      > */Manfred Geiler /* wrote:
>      >
>      > Catalin,
>      > Do not use x:saveState for the dataTable list.
>      > Use preserveDataModel attribute in x:dataTable instead and let your
>      > model bean get updated by implementing a setter method
>     ("setList") for
>      > the value property that is responsible for providing the list for the
>      > dataTable. This way you will get back the updated dataList with the
>      > right checkbox boolean properties.
>      >
>      > Manfred
>      >
>      >
>      > Catalin Kormos schrieb:
>      > > Hi Manfred, thanks for you interest,
>      > >
>      > > The dataTable is nested inside of a form, and the delete
>      > button(link)
>      > > doesn't have the "immediate" attribute set to "true" unless this
>      > is the
>      > > default value, because i have't specified it at all.
>      > >
>      > > I've resolved the problem by keeping the list of data the table
>      > displays
>      > > in the user session, because i've realized that x:saveState won't
>      > get
>      > > the right state, it does't get the data with the selections
>     made; it
>      > > seems that x:saveState gets the table data before any changes are
>      > made
>      > > on the items of that list (the selection value is not submited
>      > yet). Is
>      > > this possible?
>      > >
>      > > Thanks
>      > >
>      > > */Manfred Geiler /* wrote:
>      > >
>      > > Catalin,
>      > > Please make sure:
>      > > - that your dataTable is nested within a form
>      > > - that your delete button does *not* have the immediate
>     attribute set
>      > > (necessary to get the checkboxes updated)
>      > >
>      > > Manfred
>      > >
>      > >
>      > > Catalin Kormos schrieb:
>      > > > Hi,
>      > > >
>      > > > I have a x:dataTable that displays rows over multiple
>      > > > pages...the scenario is pretty simple, i think, a
>      > > > table with many rows, the user can select one or more
>      > > > rows by selecting a coresponding checkbox on the firs
>      > > > column, and hit a "delete" button, or link to remove
>      > > > those rows from the table. The value, selection, of
>      > > > the check box is bound to a boolean property of the
>      > > > row's bean, that has getter and setter.
>      > > >
>      > > > The first time the user selects some checkboxes (rows)
>      > > > and hits "delete", everything works fine, the rows are
>      > > > removed, page reloaded...; then, the user does nothing
>      > > > else, just selects some rows again, then hits
>      > > > "delete"... nothing happens!, because the backing bean
>      > > > is not informed about the new selections.
>      > > >
>      > > > The problem disapears if after the first delete
>      > > > action, the user uses the dataScroller to navigate to
>      > > > a another page, or does a page reload by hand...
>      > > >
>      > > > Maybe has do to with the following things : i use
>      > > > client side state saving, the x:dataScroller,
>      > > > preserveModel is false for me, i use the x:saveState
>      > > > to save the table data list displayed between
>      > > > requests....
>      > > >
>      > > > Any ideeas would be appreciated, i realy think this is
>      > > > a bug in myfaces, i saw some other threads about
>      > > > dataTable updating children components, could be the
>      > > > same problem?
>      > > >
>      > > > Thanks
>      > > >
>      > > >
>      > > >
>      > > > __________________________________
>      > > > Do you Yahoo!?
>      > > > Yahoo! Mail - Find what you need with new enhanced search.
>      > > > http://info.mail.yahoo.com/mail_250
>      > > >
>      > > >
>      > >
>      > > __________________________________________________
>      > > Do You Yahoo!?
>      > > Tired of spam? Yahoo! Mail has the best spam protection around
>      > > http://mail.yahoo.com
>      > >
>      >
>      >
>     ------------------------------------------------------------------------
>      > Do you Yahoo!?
>      > Yahoo! Mail
>      >
>      > - Helps protect you from nasty viruses.
> 
> ------------------------------------------------------------------------
> Do you Yahoo!?
> Take Yahoo! Mail with you! 
> <http://us.rd.yahoo.com/mail_us/taglines/mobile/*http://mobile.yahoo.com/maildemo> 
> Get it on your mobile phone.

Re: dataTable rows deletion problem, urgent! :(

Posted by Catalin Kormos <ca...@yahoo.com>.
Maybe there is no need to avoid such thing, even if i think it's better to keep and reuse the data when updates from other users its not relevant; in my scenario, the user can choose from an existing list of items the ones he needs, when he chooses them, these are place in another data table (add rows action) and then he can also remove some choosed items (the delete action). So, until he doesn't hit the "finish" button, there is nothing saved into the database yet, and in the meantime a series of actions can be performed on the data. How can i keep the choosed items list between requests? should i save the temporary list into the database and every action made, should execute actions on the database?
 
Thanks again, for your interest, i realy appreciate it.

Manfred Geiler <ma...@apache.org> wrote:
Catalin Kormos schrieb:
> Yes, that's possible when using preserveDataMode=true; but then how can 
> i avoid loading the entire table data from the database after each 
> action?

Do you really want to avoid loading the table data (i.e. refresh) from 
the database after each action?
What if another user removed or added a row in the meantime?
If you only want to avoid loading the *whole* table again when using the 
dataScroller, you should rather try to use jdbc features that allow you 
to only load the number of rows you really need.


> preserveDataModel won't pass the entire table data between 
> requests, so every time i make some changes (delete some rows), the 
> backing bean which holds the table data is reinstantiated and then 
> getTableData is invoked...so if i don't initialize (get it out from the 
> database) the table data in the contructor or in the getTableData method 
> then nothing gets displayed after the user hits the delete button...
> 
> I think, an example of a data table in which are showned these basic 
> actions that need to be made on a data table, add or remove some rows, 
> and the entire table data is passed between requests not kept in the 
> user session, would be very usefull. In don't know if this is possible 
> right now.

Thomas Spiegl has some really nice table example he will add to the 
MyFaces examples for the next release, as he told me.

Manfred


> 
> */Manfred Geiler /* wrote:
> 
> Catalin,
> Do not use x:saveState for the dataTable list.
> Use preserveDataModel attribute in x:dataTable instead and let your
> model bean get updated by implementing a setter method ("setList") for
> the value property that is responsible for providing the list for the
> dataTable. This way you will get back the updated dataList with the
> right checkbox boolean properties.
> 
> Manfred
> 
> 
> Catalin Kormos schrieb:
> > Hi Manfred, thanks for you interest,
> >
> > The dataTable is nested inside of a form, and the delete
> button(link)
> > doesn't have the "immediate" attribute set to "true" unless this
> is the
> > default value, because i have't specified it at all.
> >
> > I've resolved the problem by keeping the list of data the table
> displays
> > in the user session, because i've realized that x:saveState won't
> get
> > the right state, it does't get the data with the selections made; it
> > seems that x:saveState gets the table data before any changes are
> made
> > on the items of that list (the selection value is not submited
> yet). Is
> > this possible?
> >
> > Thanks
> >
> > */Manfred Geiler /* wrote:
> >
> > Catalin,
> > Please make sure:
> > - that your dataTable is nested within a form
> > - that your delete button does *not* have the immediate attribute set
> > (necessary to get the checkboxes updated)
> >
> > Manfred
> >
> >
> > Catalin Kormos schrieb:
> > > Hi,
> > >
> > > I have a x:dataTable that displays rows over multiple
> > > pages...the scenario is pretty simple, i think, a
> > > table with many rows, the user can select one or more
> > > rows by selecting a coresponding checkbox on the firs
> > > column, and hit a "delete" button, or link to remove
> > > those rows from the table. The value, selection, of
> > > the check box is bound to a boolean property of the
> > > row's bean, that has getter and setter.
> > >
> > > The first time the user selects some checkboxes (rows)
> > > and hits "delete", everything works fine, the rows are
> > > removed, page reloaded...; then, the user does nothing
> > > else, just selects some rows again, then hits
> > > "delete"... nothing happens!, because the backing bean
> > > is not informed about the new selections.
> > >
> > > The problem disapears if after the first delete
> > > action, the user uses the dataScroller to navigate to
> > > a another page, or does a page reload by hand...
> > >
> > > Maybe has do to with the following things : i use
> > > client side state saving, the x:dataScroller,
> > > preserveModel is false for me, i use the x:saveState
> > > to save the table data list displayed between
> > > requests....
> > >
> > > Any ideeas would be appreciated, i realy think this is
> > > a bug in myfaces, i saw some other threads about
> > > dataTable updating children components, could be the
> > > same problem?
> > >
> > > Thanks
> > >
> > >
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > Yahoo! Mail - Find what you need with new enhanced search.
> > > http://info.mail.yahoo.com/mail_250
> > >
> > >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> 
> ------------------------------------------------------------------------
> Do you Yahoo!?
> Yahoo! Mail 
> 
> - Helps protect you from nasty viruses.

		
---------------------------------
Do you Yahoo!?
 Take Yahoo! Mail with you! Get it on your mobile phone.

Re: dataTable rows deletion problem, urgent! :(

Posted by Manfred Geiler <ma...@apache.org>.
Catalin Kormos schrieb:
> Yes, that's possible when using preserveDataMode=true; but then how can 
> i avoid loading the entire table data from the database after each 
> action?

Do you really want to avoid loading the table data (i.e. refresh) from 
the database after each action?
What if another user removed or added a row in the meantime?
If you only want to avoid loading the *whole* table again when using the 
dataScroller, you should rather try to use jdbc features that allow you 
to only load the number of rows you really need.


> preserveDataModel won't pass the entire table data between 
> requests, so every time i make some changes (delete some rows), the 
> backing bean which holds the table data is reinstantiated and then 
> getTableData is invoked...so if i don't initialize (get it out from the 
> database) the table data in the contructor or in the getTableData method 
> then nothing gets displayed after the user hits the delete button...
>  
> I think, an example of a data table in which are showned these basic 
> actions that need to be made on a data table, add or remove some rows, 
> and the entire table data is passed between requests not kept in the 
> user session, would be very usefull. In don't know if this is possible 
> right now.

Thomas Spiegl has some really nice table example he will add to the 
MyFaces examples for the next release, as he told me.

Manfred


> 
> */Manfred Geiler <ma...@apache.org>/* wrote:
> 
>     Catalin,
>     Do not use x:saveState for the dataTable list.
>     Use preserveDataModel attribute in x:dataTable instead and let your
>     model bean get updated by implementing a setter method ("setList") for
>     the value property that is responsible for providing the list for the
>     dataTable. This way you will get back the updated dataList with the
>     right checkbox boolean properties.
> 
>     Manfred
> 
> 
>     Catalin Kormos schrieb:
>      > Hi Manfred, thanks for you interest,
>      >
>      > The dataTable is nested inside of a form, and the delete
>     button(link)
>      > doesn't have the "immediate" attribute set to "true" unless this
>     is the
>      > default value, because i have't specified it at all.
>      >
>      > I've resolved the problem by keeping the list of data the table
>     displays
>      > in the user session, because i've realized that x:saveState won't
>     get
>      > the right state, it does't get the data with the selections made; it
>      > seems that x:saveState gets the table data before any changes are
>     made
>      > on the items of that list (the selection value is not submited
>     yet). Is
>      > this possible?
>      >
>      > Thanks
>      >
>      > */Manfred Geiler /* wrote:
>      >
>      > Catalin,
>      > Please make sure:
>      > - that your dataTable is nested within a form
>      > - that your delete button does *not* have the immediate attribute set
>      > (necessary to get the checkboxes updated)
>      >
>      > Manfred
>      >
>      >
>      > Catalin Kormos schrieb:
>      > > Hi,
>      > >
>      > > I have a x:dataTable that displays rows over multiple
>      > > pages...the scenario is pretty simple, i think, a
>      > > table with many rows, the user can select one or more
>      > > rows by selecting a coresponding checkbox on the firs
>      > > column, and hit a "delete" button, or link to remove
>      > > those rows from the table. The value, selection, of
>      > > the check box is bound to a boolean property of the
>      > > row's bean, that has getter and setter.
>      > >
>      > > The first time the user selects some checkboxes (rows)
>      > > and hits "delete", everything works fine, the rows are
>      > > removed, page reloaded...; then, the user does nothing
>      > > else, just selects some rows again, then hits
>      > > "delete"... nothing happens!, because the backing bean
>      > > is not informed about the new selections.
>      > >
>      > > The problem disapears if after the first delete
>      > > action, the user uses the dataScroller to navigate to
>      > > a another page, or does a page reload by hand...
>      > >
>      > > Maybe has do to with the following things : i use
>      > > client side state saving, the x:dataScroller,
>      > > preserveModel is false for me, i use the x:saveState
>      > > to save the table data list displayed between
>      > > requests....
>      > >
>      > > Any ideeas would be appreciated, i realy think this is
>      > > a bug in myfaces, i saw some other threads about
>      > > dataTable updating children components, could be the
>      > > same problem?
>      > >
>      > > Thanks
>      > >
>      > >
>      > >
>      > > __________________________________
>      > > Do you Yahoo!?
>      > > Yahoo! Mail - Find what you need with new enhanced search.
>      > > http://info.mail.yahoo.com/mail_250
>      > >
>      > >
>      >
>      > __________________________________________________
>      > Do You Yahoo!?
>      > Tired of spam? Yahoo! Mail has the best spam protection around
>      > http://mail.yahoo.com
>      >
> 
> ------------------------------------------------------------------------
> Do you Yahoo!?
> Yahoo! Mail 
> <http://us.rd.yahoo.com/mail_us/taglines/virus/*http://promotions.yahoo.com/new_mail/static/protection.html> 
> - Helps protect you from nasty viruses.

Re: dataTable rows deletion problem, urgent! :(

Posted by Catalin Kormos <ca...@yahoo.com>.
Yes, that's possible when using preserveDataMode=true; but then how can i avoid loading the entire table data from the database after each action? preserveDataModel won't pass the entire table data between requests, so every time i make some changes (delete some rows), the backing bean which holds the table data is reinstantiated and then getTableData is invoked...so if i don't initialize (get it out from the database) the table data in the contructor or in the getTableData method then nothing gets displayed after the user hits the delete button...
 
I think, an example of a data table in which are showned these basic actions that need to be made on a data table, add or remove some rows, and the entire table data is passed between requests not kept in the user session, would be very usefull. In don't know if this is possible right now.

Manfred Geiler <ma...@apache.org> wrote:
Catalin,
Do not use x:saveState for the dataTable list.
Use preserveDataModel attribute in x:dataTable instead and let your 
model bean get updated by implementing a setter method ("setList") for 
the value property that is responsible for providing the list for the 
dataTable. This way you will get back the updated dataList with the 
right checkbox boolean properties.

Manfred


Catalin Kormos schrieb:
> Hi Manfred, thanks for you interest,
> 
> The dataTable is nested inside of a form, and the delete button(link) 
> doesn't have the "immediate" attribute set to "true" unless this is the 
> default value, because i have't specified it at all.
> 
> I've resolved the problem by keeping the list of data the table displays 
> in the user session, because i've realized that x:saveState won't get 
> the right state, it does't get the data with the selections made; it 
> seems that x:saveState gets the table data before any changes are made 
> on the items of that list (the selection value is not submited yet). Is 
> this possible?
> 
> Thanks
> 
> */Manfred Geiler /* wrote:
> 
> Catalin,
> Please make sure:
> - that your dataTable is nested within a form
> - that your delete button does *not* have the immediate attribute set
> (necessary to get the checkboxes updated)
> 
> Manfred
> 
> 
> Catalin Kormos schrieb:
> > Hi,
> >
> > I have a x:dataTable that displays rows over multiple
> > pages...the scenario is pretty simple, i think, a
> > table with many rows, the user can select one or more
> > rows by selecting a coresponding checkbox on the firs
> > column, and hit a "delete" button, or link to remove
> > those rows from the table. The value, selection, of
> > the check box is bound to a boolean property of the
> > row's bean, that has getter and setter.
> >
> > The first time the user selects some checkboxes (rows)
> > and hits "delete", everything works fine, the rows are
> > removed, page reloaded...; then, the user does nothing
> > else, just selects some rows again, then hits
> > "delete"... nothing happens!, because the backing bean
> > is not informed about the new selections.
> >
> > The problem disapears if after the first delete
> > action, the user uses the dataScroller to navigate to
> > a another page, or does a page reload by hand...
> >
> > Maybe has do to with the following things : i use
> > client side state saving, the x:dataScroller,
> > preserveModel is false for me, i use the x:saveState
> > to save the table data list displayed between
> > requests....
> >
> > Any ideeas would be appreciated, i realy think this is
> > a bug in myfaces, i saw some other threads about
> > dataTable updating children components, could be the
> > same problem?
> >
> > Thanks
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Mail - Find what you need with new enhanced search.
> > http://info.mail.yahoo.com/mail_250
> >
> >
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> 

		
---------------------------------
Do you Yahoo!?
 Yahoo! Mail - Helps protect you from nasty viruses.

Re: dataTable rows deletion problem, urgent! :(

Posted by Manfred Geiler <ma...@apache.org>.
Catalin,
Do not use x:saveState for the dataTable list.
Use preserveDataModel attribute in x:dataTable instead and let your 
model bean get updated by implementing a setter method ("setList") for 
the value property that is responsible for providing the list for the 
dataTable. This way you will get back the updated dataList with the 
right checkbox boolean properties.

Manfred


Catalin Kormos schrieb:
> Hi Manfred, thanks for you interest,
>  
> The dataTable is nested inside of a form, and the delete button(link) 
> doesn't have the "immediate" attribute set to "true" unless this is the 
> default value, because i have't specified it at all.
>  
> I've resolved the problem by keeping the list of data the table displays 
> in the user session, because i've realized that x:saveState won't get 
> the right state, it does't get the data with the selections made;  it 
> seems that x:saveState gets the table data before any changes are made 
> on the items of that list (the selection value is not submited yet). Is 
> this possible?
>  
> Thanks
> 
> */Manfred Geiler <ma...@apache.org>/* wrote:
> 
>     Catalin,
>     Please make sure:
>     - that your dataTable is nested within a form
>     - that your delete button does *not* have the immediate attribute set
>     (necessary to get the checkboxes updated)
> 
>     Manfred
> 
> 
>     Catalin Kormos schrieb:
>      > Hi,
>      >
>      > I have a x:dataTable that displays rows over multiple
>      > pages...the scenario is pretty simple, i think, a
>      > table with many rows, the user can select one or more
>      > rows by selecting a coresponding checkbox on the firs
>      > column, and hit a "delete" button, or link to remove
>      > those rows from the table. The value, selection, of
>      > the check box is bound to a boolean property of the
>      > row's bean, that has getter and setter.
>      >
>      > The first time the user selects some checkboxes (rows)
>      > and hits "delete", everything works fine, the rows are
>      > removed, page reloaded...; then, the user does nothing
>      > else, just selects some rows again, then hits
>      > "delete"... nothing happens!, because the backing bean
>      > is not informed about the new selections.
>      >
>      > The problem disapears if after the first delete
>      > action, the user uses the dataScroller to navigate to
>      > a another page, or does a page reload by hand...
>      >
>      > Maybe has do to with the following things : i use
>      > client side state saving, the x:dataScroller,
>      > preserveModel is false for me, i use the x:saveState
>      > to save the table data list displayed between
>      > requests....
>      >
>      > Any ideeas would be appreciated, i realy think this is
>      > a bug in myfaces, i saw some other threads about
>      > dataTable updating children components, could be the
>      > same problem?
>      >
>      > Thanks
>      >
>      >
>      >
>      > __________________________________
>      > Do you Yahoo!?
>      > Yahoo! Mail - Find what you need with new enhanced search.
>      > http://info.mail.yahoo.com/mail_250
>      >
>      >
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> 

Re: dataTable rows deletion problem, urgent! :(

Posted by Catalin Kormos <ca...@yahoo.com>.
Hi Manfred, thanks for you interest,
 
The dataTable is nested inside of a form, and the delete button(link) doesn't have the "immediate" attribute set to "true" unless this is the default value, because i have't specified it at all.
 
I've resolved the problem by keeping the list of data the table displays in the user session, because i've realized that x:saveState won't get the right state, it does't get the data with the selections made;  it seems that x:saveState gets the table data before any changes are made on the items of that list (the selection value is not submited yet). Is this possible?
 
Thanks

Manfred Geiler <ma...@apache.org> wrote:
Catalin,
Please make sure:
- that your dataTable is nested within a form
- that your delete button does *not* have the immediate attribute set 
(necessary to get the checkboxes updated)

Manfred


Catalin Kormos schrieb:
> Hi,
> 
> I have a x:dataTable that displays rows over multiple
> pages...the scenario is pretty simple, i think, a
> table with many rows, the user can select one or more
> rows by selecting a coresponding checkbox on the firs
> column, and hit a "delete" button, or link to remove
> those rows from the table. The value, selection, of
> the check box is bound to a boolean property of the
> row's bean, that has getter and setter.
> 
> The first time the user selects some checkboxes (rows)
> and hits "delete", everything works fine, the rows are
> removed, page reloaded...; then, the user does nothing
> else, just selects some rows again, then hits
> "delete"... nothing happens!, because the backing bean
> is not informed about the new selections. 
> 
> The problem disapears if after the first delete
> action, the user uses the dataScroller to navigate to
> a another page, or does a page reload by hand...
> 
> Maybe has do to with the following things : i use
> client side state saving, the x:dataScroller,
> preserveModel is false for me, i use the x:saveState
> to save the table data list displayed between
> requests....
> 
> Any ideeas would be appreciated, i realy think this is
> a bug in myfaces, i saw some other threads about
> dataTable updating children components, could be the
> same problem? 
> 
> Thanks
> 
> 
> 
> __________________________________ 
> Do you Yahoo!? 
> Yahoo! Mail - Find what you need with new enhanced search.
> http://info.mail.yahoo.com/mail_250
> 
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: dataTable rows deletion problem, urgent! :(

Posted by Manfred Geiler <ma...@apache.org>.
Catalin,
Please make sure:
- that your dataTable is nested within a form
- that your delete button does *not* have the immediate attribute set 
(necessary to get the checkboxes updated)

Manfred


Catalin Kormos schrieb:
> Hi,
> 
> I have a x:dataTable that displays rows over multiple
> pages...the scenario is pretty simple, i think, a
> table with many rows, the user can select one or more
> rows by selecting a coresponding checkbox on the firs
> column, and hit a "delete" button, or link to remove
> those rows from the table. The value, selection, of
> the check box is bound to a boolean property of the
> row's bean, that has getter and setter.
> 
> The first time the user selects some checkboxes (rows)
> and hits "delete", everything works fine, the rows are
> removed, page reloaded...; then, the user does nothing
> else, just selects some rows again, then hits
> "delete"... nothing happens!, because the backing bean
> is not informed about the new selections. 
> 
> The problem disapears if after the first delete
> action, the user uses the dataScroller to navigate to
> a another page, or does a page reload by hand...
> 
> Maybe has do to with the following things : i use
> client side state saving, the x:dataScroller,
> preserveModel is false for me, i use the x:saveState
> to save the table data list displayed between
> requests....
> 
> Any ideeas would be appreciated, i realy think this is
> a bug in myfaces, i saw some other threads about
> dataTable updating children components, could be the
> same problem? 
> 
> Thanks
> 
> 
> 		
> __________________________________ 
> Do you Yahoo!? 
> Yahoo! Mail - Find what you need with new enhanced search.
> http://info.mail.yahoo.com/mail_250
> 
>