开发者

Adding a row to an existing datatable in JSF [duplicate]

This question already has answers here: How to Dynamically add a row in a table in JSF? (2 answers) Closed 8 years ago.

I have a requirement of changing an existing JSF 1.1 project where I need to add an additional row to a datatable on click of a button. Currently the datatable loads 3 rows from the backing bean and this new button should add additional rows to the datatable on each click. Using the suggestion provided 开发者_JAVA技巧by http://balusc.blogspot.com/2006/06/using-datatables.html I was able to display the additional row on the UI but I could not save the new data back to the database because the backing bean is in request scope and I cannot change the scope of this bean as it would create other issues. Can somebody provide me a solution to display the new row and also to save the data back to the database when the backing bean is in request scope.

Thanks Shyam


but I could not save the new data back to the database because the backing bean is in request scope

The linked article provides code examples how to do this in the request scope. If you fail in saving the new rows, then apparently the data (pre)loading logic is incorrect. I'd suggest to go through the article from the beginning.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜