B4J Library [ABMaterial] Framework for WebApps

Discussion in 'B4J Libraries & Classes' started by alwaysbusy, Nov 5, 2015.

  1. alwaysbusy

    alwaysbusy Expert Licensed User

    @Cableguy Yes. The next update will have a property on the page 'ShowGridInfo=true' to show the grid. Even more, it will help you to code the component in the right cell giving you an indication in the cell top left corner.

    Note: Because of the many questions/suggestions I can hardly follow, from now on only stable versions will be released on the first page. However, donators will receive an email with a download link to my betas so they can start playing with the new features/components and bug fixes a lot earlier.

    [​IMG]
     
  2. Cableguy

    Cableguy Expert Licensed User

    Can't wait to check my inbox
     
    DonManfred likes this.
  3. Gabino A. de la Gala

    Gabino A. de la Gala Active Member Licensed User

    Hello!!! First of all, congratulations for your great job!!!

    I've found a anomalus behaviour in the new login form. Only appears the first time I access each time I restart the server.

    This problem only appears using Chrome. Explorer and Firefox works fine always.
     
  4. pixet

    pixet Member Licensed User

    great job,
    MP
     
  5. alwaysbusy

    alwaysbusy Expert Licensed User

    @Gabino A. de la Gala I see what you mean. Unforunately this is not something I can do about it I'm afraid. Chrome does not seem to lose the WebSocket connection fast enough (if you check the taskmanager, there are always a lot of chrome apps running, so maybe this has something to do with it). You could alsways make a 'logoff' button in the app. In the button code, just set

    Code:
    ws.Session.SetAttribute("IsAuthorized""")
     
    Gabino A. de la Gala likes this.
  6. Cableguy

    Cableguy Expert Licensed User

    Taking the firsts steps in your framework, I took the time to print out all the code modules in the demo, and the start tips of the webapp.
    Just followed them and my folder tree is created as described, but I'm getting a few weird logs, and nothing shows up in the browser but an occasional "404" or a "Not Connected" message...

    here's my log:
    Code:
    Program started.
    java.lang.NullPointerException
     at com.ab.abmaterial.ABMPage.WritePageToDisk(Unknown Source)
     at com.ab.abmaterial.ABMaterial.WritePageToDisk(Unknown Source)
     at com.ab.abmaterial.ABMaterial.WriteAppLauchPageToDisk(Unknown Source)
     at net.lusufibra.abmapplication._startserver(abmapplication.java:
    103)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
    62)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
    43)
     at java.lang.reflect.Method.invoke(Method.java:
    497)
     at anywheresoftware.b4a.shell.Shell.runMethod(
    Shell.java:593)
     at anywheresoftware.b4a.shell.Shell.raiseEventImpl(
    Shell.java:225)
     at anywheresoftware.b4a.shell.Shell.raiseEvent(
    Shell.java:158)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
    62)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
    43)
     at java.lang.reflect.Method.invoke(Method.java:
    497)
     at anywheresoftware.b4a.BA.raiseEvent2(BA.java:
    93)
     at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:
    90)
     at anywheresoftware.b4a.BA.raiseEvent(BA.java:
    84)
     at net.lusufibra.main.main(main.java:
    29)
    java.lang.NullPointerException
     at com.ab.abmaterial.ABMPage.WritePageToDisk(Unknown Source)
     at com.ab.abmaterial.ABMaterial.WritePageToDisk(Unknown Source)
     at com.ab.abmaterial.ABMaterial.WriteAppLauchPageToDisk(Unknown Source)
     at net.lusufibra.abmapplication._startserver(abmapplication.java:
    103)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
    62)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
    43)
     at java.lang.reflect.Method.invoke(Method.java:
    497)
     at anywheresoftware.b4a.shell.Shell.runMethod(
    Shell.java:593)
     at anywheresoftware.b4a.shell.Shell.raiseEventImpl(
    Shell.java:225)
     at anywheresoftware.b4a.shell.Shell.raiseEvent(
    Shell.java:158)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
    62)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
    43)
     at java.lang.reflect.Method.invoke(Method.java:
    497)
     at anywheresoftware.b4a.BA.raiseEvent2(BA.java:
    93)
     at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:
    90)
     at anywheresoftware.b4a.BA.raiseEvent(BA.java:
    84)
     at net.lusufibra.main.main(main.java:
    29)
    2015-11-10 19:40:01.328:INFO::main: Logging initialized @1347ms
    2015-11-10 19:40:01.522:INFO:oejs.Server:main: jetty-9.1.z-SNAPSHOT
    2015-11-10 19:40:01.574:WARN:oejh.MimeTypes:main: java.util.MissingResourceException: Can't find bundle for base name org/eclipse/jetty/http/encoding, locale en_GB
    2015-11-10 19:40:01.640:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@babb1{/,file:/D:/B4X/ABMaterialBeta0.99/LusoFibra/Objects/www/,AVAILABLE}
    2015-11-10 19:40:01.646:INFO:oejs.AbstractNCSARequestLog:main: Opened D:\B4X\ABMaterialBeta0.99\LusoFibra\Objects\logs\b4j-2015_11_10.request.log
    2015-11-10 19:40:01.792:INFO:oejs.ServerConnector:main: Started ServerConnector@1b6d4ae{HTTP/1.1}{0.0.0.0:51042}
    2015-11-10 19:40:01.793:INFO:oejs.Server:main: Started @1880ms
    Emulated network latency: 100ms
    am I missing something?
     
  7. Gabino A. de la Gala

    Gabino A. de la Gala Active Member Licensed User

    I think I found a "relative solution"... Uncheck the option "execute applications in background with Google Chrome is close". In configuration/system
     
    alwaysbusy likes this.
  8. alwaysbusy

    alwaysbusy Expert Licensed User

    @Cableguy Have you started with a complete copy of the Template folder?
     
  9. Cableguy

    Cableguy Expert Licensed User

    Yes I did, and did all the Nx stuff...

    I will try to Franken the demo until it breaks, lol
     
  10. Cableguy

    Cableguy Expert Licensed User

    Frankening is way too laborious...

    Could your template be executable right out of the box? Like 1 empty page with 1 navbar item?
     
    Last edited: Nov 10, 2015
  11. alwaysbusy

    alwaysbusy Expert Licensed User

    @Cableguy Damn last minute changes :confused:. Just add the line BuildPage to the ABMApplication Initialize method so it looks like:

    Code:
    Public Sub Initialize
        Pages.Initialize  
        PageNeedsUpload.Initialize
        
    ' add your icons
        ' ABM.AddAppleTouchIcon("", "")
        ' ABM.AddMSTileIcon("", "")
        ' ABM.AddFavorityIcon("", "")  
        ' build the local structure IMPORTANT!
        BuildPage
    End Sub
    Note: I see in the template folder i've also messed up where I've put the .js files. Just to be sure you have the latest versions, move all the .js files from the /Template folder to the /Template/Objects/www/js/ folder.

    Sorry for the mess, must've been the fatigue...

    I make sure this is remedied in the next update. (I've also uploaded the corrected version on the first page)
     
    Last edited: Nov 11, 2015
  12. Cableguy

    Cableguy Expert Licensed User

    @alwaysbusy ,

    Hi Alan, the template is indeed corrected and after the first settings it compiles without any errors.
    I now am having the same "unknown source" type of errors with the navbar.
    here's my logs:
    Code:
    Program started.
    java.lang.NullPointerException
        at com.ab.abmaterial.ABMNavigationBar.BuildBody(Unknown Source)
        at com.ab.abmaterial.ABMNavigationBar.Build(Unknown Source)
        at com.ab.abmaterial.ABMPage.WritePageToDisk(Unknown Source)
        at com.ab.abmaterial.ABMaterial.WritePageToDisk(Unknown Source)
        at LusoFibra.net.abmapplication._addpage(abmapplication.java:
    85)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
    62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
    43)
        at java.lang.reflect.Method.invoke(Method.java:
    497)
        at anywheresoftware.b4a.shell.Shell.runMethod(
    Shell.java:593)
        at anywheresoftware.b4a.shell.Shell.raiseEventImpl(
    Shell.java:225)
        at anywheresoftware.b4a.shell.Shell.raiseEvent(
    Shell.java:158)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
    62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
    43)
        at java.lang.reflect.Method.invoke(Method.java:
    497)
        at anywheresoftware.b4a.BA.raiseEvent2(BA.java:
    93)
        at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:
    90)
        at anywheresoftware.b4a.BA.raiseEvent(BA.java:
    84)
        at LusoFibra.net.main.main(main.java:
    29)
    2015-11-11 10:36:08.695:INFO::main: Logging initialized @903ms
    2015-11-11 10:36:08.903:INFO:oejs.Server:main: jetty-9.1.z-SNAPSHOT
    2015-11-11 10:36:08.950:WARN:oejh.MimeTypes:main: java.util.MissingResourceException: Can't find bundle for base name org/eclipse/jetty/http/encoding, locale en_GB
    2015-11-11 10:36:09.013:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@1bbe5e8{/,file:/D:/B4X/ABMaterialBeta0.99/LusoFibra/Objects/www/,AVAILABLE}
    2015-11-11 10:36:09.019:INFO:oejs.AbstractNCSARequestLog:main: Opened D:\B4X\ABMaterialBeta0.99\LusoFibra\Objects\logs\b4j-2015_11_11.request.log
    2015-11-11 10:36:09.156:INFO:oejs.ServerConnector:main: Started ServerConnector@61f5df{HTTP/1.1}{0.0.0.0:51042}
    2015-11-11 10:36:09.157:INFO:oejs.Server:main: Started @1416ms
    Emulated network latency: 100ms
    [EDIT] browsing the demo, I see the SideNavBar being created in the shared module, so why do we have the navbar props/methods on the pagetemplate? where should a navbar be created?

    [EDIT2] I managed to figure it out! at the end, its all a matter of logic!
     
    Last edited: Nov 11, 2015
  13. Cableguy

    Cableguy Expert Licensed User

    Hi Alain,

    two questions:
    Q1 - Is it possible to set a sidenavbar without the topbar?
    Q2.1 - if Q1 is yes, what would be the best and easiest way to place a fixed header?
    Q2.2 - if Q1 is NO, is it possible to change the bar height and to add a text overlay to it?
     
    Last edited: Nov 11, 2015
  14. alwaysbusy

    alwaysbusy Expert Licensed User

    No, a sidebar cannot exist without a topbar. Reason is for mobile devices, where the sidebar disappears and the user can use the 'hamburger' icon in the topbar to open the side menu. If you do not use it on mobile devices, you may try to set the backcolor nd forecolor of the topbar transparent + set the top bar to floating. Not tested, and I do not advice this even if it works because it should be possible to open your app on a mobile device. Without a topbar, the menu cannot be opened on all devices.
     
  15. Cableguy

    Cableguy Expert Licensed User

  16. Roberto P.

    Roberto P. Well-Known Member Licensed User

    hello congratulations for the improvements to the framework. At this point it would be interesting example that exchanges data between the controls and frameworks, and a database on the server.
    Thank you
    best regards
     
    Cableguy likes this.
  17. alwaysbusy

    alwaysbusy Expert Licensed User

    @Cableguy I don't see anything wrong with your screenshot. What am I missing?
     
  18. alwaysbusy

    alwaysbusy Expert Licensed User

    Donators should receive a mail with the new version. Let me know if you did not get it.
     
  19. Cableguy

    Cableguy Expert Licensed User

    It's not wrong, just way to small to be considered as a Logo on its own... I can live with that
     
    alwaysbusy likes this.
  20. Roberto P.

    Roberto P. Well-Known Member Licensed User

    that version releases? I see that you can download the 0.99! That the donation amount?
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice