B4J Question [ABMaterial] Mini tutorial

StarinschiAndrei

Active Member
Licensed User
Longtime User
Hi everyone,
i'm new in ABMaterial, i had followed the instruction from mini tutorial and now i have an error. What i did wrong ?
In main
B4X:
    Dim myPage As ABMPageTemplate
    myPage.Initialize           
    Dim Page1 As MyNewPage ' which is a copy of the ABMPageTemplate
    Page1.Initialize
B4X:
Sub ConnectNavigationBar(page As ABMPage) 'ignore
    ' Clear the dummies we created in BuildNavigationBar
    page.NavigationBar.Clear
    
    ' add the menus to your sidebar
    ' examples
    page.NavigationBar.AddSideBarItem("returnTemplate", "Template Page", "", "../ABMPageTemplate")
    page.NavigationBar.AddSideBarItem("ret1","Page 1","","../Page1")
    'page.NavigationBar.AddSideBarItem("ret1", "Page 1", "", "../Page1/")
    'page.NavigationBar.AddSideBarItem("ret2", "Page 2", "", "../Page2/")
    'page.NavigationBar.AddSideBarItem("ret3", "Page 3", "", "../Page3")   
    'page.NavigationBar.AddTopItemWithSideBar("sidebar", "sidebar", "", "", ABM.VISIBILITY_ALL, sb)   
        
    page.NavigationBar.Refresh ' IMPORTANT
End Sub

B4X:
Public Name As String = "MyNewPage"

When i open page 1 i receive the following error : "


Resource Not Found.


Error 404: The requested resource could not be found but may be available again in the future.
You can go back to the homepage by clicking here!

"
 

alwaysbusy

Expert
Licensed User
Longtime User
I can't see some mistake in your code at first sight. Did you run the code in Debug mode first? (this is needed as some files like the .needs are created. They have to be copied to your production server later next to the .jar to make it work).

Also, make sure you've added the new page to the engine (with the AddPage(Page1.Page) method)
 
Upvote 0

StarinschiAndrei

Active Member
Licensed User
Longtime User
Hi Alain,
To answer to your first question , i used only in Debug mode. Here you can find a project archive
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…