B4J Library [BANano] Kendo UI Core - Wrapper

Discussion in 'B4J Libraries & Classes' started by Kiffi, Feb 28, 2019.

  1. Kiffi

    Kiffi Active Member Licensed User

    @GanjaKyp : Please try again with the attached files.

    At least SimpleDemo should work.
     

    Attached Files:

    joulongleu likes this.
  2. GanjaKyp

    GanjaKyp Member

    Doesn't work :(

    Code:
    Reading B4J INI in C:\Users\Администратор\AppData\Roaming\Anywhere Software\B4J to find Additional Libraries folder...
    Found Additional Libraries folder: C:\Users\Администратор\YandexDisk\B4X Library\JLibraries
    Building C:\inetpub\wwwroot\BANano\SimpleDemo\scripts\app.js
    Loading library: C:\Users\Администратор\YandexDisk\B4X Library\JLibraries\bananokendoui.xml
    java.net.MalformedURLException: unknown protocol: c
        at java.net.URL.<init>(URL.java:
    600)
        at java.net.URL.<init>(URL.java:
    490)
        at java.net.URL.<init>(URL.java:
    439)
        at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:
    620)
        at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:
    148)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:
    805)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:
    770)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:
    141)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:
    1213)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:
    643)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:
    327)
        at javax.xml.parsers.SAXParser.parse(
    SAXParser.java:274)
        at com.ab.banano.BANano.a(Unknown Source)
        at com.ab.banano.BANano.b(Unknown Source)
        at com.ab.banano.BANano.a(Unknown Source)
        at com.ab.banano.BANano.Build(Unknown Source)
        at b4j.example.main._appstart(main.java:
    66)
        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:
    498)
        at anywheresoftware.b4a.BA.raiseEvent2(BA.java:
    91)
        at anywheresoftware.b4a.BA.raiseEvent(BA.java:
    78)
        at b4j.example.main.start(main.java:
    37)
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$
    162(LauncherImpl.java:863)
        at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$
    175(PlatformImpl.java:326)
        at com.sun.javafx.application.PlatformImpl.lambda$
    null$173(PlatformImpl.java:295)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$
    174(PlatformImpl.java:294)
        at com.sun.glass.ui.InvokeLaterDispatcher$
    Future.run(InvokeLaterDispatcher.java:95)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at com.sun.glass.ui.win.WinApplication.lambda$
    null$148(WinApplication.java:191)
        at java.lang.Thread.run(
    Thread.java:748)
    Library: C:\Users\Администратор\YandexDisk\B4X Library\JLibraries\bananokendoui.xml 
    is not a BANano library!
    ERROR 
    22: [SimpleDemo,simpledemo_ready, around line: 36] bananokendowindow(METHODVAR) is not supported in BANano!
    -->  myWindow.Initialize(Me, {
    10} , {11} )
    --> Current index: 1
    --> Var :    B4JName: mywindow, JSName: _mywindow ,ISPRIVATE: true,B4JTYPE: bananokendowindow, IsArray: false, InitValue: /* NOT SUPPORTED */
    --> Method : ---- METHOD: simpledemo_ready (MODULE: SimpleDemo, ISPRIVATE: false) ----
    B4J DECLARE:
       LINE NUMBER: 33
       ORIGINAL LINE: Sub SimpleDemo_Ready()
       CLEANED LINE: sub simpledemo_ready()
       WORDS: sub|simpledemo_ready|(|)|
    INTERNAL VARS:
       B4JName: mywindow, JSName: _mywindow ,ISPRIVATE: true,B4JTYPE: bananokendowindow, IsArray: false, InitValue: /* NOT SUPPORTED */
    RETURNS:    B4JTYPE: string, IsArray: false, InitValue: ''
    ------------------------------
    ERROR 22: [SimpleDemo,simpledemo_ready, around line: 37] bananokendowindow(METHODVAR) is not supported in BANano!
    -->  myWindow.AddToParent( {12} )
    --> Current index: 1
    --> Var :    B4JName: mywindow, JSName: _mywindow ,ISPRIVATE: true,B4JTYPE: bananokendowindow, IsArray: false, InitValue: /* NOT SUPPORTED */
    --> Method : ---- METHOD: simpledemo_ready (MODULE: SimpleDemo, ISPRIVATE: false) ----
    B4J DECLARE:
       LINE NUMBER: 33
       ORIGINAL LINE: Sub SimpleDemo_Ready()
       CLEANED LINE: sub simpledemo_ready()
       WORDS: sub|simpledemo_ready|(|)|
    INTERNAL VARS:
       B4JName: mywindow, JSName: _mywindow ,ISPRIVATE: true,B4JTYPE: bananokendowindow, IsArray: false, InitValue: /* NOT SUPPORTED */
    RETURNS:    B4JTYPE: string, IsArray: false, InitValue: ''
    ------------------------------
    ERROR 22: [SimpleDemo,simpledemo_ready, around line: 38] bananokendowindow(METHODVAR) is not supported in BANano!
    -->  myWindow.Title = {13}
    --> Current index: 1
    --> Var :    B4JName: mywindow, JSName: _mywindow ,ISPRIVATE: true,B4JTYPE: bananokendowindow, IsArray: false, InitValue: /* NOT SUPPORTED */
    --> Method : ---- METHOD: simpledemo_ready (MODULE: SimpleDemo, ISPRIVATE: false) ----
    B4J DECLARE:
       LINE NUMBER: 33
       ORIGINAL LINE: Sub SimpleDemo_Ready()
       CLEANED LINE: sub simpledemo_ready()
       WORDS: sub|simpledemo_ready|(|)|
    INTERNAL VARS:
       B4JName: mywindow, JSName: _mywindow ,ISPRIVATE: true,B4JTYPE: bananokendowindow, IsArray: false, InitValue: /* NOT SUPPORTED */
    RETURNS:    B4JTYPE: string, IsArray: false, InitValue: ''
    ------------------------------
    Building C:\inetpub\wwwroot\BANano\SimpleDemo\index.html
     
  3. Kiffi

    Kiffi Active Member Licensed User

    joulongleu likes this.
  4. alwaysbusy

    alwaysbusy Expert Licensed User

    Michael1968 and joulongleu like this.
  5. Michael1968

    Michael1968 Active Member Licensed User

    Alain,
    Version 2.35 solved the problem.

    Alain...Kiffi... thx a lot

    Michael1968
     
    Kiffi and alwaysbusy like this.
  6. semar

    semar Active Member Licensed User

    Impressive work !

    A question: would be possible to use the kendo library also only in conjunction with ABMaterial ? Or do I need BANano for that ?

    Regards,
    Sergio
     
    joulongleu likes this.
  7. alwaysbusy

    alwaysbusy Expert Licensed User

    @semar No, BANano and ABMaterial are two different frameworks that are not compatible with each other.
     
    joulongleu and Kiffi like this.
  8. Harris

    Harris Well-Known Member Licensed User

    Yet... (we hope)... Blend if possible...
     
    joulongleu likes this.
  9. joulongleu

    joulongleu Active Member

    :)Tutorial: BANanoKendoDataSource (Part 2),hope can come out soon.:)
     
  10. Kiffi

    Kiffi Active Member Licensed User

    Tutorial: BANanoKendoDataSource (Part 2) (you can find part 1 of this tutorial here)

    We start with again this code:
    Code:
    Dim myDataSource As BANanoKendoDataSource
    myDataSource.Initialize(Me, 
    "myDataSource")

    myDataSource.Add(CreateMap(
    "name""Jane Doe""age""30"))
    myDataSource.Add(CreateMap(
    "name""John Doe""age""33"))
    myDataSource.Add(CreateMap(
    "name""Jill Doe""age""55"))
    myDataSource.Add(CreateMap(
    "name""Jock Doe""age""99"))

    Dim myListbox As BANanoKendoListbox
    myListbox.Initialize(Me, 
    "myListBox""myListBox")
    myListbox.AddToParent(
    "body")
    myListbox.DataSource = myDataSource
    myListbox.Template = 
    "#:name# is #:age# years old"
    ... to get this Listbox:

    [​IMG]

    Filtering items:

    KendoDataSource can filter data entries according to certain criteria.

    For example:

    Code:
    ' Return all records whose first name begins with "Jo":
    Dim myFilter As Map = CreateMap("field""name""operator""startswith""value""Jo")
    myDataSource.Filter = myFilter
    [​IMG]


    Code:
    ' Return all records whose age is greater than 50 years:
    Dim myFilter As Map = CreateMap("field""age""operator""gt""value""50")
    myDataSource.Filter = myFilter
    [​IMG]

    The following values can be entered in operator:
    Code:
    "eq" (equal to)
    "neq" (not equal to)
    "isnull" (is equal to null)
    "isnotnull" (is not equal to null)
    "lt" (less than)
    "lte" (less than or equal to)
    "gt" (greater than)
    "gte" (greater than or equal to)
    "startswith"
    "doesnotstartwith"
    "endswith"
    "doesnotendwith"
    "contains"
    "doesnotcontain"
    "isempty"
    "isnotempty"

    You can set several filters as a conjunction (AND):

    Code:
    Dim myFilter As Map
    myFilter.Initialize
    myFilter.Put(
    "logic""and")

    Dim myFilters As List
    myFilters.Add(CreateMap(
    "field""name""operator""startswith""value""Jo"))
    myFilters.Add(CreateMap(
    "field""age""operator""gt""value""50"))

    myFilter.Put(
    "filters", myFilters)  

    myDataSource.Filter = myFilter
    [​IMG]

    ... or OR:

    Code:
    Dim myFilter As Map
    myFilter.Initialize
    myFilter.Put(
    "logic""or")

    Dim myFilters As List
    myFilters.Add(CreateMap(
    "field""name""operator""startswith""value""Jo"))
    myFilters.Add(CreateMap(
    "field""age""operator""gt""value""50"))

    myFilter.Put(
    "filters", myFilters)  

    myDataSource.Filter = myFilter
    [​IMG]

    That's it for now. See you later at the next tutorial. :)

    Greetings ... Peter
     
    alwaysbusy and joulongleu like this.
  11. Kiffi

    Kiffi Active Member Licensed User

    Tutorial: BANanoKendoDataSource (Part 3)

    KendoDataSource also has the ability to aggregate data.

    Again, we take the Doe family as an example:
    Code:
    Dim myDataSource As BANanoKendoDataSource
    myDataSource.Initialize(Me, 
    "myDataSource")

    myDataSource.Add(CreateMap(
    "name""Jane Doe""age"30))
    myDataSource.Add(CreateMap(
    "name""John Doe""age"33))
    myDataSource.Add(CreateMap(
    "name""Jill Doe""age"55))
    myDataSource.Add(CreateMap(
    "name""Jock Doe""age"99))
    (please note that in contrast to the previous examples, the age is passed as a number here)

    Now we want to know who is the youngest (min) and oldest (max) family member and the average age of the family:
    Code:
    Dim myAggregateList As List
    myAggregateList.Initialize

    myAggregateList.Add(CreateMap(
    "field""age""aggregate""average"))
    myAggregateList.Add(CreateMap(
    "field""age""aggregate""min"))
    myAggregateList.Add(CreateMap(
    "field""age""aggregate""max"))

    myDataSource.Aggregate = myAggregateList
    The possible values for the aggregate-field are:
    Code:
    "average" - Only for Number.
    "count" - String, Number and Date.
    "max" - Number and Date.
    "min" - Number and Date.
    "sum" - Only for Number.

    With the Aggregates-function we get a map whose members we can read out:
    Code:
    Dim ageAggregate As Map = myDataSource.Aggregates("age")

    Log(ageAggregate.Get("average")) ' -> 54.25
    Log(ageAggregate.Get("min")) ' -> 30
    Log(ageAggregate.Get("max")) ' -> 99
    That's it for now. See you later at the next tutorial. :)

    Greetings ... Peter
     
    Last edited: Apr 7, 2019
    micro, joulongleu and alwaysbusy like this.
  12. joulongleu

    joulongleu Active Member

    Hi:Kiffi:Thank you for your teaching,There is another problem ,TabStrip1_Select(Event As Map),How to take the value?
     
  13. Kiffi

    Kiffi Active Member Licensed User

    with
    Code:
    TabStrip1.SelectedTab
    Greetings ... Peter
     
    joulongleu likes this.
  14. joulongleu

    joulongleu Active Member

    Hi :)Kiffi:Thank you for your assistance,There is another problem ,ListView1_Change(Event As Map) ,How to take the value?:)
     
  15. DonManfred

    DonManfred Expert Licensed User

    really min 99, max 30?
     
    joulongleu likes this.
  16. Kiffi

    Kiffi Active Member Licensed User

    It's been corrected. Thank you for pointing this out.
     
    joulongleu and DonManfred like this.
  17. Kiffi

    Kiffi Active Member Licensed User

    I still have to implement that. Stay tuned...
     
    joulongleu likes this.
  18. Bladimir Carrillo

    Bladimir Carrillo Member Licensed User

    Great job Kiffi, congrats and thank you very much, just now I am testing...

    After compilation of demo in B4J I have some errors...

    Some idea ?
     
    joulongleu likes this.
  19. Kiffi

    Kiffi Active Member Licensed User

  20. Bladimir Carrillo

    Bladimir Carrillo Member Licensed User

    Thanks @Kiffi Problem solved moving librarys to Additional Librarys folder.

    Now, I have a question...
    I was added two TextFields and two Buttons to WindowLayot (on BABanoKendo demo) to simulate a Login and Register new users on a MySQL database (based on this sample https://www.b4x.com/android/forum/threads/banano-mysql-crud-with-php-part-1.104622/).
    How I can get the TextField values (name and password) and send to my database (making a call to php process) when I click the button ?

    Thanks a lot, regards
     
    joulongleu likes this.
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