Hi,
I put the insertrow() when the user click add new item, but
I notice that just by issuing the insertrow(), the record is added. So when the user change his mind and click cancel button which just put the user to previous page, the record is already added with empty name.
Am I doing it the wrong way? Which actually when user click add new item I shouldn't issue insertrow()? or do I have to do something (like delete or issue cancel) when user click cancel button instead just take the user to the previous page?
Thanks in advance for the help.
how to cancel the insert row?
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 305
- Joined: Thu Jul 02, 2015 8:32 am
- Location: Indonesia
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
When you add a row, you also have the option of setting it as empty e.g.:
Empty rows are ignored when you subsequently do an updateTable(), but they aren't removed for display purposes. A row loses its empty status when the user enters something in the row. You get this behaviour for free if you use the Add Row Button on a Table Control instead of coding your own insertRow().
Another way to do this is just loop through the rows before you do an updateTable() and delete any empty rows (i.e. all the columns have null values).
Code: Select all
tables.T1.insertRow();
tables.T1.setRowEmpty(true);
Another way to do this is just loop through the rows before you do an updateTable() and delete any empty rows (i.e. all the columns have null values).
0 x
-
- Ebase User
- Posts: 305
- Joined: Thu Jul 02, 2015 8:32 am
- Location: Indonesia
So the empty row still has to be deleted manually, is that right?
Jon wrote:When you add a row, you also have the option of setting it as empty e.g.:
Empty rows are ignored when you subsequently do an updateTable(), but they aren't removed for display purposes. A row loses its empty status when the user enters something in the row. You get this behaviour for free if you use the Add Row Button on a Table Control instead of coding your own insertRow().Code: Select all
tables.T1.insertRow(); tables.T1.setRowEmpty(true);
Another way to do this is just loop through the rows before you do an updateTable() and delete any empty rows (i.e. all the columns have null values).
0 x
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
Not necessarily, it depends what you want to do with it. Usually users enter data and then eventually hit some sort of Commit button at which point you issue an updateTable() - this updates the database. If you make a row empty, it's ignored by updateTable() i.e. it won't end up in the database. But it is still visible to the user.
0 x
-
- Ebase User
- Posts: 305
- Joined: Thu Jul 02, 2015 8:32 am
- Location: Indonesia
If the user close the application (close the browser), then he run the application again, will that empty record still visible?
Concerning the updatetable(), if there are several insertrow() as long as no updatetable() issued the record addition will not be inserted to the table, is that right?
Concerning the updatetable(), if there are several insertrow() as long as no updatetable() issued the record addition will not be inserted to the table, is that right?
Jon wrote:Not necessarily, it depends what you want to do with it. Usually users enter data and then eventually hit some sort of Commit button at which point you issue an updateTable() - this updates the database. If you make a row empty, it's ignored by updateTable() i.e. it won't end up in the database. But it is still visible to the user.
0 x
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
-
- Ebase User
- Posts: 305
- Joined: Thu Jul 02, 2015 8:32 am
- Location: Indonesia
Who is online
Users browsing this forum: No registered users and 23 guests