B4J Question using AB Material for website development

saeed10051

Active Member
Licensed User
Longtime User
There is a site
which is simple with some link and tabs and an email support
I need to know if there is a working example available to build this type of website through AB Material
 

Xandoca

Active Member
Licensed User
Longtime User
I've made the page bellow that you can use as a starter. As I'm a ABMaterial beginner user, this is not a perfect or best solution/approach.
You can style the tabs, table (list of links), etc.
good luck.
page.gif
 

Attachments

  • ABMPageTemplate.bas
    24.4 KB · Views: 305
Upvote 0

saeed10051

Active Member
Licensed User
Longtime User
I've made the page bellow that you can use as a starter. As I'm a ABMaterial beginner user, this is not a perfect or best solution/approach.
You can style the tabs, table (list of links), etc.
good luck.
View attachment 94584
Hi
i am trying to run the bas file by renaming the bas file to testTemplate. Then i have added it to the abmaterial example template as an existing module. The main file i.e. http://localhost:51045/Myapp/ABMPageTemplate/ is running but when i change the address to http://localhost:51045/Myapp/testTemplate/
i get the error that resource not found. Also in the log i see the message
/Myapp/testTemplate/ Not found
 
Upvote 0

Xandoca

Active Member
Licensed User
Longtime User
Have you changed the page name?
B4X:
Public Name As String = "ABMPageTemplate"
Have you changed the Main class with the new name?
B4X:
    ' create the app
    Dim myApp As ABMApplication
    myApp.Initialize
        
    ' create the pages
    Dim myPage As ABMPageTemplate   'here***********
    myPage.Initialize       
        
    ' add the pages to the app
    myApp.AddPage(myPage.page)
 
Upvote 0

Xandoca

Active Member
Licensed User
Longtime User
When I shared the page I forgot to send you the themes I was using (ABMShared):
B4X:
' build methods for ABM objects
Sub BuildTheme(themeName As String)
    MyTheme.Initialize(themeName)
    
    ' the page theme
    MyTheme.Page.BackColor = ABM.COLOR_WHITE   
    
    MyTheme.AddCellTheme("celulacentralizadaprincipal")
    MyTheme.Cell("celulacentralizadaprincipal").Align = ABM.CELL_ALIGN_CENTER

    MyTheme.AddCellTheme("celulayellow")
    MyTheme.Cell("celulayellow").Align = ABM.CELL_ALIGN_CENTER
    MyTheme.Cell("celulayellow").BackColor = ABM.COLOR_YELLOW
    MyTheme.Cell("celulayellow").BackColorIntensity = ABM.INTENSITY_NORMAL
    'MyTheme.Cell("celulayellow").BorderRadiusTopLeftPx = 10
    'MyTheme.Cell("celulayellow").BorderRadiusTopRightPx = 10
    MyTheme.Cell("celulayellow").BorderRadiusPx = 10
    'MyTheme.Cell("celulayellow").BorderRadiusTopRightPx = 10
    

    
    MyTheme.AddRowTheme("linhayellow")
    MyTheme.Row("linhayellow").BackColor = ABM.COLOR_YELLOW
    MyTheme.Row("linhayellow").BackColorIntensity = ABM.INTENSITY_ACCENT1
    
    MyTheme.AddDividerTheme("linhadivisoariapreta")
    MyTheme.Divider("linhadivisoariapreta").Colorize(ABM.color_black)
    
#region linhas para formar a caixa de criacao de usuario
    'linha roxa superior na caixa de busca
    MyTheme.AddRowTheme("linhanovousuariosuperior")
    MyTheme.Row("linhanovousuariosuperior").BackColor = ABM.COLOR_AMBER
    MyTheme.Row("linhanovousuariosuperior").BackColorIntensity = ABM.INTENSITY_NORMAL
    MyTheme.Row("linhanovousuariosuperior").BorderRadiusTopLeftPx = 10
    MyTheme.Row("linhanovousuariosuperior").BorderRadiusTopRightPx = 10
#end region
End Sub
 
Upvote 0

saeed10051

Active Member
Licensed User
Longtime User
Have you changed the page name?
B4X:
Public Name As String = "ABMPageTemplate"
Have you changed the Main class with the new name?
B4X:
    ' create the app
    Dim myApp As ABMApplication
    myApp.Initialize
       
    ' create the pages
    Dim myPage As ABMPageTemplate   'here***********
    myPage.Initialize      
       
    ' add the pages to the app
    myApp.AddPage(myPage.page)
Thanks Alexandre for the guidance. I have changed the page name as follows
Public Name As String = "testTemplate"
but i am unable to understand how i should change main class. as this main class is related to myApp which is the base project, i have just added one module (the one send by you) to it.
I am attaching screen shot of the application view. with main class and other classes
Also is there a way that i create a new project instead of adding the module to existing example project.
 

Attachments

  • screen.png
    screen.png
    120.7 KB · Views: 281
Upvote 0

OliverA

Expert
Licensed User
Longtime User
So for each page you want to add to your project, you
1) Create a class for that page. Base it on one of the two templates provided by ABM (or on another page you have created). Make sure you change the page name.
This is the testTemplate class that you created
2) Create an instance of this new class in Main
In your case
B4X:
' create the pages
Dim myTestPage As testTemplate
myTestPage.Initialize
You can call your page objects whatever you want, in this case I just have myTestPage.
3) Add class instance to the ABMApplication object in Main
In your case
B4X:
' add the pages to the app
myApp.AddPage(myTestPage.page)
Note: This is just a rough overview. This makes the page available in direct navigation (typing the URL in the address bar of a browser), but not in any menu that you have set up. You'll still have write additional code for such feature.
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Also is there a way that i create a new project instead of adding the module to existing example project.
Make a copy of the Template directory. It has the minimum files you need to get a project off and going (well, plus a couple of Template classes you can use to base your various pages on).
 
Upvote 0

saeed10051

Active Member
Licensed User
Longtime User
So for each page you want to add to your project, you
1) Create a class for that page. Base it on one of the two templates provided by ABM (or on another page you have created). Make sure you change the page name.
This is the testTemplate class that you created
2) Create an instance of this new class in Main
In your case
B4X:
' create the pages
Dim myTestPage As testTemplate
myTestPage.Initialize
You can call your page objects whatever you want, in this case I just have myTestPage.
3) Add class instance to the ABMApplication object in Main
In your case
B4X:
' add the pages to the app
myApp.AddPage(myTestPage.page)
Note: This is just a rough overview. This makes the page available in direct navigation (typing the URL in the address bar of a browser), but not in any menu that you have set up. You'll still have write additional code for such feature.
Hi OliverA
Thanks for the precise explanation, i have updated the code. It is working now
in browser by writing http://localhost:51045/Myapp/testTemplate/
 
Upvote 0

saeed10051

Active Member
Licensed User
Longtime User
Make a copy of the Template directory. It has the minimum files you need to get a project off and going (well, plus a couple of Template classes you can use to base your various pages on).
I have this template directory for which the image is attached, there are a number of files in this one, as you can see in the attached image. Are you referring to this template or some other one.
 

Attachments

  • screen.png
    screen.png
    120.7 KB · Views: 275
Upvote 0

Harris

Expert
Licensed User
Longtime User
@saeed10051 , have you reviewed the Dummies tut for the basics? I assume YES since you are this far...
 
Upvote 0
Top