Android Question B4XPages_SQLiteLight2 (Booklets)

edgar_ortiz

Active Member
Licensed User
Longtime User
Hi,

I'm a HAPPY B4A user ... now it's my turn to switch to B4X.

I downloaded: SQLiteDatabase_SourceCode and I DO NOT understand where the value of "Edit.Mode" is lost.

In theory, when a record is to be added, the "PageEdit" fields should be "cleaned".

B4XMainPage - btnAdd_Click:
Private Sub btnAdd_Click
    Log("Begin: B4XMainPage - btnAdd_Click")
    Edit.Mode = "Add"
    Log("B4XMainPage - btnAdd_Click")
    Log($"Edit.Mode: ${Edit.Mode}"$)
    B4XPages.ShowPage("Edit")
    Log("End: B4XMainPage - btnAdd_Click")
End Sub

Edit.Mode value is already lost
Logs:
Logger connected to:  samsung SM-A305G
--------- beginning of main
** Activity (main) Create, isFirst = true **
Begin: B4XMainPage.Initialize
End: B4XMainPage.Initialize
*** mainpage: B4XPage_Created
Begin: B4XPage_Created
Begin: PageEdit.Initialize
End: PageEdit.Initialize
Begin: PageFilter.Initialize
End: PageFilter.Initialize
Se copio la base de datos persons.db
AssetsDir
De: AssetsDir A: /data/user/0/b4a.B4XPages_SQLiteLight2/files
Se terminó B4XMainPage.InitTable
End: B4XPage_Created
*** mainpage: B4XPage_Appear
** Activity (main) Resume **
Begin: B4XMainPage - btnAdd_Click
B4XMainPage - btnAdd_Click
Edit.Mode: Add
*** edit: B4XPage_Created [mainpage]
Fin de: B4XPage_Created (PageEdit)
Edit.Mode:
*** mainpage: B4XPage_Disappear [mainpage]
*** edit: B4XPage_Appear [mainpage]
End: B4XMainPage - btnAdd_Click
PageEdit - B4XPage_Appear
Edit.Mode:
PageEdit - ShowEntry
Edit.Mode:
Entry Index: 0
Despues de Show Entry Mode:
Edit.Mode:


TIA for your comments,

Regards,

Edgar
 

Attachments

  • B4XPages_SQLiteLight2.zip
    19.1 KB · Views: 92

klaus

Expert
Licensed User
Longtime User
Thank you for reporting the problem.
The problem is that Private Edit As PageEdit was also in the PageEdit module.
This line must be removed and all Edit.Mode names must be replaced by Mode.
Sorry for the inconvenience.

Attached your project updated.
The original code is updated for the next edition.
 

Attachments

  • B4XPages_SQLiteLight2_New.zip
    19.3 KB · Views: 107
Upvote 0

edgar_ortiz

Active Member
Licensed User
Longtime User
Hi Klaus,

Thanks, It works Ok.

By the way, in the directories related to B4i, there is no file "persons.db".

Greetings,

Edgar
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
No problem.
The "persons.db" file is in the Shared Files folder of the cross-platform project.
All common files should be saved in this folder and when you run the project in any platform these files are copied into the platform specific Files folder.
This is done by the first line on top of the B4XMainPage module.
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"

Be aware to keep the B4XPages project structure when you transmit any B4XPages project.
The zip file you posted, ziped with IDE menu, is no more a cross-platform project because the Shared Files folder is missing.
To make your project run, I had to comment the first line.

I have now updated the original B4XPagesSQLiteLight2 project with this line:
'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project.zip
Which allows to zip the complete P4XPages project.
This line was missing, I wrote this project before Erel added the method above and forgot to update it.

Attached the new original cross-platform project.
 

Attachments

  • B4XPagesSQLiteLight2.zip
    201.3 KB · Views: 102
Upvote 0
Top