B4J Library [ABMaterial] Framework for WebApps

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

  1. mwebim

    mwebim New Member Licensed User

    Hi Alwaysbusy
    This looks amazing.
    I tried to run it in b4j and I get the following error. I previously upgraded java to version 8 update 66
    I get it building ok but on running comes up with this error

    Caused by: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: com/ab/abmaterial/ABMTheme : Unsupported major.minor version 52.0
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:114)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:90)
    at abmaterial.ab.com.main.<clinit>(main.java:17)
    Caused by: java.lang.UnsupportedClassVersionError: com/ab/abmaterial/ABMTheme : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:190)
    at anywheresoftware.b4a.shell.Shell.getCorrectClassName(Shell.java:485)
    at anywheresoftware.b4a.shell.Shell.createObject(Shell.java:472)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:243)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:158)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
    ... 2 more
    Exception in thread "main"

    Any ideas


  2. alwaysbusy

    alwaysbusy Expert Licensed User

    Is your path setting in B4J correct?
  3. b4auser1

    b4auser1 Well-Known Member Licensed User

    Wish: I believe that standard control to authenticate users with facebook and google accounts will be usefull to avoid own authentication in many cases.
    Cableguy likes this.
  4. billyrudi

    billyrudi Active Member Licensed User

    Hi alwaysbusy,
    two questions.
    how i can disable login button to prevent more click?
    how i can show an hourglass progrmmatically?
    tanks Paolo
  5. alwaysbusy

    alwaysbusy Expert Licensed User

    @billyrudi I'm sorry, but I do not understand your first question. Do you want to disable the button? You can check if the login/password is ok in b4j (like in the demo).
    As for the hourglass, there is one when you navigate between pages. I see if it it possible to make one that can be called by code.
  6. Gabino A. de la Gala

    Gabino A. de la Gala Active Member Licensed User

    Hello again!!!

    How I can add items to a list at runtime and refresh the page every time ?

    Right now I 'm doing with Page.Refresh after clickar on a table , element adds me on the list, but the page tables are me " rare " and stop behaving as usual. And you can not be ordered depending on the title of the column that you click , etc.

    In addition are the colors of the table also changed.

    Please. Look at this images:

    Before refresh:

    After refresh:

    Attached Files:

  7. billyrudi

    billyrudi Active Member Licensed User

    the first question is:
    if in login panel i click the buttom and i must wait a webserver to verify the username and password there is a way to lock the panel or the botton to prevent more than one click?
    for the second how i can show the hourglass that you you show when navigate between pages.
  8. Cableguy

    Cableguy Expert Licensed User

    About adding to the list, I can't help you there, but after you have added to the list, call "ABMShared.NavigateToPage" to reload the entire page
  9. billyrudi

    billyrudi Active Member Licensed User

    Hi alwaysbusy,
    another question..
    there is the way to add items to an ABMList programmatically and not in the BuildPage event?
  10. Gabino A. de la Gala

    Gabino A. de la Gala Active Member Licensed User

    I'm trying to do it in this way:

    Dim list1 As ABMList = page.Component("list1")

    Sub tbl2_clicked(PassedRowsAndColumns As List)
    ' is the root table
        Dim tblCellInfo As ABMTableCell = PassedRowsAndColumns.Get(0)
    Dim tbl As ABMTable = page.Component(tblCellInfo.TableName)
    Dim StringSelect As String = tbl.GetString(tblCellInfo.Row, tblCellInfo.Column)
    Dim list1 As ABMList = page.Component("list1")
    "H1""S"&(myToastId+1), BuildSimpleItem("L1H1S"&(myToastId+1),"", StringSelect))

        myToastId = myToastId + 
    page.ShowToast("toast" & myToastId, "toastred""Clicked " & tblCellInfo.TableName & " row " & tblCellInfo.Row & " column " & tblCellInfo.Column, 5000)
    End Sub
    But I've got 2 "problems":
    1. list1.refresh (apparently not work)
    2. page.refresh (works, but with the problems indicated in my previous post deforming the tables)
  11. alwaysbusy

    alwaysbusy Expert Licensed User

    I will have to look deeper into this, but you're right something is wrong with the refresh.
    Gabino A. de la Gala likes this.
  12. mwebim

    mwebim New Member Licensed User

    Thanks, I changed the path to version 8 java and all going now.
    alwaysbusy likes this.
  13. Gabino A. de la Gala

    Gabino A. de la Gala Active Member Licensed User

    I've founded a abnormal behaviour using fixed size tables.

    The footer band is putted twice:

    When I click y any row and the page is refreshed, the aspect is:

    And then, you can click in both rows with data...


    Attached Files:

  14. billyrudi

    billyrudi Active Member Licensed User

    there i a way to add to a listitem of ABMList component a tag to insert on object or srting value?
    regards paolo
  15. alwaysbusy

    alwaysbusy Expert Licensed User

    @billyrudi No, but I'll see what I can do. Making good progress on the bugs on the refresh of the table and list. There were some shortcuts I created when I started writing the framework that don't appear to work now that the framework is bigger. Quite some work to do but it looks you would not have to make any changes to your code once its done.
  16. billyrudi

    billyrudi Active Member Licensed User

    hi with this code i'm able to load item perfectly.
    Private Sub WebSocket_Connected (WebSocket1 As WebSocket)
       ws = WebSocket1   
    If ABMShared.NeedsAuthorization Then
    If ws.Session.GetAttribute2("IsAuthorized""") = "" Then
    End If
    End If
    ' connect our page with the websocket   
    ' Prepare the page IMPORTANT!
    End Sub

    Sub CaricaGriglia()
    Dim list1 As ABMList = page.Component(2,1,"list1")
    Dim ll As List
            ll = ws.Session.GetAttributesNames
    Dim ii As Int
    For ii = 0 To ll.Size -1
    Dim s As String
            s = ll.Get (ii)
    If s.StartsWith("$$"Then
    Dim lstmez As List = ws.Session.GetAttribute (s)
    Dim jj As Int
    For jj = 0 To lstmez.Size -1
    Dim sl() As String
    Dim tll As String
                    tll = lstmez.Get (jj)
                    sl = 
    Regex.Split ("\|",tll)
    Dim quando As String
                    quando = sl(
    '  20151117090830
                    quando = quando.SubString2 (6 ,8) & "/" &  quando.SubString2(4,6) & "/" &  quando.SubString2(0,4)& " " & quando.SubString2(8,10) & ":" &  quando.SubString2(10,12)
    "H1",  sl(2), BuildSimpleItem( sl(3),  "","{B}" & sl(2) & "{/B} - " & quando  & "{BR}{B}T1:{/B}" & Round2( sl(4),1) & "°C"  & " - {B}T2:{/B}:" & Round2(sl(5),1) & "°C" & " - {B}T3:{/B}:" & Round2(sl(6),1) & "°C" & " - {B}T4:{/B}:" & Round2(sl(7),1) & "°C"))
    End If

    End Try
    End Sub
  17. billyrudi

    billyrudi Active Member Licensed User

    Excuseme for my questions.... but working ...
    there is a way to make a reverse geocoding using this instructions for example?

    function initMap() {
    map = new google.maps.Map(document.getElementById('map'), {
        zoom: 8,
        center: {lat: 
    40.731, lng: -73.997}
      var geocoder = new google.maps.Geocoder;
      var infowindow = new google.maps.InfoWindow;

      document.getElementById('submit').addEventListener('click', function() {
        geocodeLatLng(geocoder, map, infowindow);

    function geocodeLatLng(geocoder, map, infowindow) {
      var input = document.getElementById('latlng').value;
      var latlngStr = input.split(',', 2);
      var latlng = {lat: parseFloat(latlngStr[0]), lng: parseFloat(latlngStr[1])};
      geocoder.geocode({'location': latlng}, function(results, status) {
        if (status === google.maps.GeocoderStatus.OK) {
          if (results[1]) {
            var marker = new google.maps.Marker({
              position: latlng,
              map: map
            infowindow.open(map, marker);
          } else {
            window.alert('No results found');
        } else {
          window.alert('Geocoder failed due to: ' + status);
  18. alwaysbusy

    alwaysbusy Expert Licensed User

    @billyrudi I add reverse geocoding to the next update.
    Cableguy likes this.
  19. Roberto P.

    Roberto P. Well-Known Member Licensed User

    there is a problem: after some time, the application is disconnected and is no longer reachable. There is a timer that stops or after a little time?

    thank you
  20. alwaysbusy

    alwaysbusy Expert Licensed User

    A mail with an update of ABMaterial has been sent to the donators containing a fix for the refresh() problem. As this one is rather important for everyone, it would be nice if I could get some quick feedback so I can put this release out for everyone.
  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