J jndaniels1 Member Licensed User Longtime User Oct 6, 2024 #1 Hi to all. Im working with B4XPages in B4J using b4xdialogs - Specifically the signaturetemplate. (B4J and B4A is my targets) it will crash at the line ShowTemplate statement. B4X: Copy Dim rs As ResumableSub = Dialog.ShowTemplate(SignaturTemplate, Chr(0xF00C), "", Chr(0xF00D)) logs return this in debug Error occurred on line: 130 (B4XDialog) java.lang.RuntimeException: Object should first be initialized (B4XView). (the code is only 58 lines long btw) this in release mode b4xdialog$ResumableSub_ShowTemplate.resume (java line: 1129) I copied the code from the example "XUI Views" from the forum. I can get it to work in non B4XPages - I really prefer to not worry about Activities management in B4A Ideas? Thanks everybody ! JD
Hi to all. Im working with B4XPages in B4J using b4xdialogs - Specifically the signaturetemplate. (B4J and B4A is my targets) it will crash at the line ShowTemplate statement. B4X: Copy Dim rs As ResumableSub = Dialog.ShowTemplate(SignaturTemplate, Chr(0xF00C), "", Chr(0xF00D)) logs return this in debug Error occurred on line: 130 (B4XDialog) java.lang.RuntimeException: Object should first be initialized (B4XView). (the code is only 58 lines long btw) this in release mode b4xdialog$ResumableSub_ShowTemplate.resume (java line: 1129) I copied the code from the example "XUI Views" from the forum. I can get it to work in non B4XPages - I really prefer to not worry about Activities management in B4A Ideas? Thanks everybody ! JD
LucaMs Expert Licensed User Longtime User Oct 7, 2024 #2 Dialog or SignaturTemplate has not been initialized. Upvote 0
LucaMs Expert Licensed User Longtime User Oct 7, 2024 #3 B4X: Copy Sub Class_Globals Private Root As B4XView Private xui As XUI Private Dialog As B4XDialog Private SignaturTemplate As B4XSignatureTemplate End Sub B4X: Copy Private Sub B4XPage_Created (Root1 As B4XView) Root = Root1 Root.LoadLayout("mainpage") SignaturTemplate.Initialize Dialog.Initialize(Root) End Sub B4X: Copy Private Sub Button1_Click Dim rs As ResumableSub = Dialog.ShowTemplate(SignaturTemplate, Chr(0xF00C), "", Chr(0xF00D)) Wait For (rs) Complete(Result As Int) Log("Result " & Result) End Sub Upvote 0
B4X: Copy Sub Class_Globals Private Root As B4XView Private xui As XUI Private Dialog As B4XDialog Private SignaturTemplate As B4XSignatureTemplate End Sub B4X: Copy Private Sub B4XPage_Created (Root1 As B4XView) Root = Root1 Root.LoadLayout("mainpage") SignaturTemplate.Initialize Dialog.Initialize(Root) End Sub B4X: Copy Private Sub Button1_Click Dim rs As ResumableSub = Dialog.ShowTemplate(SignaturTemplate, Chr(0xF00C), "", Chr(0xF00D)) Wait For (rs) Complete(Result As Int) Log("Result " & Result) End Sub
J jndaniels1 Member Licensed User Longtime User Oct 7, 2024 #4 Thanks LucaMs ! Solved! So Close too ! I had the initializes under the initialize sub -- Although, I can swear I tried it in created sub. I feel dumb now. Again, Thanks !!!!!! JD Upvote 0
Thanks LucaMs ! Solved! So Close too ! I had the initializes under the initialize sub -- Although, I can swear I tried it in created sub. I feel dumb now. Again, Thanks !!!!!! JD
LucaMs Expert Licensed User Longtime User Oct 7, 2024 #5 From a logical point of view, I agree with you, the initializations should be written in the Initialize. However, you have to pass a B4XView (Root) to the dialog, so it must be in the Create (after all, this is also executed only once, like the Initialize). Upvote 0
From a logical point of view, I agree with you, the initializations should be written in the Initialize. However, you have to pass a B4XView (Root) to the dialog, so it must be in the Create (after all, this is also executed only once, like the Initialize).