B4J Question [BANano] Is Find on BANanoElement is supported or not?

Toky Olivier

Active Member
Licensed User
Longtime User
In the booklet, it is said :
B4X:
Find (filter As String) As BANanoElement()
Get all of the descendants of the nodes with a filter

But when I use it like here:
B4X:
Dim found() As BANanoElement
found = src.Parent(".dropdown")(0).Find(".dropdown-toggle")

There is an error:
B4X:
[ERROR 21]: [TBDropdown,handledropdownitemclicks: 264] find is not supported in BANano!
-->  found = src.Parent( {120} )(0).Find( {121} )
--> Current next: find --> Current index: 13
--> Current Translation: __4c=_src.parent(".dropdown").toU()(0).%find%
--> Method : ---- METHOD: handledropdownitemclicks (MODULE: TBDropdown, ISPRIVATE: true) ----
B4J DECLARE:
   LINE NUMBER: 252
   ORIGINAL LINE: private Sub HandleDropdownItemClicks(e As BANanoEvent) As Object 'ignore
   CLEANED LINE: private sub handledropdownitemclicks(e as bananoevent) as object
   WORDS: private|sub|handledropdownitemclicks|(|e|as|bananoevent|)|as|object|
INTERNAL VARS:
   B4JName: e, EventName: , JSName: _e ,ISPRIVATE: true,B4JTYPE: bananoevent, IsArray: false, InitValue: null
   B4JName: src, EventName: , JSName: _src ,ISPRIVATE: true,B4JTYPE: bananoelement, IsArray: false, InitValue: null
   B4JName: ret, EventName: , JSName: _ret ,ISPRIVATE: true,B4JTYPE: object, IsArray: false, InitValue: {}
   B4JName: found, EventName: , JSName: __4c ,ISPRIVATE: true,B4JTYPE: bananoelement, IsArray: true, InitValue: []
RETURNS:    B4JTYPE: object, IsArray: false, InitValue: {}
------------------------------
 
Solution
This appears to be a chaining bug. Will be solved in the next maintenance update. Try for now:

B4X:
Dim found As BANanoElement
found = src.Parent(".dropdown")(0)
found = found.Find(".dropdown-toggle")(0)

Alwaysbusy
Top