B4J Question [ABMaterial] GET parameter

jayel

Active Member
Licensed User
Longtime User
Hello,

I start my webapp from a desktop B4J program.
Now I want to add parameters :
B4X:
fx.ShowExternalDocument("http://xxx.xxx.xxx.xxx:port/KraanServer/kranenoverzicht?id=1")

How can I get my id parameter in AB material.

in Jserver you have Servletrequest and there you can get the parameter with "getparameter"

But how in ABMaterial?

John
 
Last edited:

mindful

Active Member
Licensed User
In the Demo that AB provided with the library you can find what you are looking for and adjust it to your needs..

B4X:
' if you start the app as: http://localhost:51042/demo/index.html?login=demo&pwd=demo
        Dim params As Map = ws.UpgradeRequest.ParameterMap
        Dim login(0), pwd(0) As String
        If params.IsInitialized Then
            login = params.GetDefault("login", Array As String(""))
            pwd = params.GetDefault("pwd", Array As String(""))
        End If   
        Log(login(0) & " " & pwd(0))
 
Upvote 0

jayel

Active Member
Licensed User
Longtime User
In the Demo that AB provided with the library you can find what you are looking for and adjust it to your needs..

B4X:
' if you start the app as: http://localhost:51042/demo/index.html?login=demo&pwd=demo
        Dim params As Map = ws.UpgradeRequest.ParameterMap
        Dim login(0), pwd(0) As String
        If params.IsInitialized Then
            login = params.GetDefault("login", Array As String(""))
            pwd = params.GetDefault("pwd", Array As String(""))
        End If 
        Log(login(0) & " " & pwd(0))

Yep thanks for the hint ! Solved !!
 
Upvote 0
Top