B4J Question Ideas for multirecord data entry to database?

vfafou

Well-Known Member
Licensed User
Longtime User
Hello!
I need a very usable way to give my user the functionality of multiple record entry view.
I think the nearest view is B4XTable but I can't figure out how to make it do new records directly (inline) and not only inline edit.
The opening of a new record should be with a keyboard key press.
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
 
Upvote 1

vfafou

Well-Known Member
Licensed User
Longtime User
Hello Erel!
Thank you for your response!
I've used the B4XTable in several cases.
This time, I need a fast way to add programmatically a new row to the table, without the need to press a button out of the table.
As I can understand, the Inline Editing feature refers only to created rows.
I want to use the table as a multirecord data entry component, so I need to add a new empty row, so the user can edit the row afterwards.
I've tried to SetData an empty list, when clicking at an empty cell but it crashes!
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
I want to use the table as a multirecord data entry component, so I need to add a new empty row
My idea for this would be to create a json form template using B4J form builder, and use it with a B4XPreferenceDialog to input the data. You would have to have a button to click to bring up the template, fill it with data then save the data to the in memory database and SQLite database while at the same time displayng it on B4XTable.
I do not think there is a way to click an empty row on the B4XTable to trigger data input like with editing an existing row.
 
Upvote 1

vfafou

Well-Known Member
Licensed User
Longtime User
My idea for this would be to create a json form template using B4J form builder, and use it with a B4XPreferenceDialog to input the data. You would have to have a button to click to bring up the template, fill it with data then save the data to the in memory database and SQLite database while at the same time displayng it on B4XTable.
I do not think there is a way to click an empty row on the B4XTable to trigger data input like with editing an existing row.
Hello Mahares!

Thank you for your suggestion!
I already use this way to add rows to the table and MariaDB, to another application.
This time, the application I make needs the way I describe. Something like a data grid with built-in add new record.
I've tried to change the InlineEditing class, but I suppose there's something to be changed/added to the entire B4XTable library.
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
Hi there...

when you mean multi-record - you mean paste some rows,cols (from excel for example) to your b4xtable... ?

if that may be you need to check clipboard (ctrl-v) at your app and then examine the rows and cells --> to put it at the right rows, fields (rows, cols)... is all about how you will manage it..
 
Upvote 0

vfafou

Well-Known Member
Licensed User
Longtime User
Hi there...

when you mean multi-record - you mean paste some rows,cols (from excel for example) to your b4xtable... ?

if that may be you need to check clipboard (ctrl-v) at your app and then examine the rows and cells --> to put it at the right rows, fields (rows, cols)... is all about how you will manage it..
Καλησπέρα φίλε μου!
Ευχαριστώ για την απάντησή σου!
Θέλω να πετύχω τη λειτουργία του παλιού datagrid της VB6 που είχε inline δυνατότητα προσθήκης εγγραφής με το χέρι.
Ή σαν το απίθανο grid της Infragistics.
Ή κάτι σαν να γράφω σε κελιά του excel αλλά πάλι με το χέρι.
Ή κάτι σαν το ανεπανάληπτο multirecord entry των Oracle Forms!
Δηλαδή να ανοίγει χώρος για νέα εγγραφή απευθείας πάνω στον πίνακα.
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
Καλησπέρα φίλε μου!
Ευχαριστώ για την απάντησή σου!
Θέλω να πετύχω τη λειτουργία του παλιού datagrid της VB6 που είχε inline δυνατότητα προσθήκης εγγραφής με το χέρι.
Ή σαν το απίθανο grid της Infragistics.
Ή κάτι σαν να γράφω σε κελιά του excel αλλά πάλι με το χέρι.
Ή κάτι σαν το ανεπανάληπτο multirecord entry των Oracle Forms!
Δηλαδή να ανοίγει χώρος για νέα εγγραφή απευθείας πάνω στον πίνακα.
Use inline editing addition, then you can check if you are at last row and if end-user press arrow down then add at db new row (rec) also refresh b4xtable data.

μετάφρ. Χρησιμοποίησε το inline editing module, μετά τσέκαρε προγραμματιστικά αν βρίσκεται ο τελικός χρήστης στην τελευταία εγγραφή/row/rec και αν πατήσει κάτω βελάκι πρόσθεσε μια γραμμή/rec/row στην βάση - έπειτα κάνε refresh το b4xtable/και τα data του.
 
Upvote 0

vfafou

Well-Known Member
Licensed User
Longtime User
Use inline editing addition, then you can check if you are at last row and if end-user press arrow down then add at db new row (rec) also refresh b4xtable data.

μετάφρ. Χρησιμοποίησε το inline editing module, μετά τσέκαρε προγραμματιστικά αν βρίσκεται ο τελικός χρήστης στην τελευταία εγγραφή/row/rec και αν πατήσει κάτω βελάκι πρόσθεσε μια γραμμή/rec/row στην βάση - έπειτα κάνε refresh το b4xtable/και τα data του.
There is a small problem here... The records will be made in the detail table, which has a foreign key with the header, so it will not be written directly to the detail. There are also constraints that do not allow empty values in fields, so a record cannot be created before all required fields are filled!

Υπάρχει ένα μικρό πρόβλημα εδώ... Οι εγγραφές θα γίνονται σε detail πίνακα, ο οποίος έχει foreign key με τον header, οπότε δεν θα γίνεται απευθείας εγγραφή στο detail. Επίσης υπάρχουν constraints που δεν επιτρέπουν κενές τιμές σε πεδία, οπότε δεν μπορεί να γίνει create εγγραφής προτού συμπληρωθούν όλα τα πεδία που απαιτούνται!
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
There is a small problem here... The records will be made in the detail table, which has a foreign key with the header, so it will not be written directly to the detail. There are also constraints that do not allow empty values in fields, so a record cannot be created before all required fields are filled!

Υπάρχει ένα μικρό πρόβλημα εδώ... Οι εγγραφές θα γίνονται σε detail πίνακα, ο οποίος έχει foreign key με τον header, οπότε δεν θα γίνεται απευθείας εγγραφή στο detail. Επίσης υπάρχουν constraints που δεν επιτρέπουν κενές τιμές σε πεδία, οπότε δεν μπορεί να γίνει create εγγραφής προτού συμπληρωθούν όλα τα πεδία που απαιτούνται!
Hmm let's talk only in english (not so good for it, but not writing with subtitles too)

No need to write at database from start... you can just add rows..

And at the end, make the transfer...

but in case you want will be better for future - reasons.. perhaps if it is invoice or business app is better to commit-products for example making a new record.. So you can think how will commit foreign-key too (invoice nr OR a temporary big number for example), also fields like qty can be "1", price can be 0.00, description can be space... etc

I am sure that you will make it....
 
Last edited:
Upvote 0

vfafou

Well-Known Member
Licensed User
Longtime User
Hmm let's talk only in english (not so good for it, but not writing with subtitles too)

No need to right at database from start... you can just add rows..

And at the end, make the transfer...

but in case you want will be better for future - reasons.. perhaps if it is invoice or business app is better to commit-products for example making a new record.. So you can think how will commit foreign-key too (invoice nr OR a temporary big number for example), also fields like qty can be "1", price can be 0.00, description can be space... etc

I am sure that you will make it....
OK! I'll try it! Thank you for your valuable time!
 
Upvote 0

vfafou

Well-Known Member
Licensed User
Longtime User
I finally created a custom view with a B4XComboBox and a TextField on a CustomListView. Anyway, these 2 fields are the only ones I want to be filled by my user!
 
Upvote 0
Top