I will check, never had the need.Hi, Does it support RTL?
Private Sub BuildPage
dettagliorigo.AddPropertySelect("pizza", "pizza", "", "", True, "left", mapPIZZA) 'how to get the change?
dettagliorigo.AddPropertySelect("size", "Size", "", "Size", True, "", CreateMap()) ' NO size ELEMENT INTO MAP (combo element)
End Sub
dim spizza as string = pb.GetPropertyValue("pizza")
select case spizza
case "a"
dim sizem as map = createmap("s":"Small", "m":"Medium")
pb.SetPropertySelectMap("size", sizem)
case "b"
...
case "c"
...
end Select
'change the size to be medium
pb.SetPropertyValue("size", "m")
I kindly request that you do not post on existing threads. As communicated to you via email there is a question and answer thread for SithasoDaisy and this is definitely not it.Dear Anele, I am not able to get an item click event in SDUIDrawer's Menu. I used additem and additemchild. When I click the child item it gives string of parent id of the child not it's own id. Can you help me in this. Project could not uploaded here.
'Static code module
Sub Process_Globals
Public app As SDUIApp 'ignore
Public BANano As BANano 'ignore
'Private SQLite As BANanoSQLiteE
Private strModule As String = "Purchase"
Private appdrawer As SDUIDrawer
Public dbname As String
End Sub
Sub Initialize
dbname = "FormDB.db"
'initialize the app
BANano.Await(app.AddApp(Me, Main.AppName))
'set the font of the app
app.Font = "font-sans"
'load the base layout
BANano.LoadLayout(app.Here, "baselayout")
'add any other page not added to the drawer menu
'AddPages
AddDrawerMenu
'show the sign in page
IsAuthenticated(False)
pgSignin.Show(app)
End Sub
'show/hide drawer
Sub IsAuthenticated(b As Boolean)
' If b Then
' appdrawer.Show
' appdrawer.AdjustClippedLeft(True)
' appnavbar.Show
' appfooter.Show
' Else
' appdrawer.AdjustClippedLeft(False)
' appdrawer.Hide
' appnavbar.hide
' appfooter.Hide
' End If
End Sub
private Sub AddDrawerMenu
' SQL query
Dim strSQL As String = "SELECT caption,mindex,nindex,REPLACE(NIndex, ',', '_') AS nnindx,formcode,nformcode,MenuCategory FROM NewMenu2004 WHERE (user1 = 'admin' AND ErpModule = '" & strModule & "' AND CompanyCode = 'PPL') AND LEFT(nindex, 2) <> '00' AND mindex NOT LIKE ',%' AND nindex NOT LIKE ',%' ORDER BY nindex"
Dim rsMSMenu As BANanoSQLiteE
rsMSMenu.Initialize("FormDB", "", "", "")
'rsMSMenu.SetConnection(Main.ServerName, Main.Uname, Main.Pwd, Main.FormDB)
rsMSMenu.Execute(strSQL)
rsMSMenu.JSON = BANano.CallInlinePHPWait(rsMSMenu.MethodName, rsMSMenu.Build)
rsMSMenu.FromJSON
appdrawer.Clear("")
For Each resmap As Map In rsMSMenu.result
Dim strNindex As String = resmap.Get("nindex")
Dim strMenuName As String = resmap.Get("caption")
Dim strFormCode As String = resmap.Get("formcode")
Log(strFormCode)
' Generate Parent-Child structure
Dim result() As String = GenerateParentChild(strNindex)
Log($"Input: ${strNindex}, Parent: ${result(0)}, Child: ${result(1)}"$)
If strNindex.Trim.Length = 2 Then
Dim aditem As SDUIDrawer
aditem.Initialize(Me, "", "")
aditem = appdrawer.AddItem(result(1), strMenuName)
aditem.Tag = result(1) ' Set the menu item key as the tag
Else
appdrawer.AddItemChild(result(0), result(1), strFormCode & "-" & strMenuName)
End If
Next
End Sub
Sub GenerateParentChild(inputString As String) As String()
Dim segments() As String = Regex.Split(",", inputString)
Dim parent As String = ""
Dim child As String = ""
' Create the child
child = "F" & segments(0)
For i = 1 To segments.Length - 1
child = child & "_" & segments(i)
Next
' Create the parent
If segments.Length = 1 Then
parent = "-"
Else
parent = "F" & segments(0)
For i = 1 To segments.Length - 2
parent = parent & "_" & segments(i)
Next
End If
' Return as an array
Return Array As String(parent, child)
End Sub
Private Sub appdrawer_menu_Click (item As String)
Log(item)
End Sub
1. You cannot create aditem as SDUIDrawer for each item you need to add to an existing appdrawer.Dim aditem As SDUIDrawer
aditem.Initialize(Me, "", "")
aditem = appdrawer.AddItem(result(1), strMenuName)
aditem.Tag = result(1) ' Set the menu item key as the tag
Dear Anele, Thank you for your response. this underscore only within database as values not used in declaration of variables here and corrected query i sent herewith and i use this code in pgIndex.bas and as a stranger i don't know BANanoSQLiteE connection with formdb please help meI kindly request that you do not post on existing threads. As communicated to you via email there is a question and answer thread for SithasoDaisy and this is definitely not it.
With that said, each element you add must not have an underscore in the key. It won't work. Please see the examples in the demo of adding items to the menu.
Please also enclose your code inside a code fragment to make it readable.
Please start a new thread with your question. You were not supposed to post questions on existing threads. zip your project from the ide by clicking the 'gift' icon and include the zip. If its large save it on Google drive and post a shareable link.Dear Anele, Thank you for your response. this underscore only within database as values not used in declaration of variables here and corrected query i sent herewith and i use this code in pgIndex.bas and as a stranger i don't know BANanoSQLiteE connection with formdb please help me
'Static code module
Sub Process_Globals
Public app As SDUIApp 'ignore
Public BANano As BANano 'ignore
'Private SQLite As BANanoSQLiteE
Private strModule As String = "Purchase"
Private appdrawer As SDUIDrawer
Public dbname As String
End Sub
Sub Initialize
dbname = "FormDB.db"
'initialize the app
BANano.Await(app.AddApp(Me, Main.AppName))
'set the font of the app
app.Font = "font-sans"
'load the base layout
BANano.LoadLayout(app.Here, "baselayout")
'add any other page not added to the drawer menu
'AddPages
AddDrawerMenu
'show the sign in page
IsAuthenticated(False)
pgSignin.Show(app)
End Sub
'show/hide drawer
Sub IsAuthenticated(b As Boolean)
End Sub
Private Sub AddDrawerMenu
' SQL query
Dim strSQL As String = "SELECT caption, mindex, nindex,REPLACE(nindex, ',', '_') AS nnindx,formcode, nformcode, MenuCategory FROM NewMenu2004 WHERE user1 = 'admin' AND ErpModule = 'Purchase' AND CompanyCode = 'PPL' AND SUBSTR(nindex, 1, 2) <> '00' AND mindex NOT LIKE ',%' AND nindex NOT LIKE ',%' ORDER BY nindex;"
Dim rsMSMenu As BANanoSQLiteE
rsMSMenu.Initialize("FormDB", "", "", "")
'rsMSMenu.SetConnection(Main.ServerName, Main.Uname, Main.Pwd, Main.FormDB)
rsMSMenu.Execute(strSQL)
rsMSMenu.JSON = BANano.CallInlinePHPWait(rsMSMenu.MethodName, rsMSMenu.Build)
rsMSMenu.FromJSON
appdrawer.Clear("")
For Each resmap As Map In rsMSMenu.result
Dim strNindex As String = resmap.Get("nindex")
Dim strMenuName As String = resmap.Get("caption")
Dim strFormCode As String = resmap.Get("formcode")
Log(strFormCode)
' Generate Parent-Child structure
Dim result() As String = GenerateParentChild(strNindex)
Log($"Input: ${strNindex}, Parent: ${result(0)}, Child: ${result(1)}"$)
If strNindex.Trim.Length = 2 Then
Dim aditem As SDUIDrawer
aditem.Initialize(Me, "", "")
aditem = appdrawer.AddItem(result(1), strMenuName)
aditem.Tag = result(1) ' Set the menu item key as the tag
Else
appdrawer.AddItemChild(result(0), result(1), strFormCode & "-" & strMenuName)
End If
Next
End Sub
Sub GenerateParentChild(inputString As String) As String()
Dim segments() As String = Regex.Split(",", inputString)
Dim parent As String = ""
Dim child As String = ""
' Create the child
child = "F" & segments(0)
For i = 1 To segments.Length - 1
child = child & "_" & segments(i)
Next
' Create the parent
If segments.Length = 1 Then
parent = "-"
Else
parent = "F" & segments(0)
For i = 1 To segments.Length - 2
parent = parent & "_" & segments(i)
Next
End If
' Return as an array
Return Array As String(parent, child)
End Sub
Private Sub appdrawer_menu_Click (item As String)
Log(item)
End Sub
The simplest form of adding child items to the menu is this...Please start a new thread with your question. You were not supposed to post questions on existing threads. zip your project from the ide by clicking the 'gift' icon and include the zip. If its large save it on Google drive and post a shareable link.
Please log and save the result of rsMSMenu in a text file and include it with your project so that I use that to reproduce your problem.
Remember the first variable for additem or addchilditem cannot start with a numeric value, cannot have an underscore, cannot have a comma but should be an alphanumeric word. This is because this creates an html element using the key you specify.
private Sub AddDrawerMenu
appdrawer.AddItem("anywhere", "Anywhere Software")
appdrawer.AddItemChild("anywhere", "b4a", "Basic 4 Android")
appdrawer.AddItemChild("anywhere", "b4i", "Basic 4 iPhone")
appdrawer.AddItemChild("anywhere", "b4j", "Basic 4 Java")
appdrawer.AddItemChild("anywhere", "b4r", "Basic 4 Arduino")
End Sub
Private Sub appdrawer_menu_Click (item As String)
app.ShowToastSuccess(item)
End Sub
Like I requested before with your previous question that you posted on this thread. Please start a new thread for your question. This thread is not for asking questions. Please start a new thread just like I explained in the email I send you when you got SithasoDaisy. Please.dear Anele, can you help me from Bananomssqle result set can be create columns and setitems in SUDItable please help me