B4J Question [BANano] Access to page from a URL (solved)

angel_

Well-Known Member
Licensed User
Longtime User
I want to access from a URL to a certain page of a WepApp with BANano, currently all the pages are loaded in the same MainPageHolder, if I have understood correctly I have to use BANanoRouter to access that page through URL (with parameters), it is right?
 
Solution
it depends on the complexity you need. If it is only through parameters, I find it often just easier to use:

e.g. https://mydomain.com?key=1234&name=5678
B4X:
dim params as Map = BANano.GetURLParams(BANano.Location.GetHref)
log(params.get("key"))
log(params.get("name"))

BANanoRouter can handle more complex things like paths but note that is a 'virtual router', using hashing (note the # which is required in the urls when typig them in the browser)

Alwaysbusy

alwaysbusy

Expert
Licensed User
Longtime User
it depends on the complexity you need. If it is only through parameters, I find it often just easier to use:

e.g. https://mydomain.com?key=1234&name=5678
B4X:
dim params as Map = BANano.GetURLParams(BANano.Location.GetHref)
log(params.get("key"))
log(params.get("name"))

BANanoRouter can handle more complex things like paths but note that is a 'virtual router', using hashing (note the # which is required in the urls when typig them in the browser)

Alwaysbusy
 
Upvote 0
Solution
Top