Adding Empty Rows to DataTable
Hi all,I am new to primefaces.I want to ask if there is any way out to add empty rows in DataTable without putting ant empty records in Backing Bean.I want backing bean to contain only real data and no dummy empty records,still,for the look and feel purpose,I want to add ceratain empty rows in dataTable.Is that possible through jQuery or any other method?
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
Click following URL, and that code should help you implement something like the add() method on that page, and use the Item attribute, too, which is necessary, if you use his approach. I recommend you read that entire blog as well as other blogs on his blogspot site.
http://balusc.blogspot.com/2010/06/bene ... SimpleCRUD
Also, you might want to ask these type of questions in Community > PrimeFaces Core (URL below).
viewforum.php?f=3
http://balusc.blogspot.com/2010/06/bene ... SimpleCRUD
Also, you might want to ask these type of questions in Community > PrimeFaces Core (URL below).
viewforum.php?f=3
Howard
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
Hi Smith,
Thanks for the reply.But this is not what I wanted.As I told,I want to add empty rows with the help of some code on the client side,I don't want to add unnecessary records on the server side just for adding empty records.In the blog,add method is on server side which adds other empty rows,This is not what I wanted.
Thanks for the reply.But this is not what I wanted.As I told,I want to add empty rows with the help of some code on the client side,I don't want to add unnecessary records on the server side just for adding empty records.In the blog,add method is on server side which adds other empty rows,This is not what I wanted.
My guess is it isn't really possible to add emtpy rows only to the front-end. At the moment we are doing it by adding a empty object to the back-end and on posts check for empties and delete them so they won't end up in the database.
JSF 2.0
Primefaces 3.2
Tomcat 7.0
Primefaces 3.2
Tomcat 7.0
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
Okay/understood. I prefer coding JSF over jquery. Click URL below and go to related links on the right side of the page, if necessary.Ravi2000 wrote:Hi Smith,
Thanks for the reply.But this is not what I wanted.As I told,I want to add empty rows with the help of some code on the client side,I don't want to add unnecessary records on the server side just for adding empty records.In the blog,add method is on server side which adds other empty rows,This is not what I wanted.
http://stackoverflow.com/questions/5136 ... e-jeditabl
@Lyrionus, i "like" this response, but (I think) BalusC's blog/example had the new/empty row as a separate object that existed outside of the dataTable, if I recall, correctly. I'm not using that approach, but I like that approach, too.Lyrionus wrote:My guess is it isn't really possible to add emtpy rows only to the front-end. At the moment we are doing it by adding a empty object to the back-end and on posts check for empties and delete them so they won't end up in the database.
Howard
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
-
- Information
-
Who is online
Users browsing this forum: Google [Bot] and 29 guests