I have a rich:extendedDataTable that shows some model. Now i need to add a new column, that will contain a checkbox in it, so, for each row of the table now i have a checkbox. The initial status of this checkbox will depend on some attribute of the current item in that row, so that´s not a problem.

The problem is that i need to fire some method or listener when any of the checkboxes is pressed, so i can refresh (server-side) the boolean status of the attribute that represent that checkbox. This must be accomplish with ajax. I don´t need to re-render anything, just to refresh the boolean attribute in the database.

I have write a checkbox listener for valuechanged, but i´m not sure if this works with ajax and, besides that, i don´t know how to retrieve the current item, i mean, the item that correspond to the row in which the checkbox was pressed. I have tried a lot of things but neither seems to work.

I really can´t have a commandButton in the new column, which would simplify things a lot in this case. It has to be a checkbox.

The backing-bean associated is session-scoped.

Thanks you and excuse my english!

有帮助吗?

解决方案

I finally solved this by using f:ajax and f:attribute in order to pass the row item.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top