B4J Question [SOLVED][ABMaterial] QRCode custom component

John Naylor

Active Member
Licensed User
Longtime User
B4J 8.1, ABMaterial 4.3

Hi all! I'm trying to get the custom component working that is shown here.

I have created a new class module exactly as shown and added the relevant lines into an existing page but I'm getting the following error in my log window.

An error occurred:
(Line: 0) 0
java.lang.Exception: Sub abmcomp_build signature does not match expected signature.
public static anywheresoftware.b4a.pc.RemoteObject abmaterial.ab.com.compqrcode_subs_0._abmcomp_build(anywheresoftware.b4a.pc.RemoteObject,anywheresoftware.b4a.pc.RemoteObject) throws java.lang.Exception
class anywheresoftware.b4a.pc.RemoteObject, class anywheresoftware.b4a.pc.RemoteObject, class java.lang.String,



I just see 'Null' where the QR code should appear.

I assume I'm struggling as quite a bit has changed since that thread in 2016.

When I set up the new module I had to change a line in the CompQRCode module from

B4X:
'Original code
ABMComp.Initialize("ABMComp", Me, InternalPage, ID)

'New code
ABMComp.Initialize("ABMComp", Me, InternalPage, ID,"") 'CSS as string appears to be new

Any ideas on how to get it going? I'm going round in circles now!

Thanks for reading!
 
Last edited:

John Naylor

Active Member
Licensed User
Longtime User
Fixed myself and a handy learning process it was too.

The original code in the CompQRClass module as indicated in the above link reads


B4X:
Sub ABMComp_Build(internalID As String) As String
  Return $"<div id="${internalID}svg"/></div><script>var qrcode${internalID};</script>"$
End Sub

however it appears that something has changed over the years and it now needs to read


B4X:
Sub ABMComp_Build(InternalPage As ABMPage, internalID As String) As String

    Return $"<div id="${internalID}svg"/></div><script>var qrcode${internalID};</script>"$
    
End Sub
 
Upvote 0
Top