B4J Question [ABMaterial]Using the Application.bas as the index or primary page of the webapp

Hanz

Active Member
Hello,

I understand, you can set your InitialPage from ABMApplication.bas module which is the page that a visitor sees first. I also understand that you can create a page from this module and I tried it. The problem is, when I open the webapp, the page appears, but it refreshes again and again in a matter of less than a second or so. Then, I watched the log as it refreshes, I see about two messages one says "disconnected."

My intention is to use it as the index or the first page such as login/sign up page before going to other pages.

Is there anything that I must set up first which is not ordinarily done in other pages which is a copy of the ABMPageTemplate?

I just added the following codes at the ConnectPage() of the module.

Dim lbl As ABMLabel
lbl.Initialize(AppPage, "lbl", "The index page", ABM.SIZE_H1, False, "")
AppPage.Cell(1,1).AddComponent(lbl)
 
Last edited:

alwaysbusy

Expert
Licensed User
Longtime User
In most cases this means you are missing some css/js files. Have you copied the whole template folder (including the www folder)?

In Chrome press F12 to open the console, open the network tab and press CTRL+F5. watch for some red lines, missing files (it will go quick, so maybe you can slow it a bit down by disabling the cache and setting it to 3G slow):

upload_2018-10-5_8-0-2.png


As for the login, you can activate in main NeedsAuthorization, as ABM has a login feature build-in (but you can write your own of course too:

B4X:
ABMShared.NeedsAuthorization = True
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
Also, when you added your new page (copy of ABMPageTemplate), you will have given it a new name. You must set the name variable in the class to the name of the class (case sensitive!). e.g. class is AboutPage, so Name should be:

B4X:
Public Name As String = "AboutPage"

Then, in main you must add your newly create page:

B4X:
Dim aboutp As AboutPage
aboutp.Initialize

...

myApp.AddPage(aboutp.Page)
 
Upvote 0

Hanz

Active Member
Yes, I added everything including the "www" folder. For the other pages, there are no problems, they work perfectly. I'm just stuck with this one. I will follow your advice using the chrome and see what I will get.
 
Upvote 0
Top