MichalK73 Well-Known Member Licensed User Longtime User Jul 5, 2018 #1 Hello. After switching to a 4.3 version of the project, ABMList Clicked stopped working. Update libraries 4.25 to 4.3 done. page.NeedsList = True is. How to solve it ?
Hello. After switching to a 4.3 version of the project, ABMList Clicked stopped working. Update libraries 4.25 to 4.3 done. page.NeedsList = True is. How to solve it ?
alwaysbusy Expert Licensed User Longtime User Jul 5, 2018 #2 I can't recall anything being changed, but put a Log(eventName) in ParseEvent and see if the method name is still the same. Upvote 0
I can't recall anything being changed, but put a Log(eventName) in ParseEvent and see if the method name is still the same.
MichalK73 Well-Known Member Licensed User Longtime User Jul 5, 2018 #3 OKAY. I added Code: Copy Sub Page_ParseEvent(Params As Map) Dim eventName As String = Params.Get("eventname") Dim eventParams() As String = Regex.Split(",",Params.Get("eventparams")) Log("Event->"&eventName) and got the result: Event-> 1_clicked when I click on the item in the list where I am: Code: Copy Dim lista As ABMList lista.Initialize (page, "lista", ABM.COLLAPSE_EXPANDABLE, "lista") page.Cell (3.1) .AddComponent (lista) Code: Copy Sub lista_Clicked(ItemId As String) Dim t As String = DBMh.SQLSelectSingleResult2("select title from faq where idx=?", Array As String(ItemId)) Dim v As String = DBMh.SQLSelectSingleResult2("select value from faq where idx=?", Array As String(ItemId)) Dim okno As ABMModalSheet = page.ModalSheet("AddModal") Dim tyt As ABMLabel = okno.Content.Component("tyt") Dim tresc As ABMEditor = okno.Content.Component("edit") tyt.Text = t tresc.SetHTML(v) tyt.Refresh tresc.Refresh If page.IsDesktop Then tyt.FontSize("34px") Else tyt.FontSize("14px") End If page.ShowModalSheet("AddModal") End Sub So is it bad? Upvote 0
OKAY. I added Code: Copy Sub Page_ParseEvent(Params As Map) Dim eventName As String = Params.Get("eventname") Dim eventParams() As String = Regex.Split(",",Params.Get("eventparams")) Log("Event->"&eventName) and got the result: Event-> 1_clicked when I click on the item in the list where I am: Code: Copy Dim lista As ABMList lista.Initialize (page, "lista", ABM.COLLAPSE_EXPANDABLE, "lista") page.Cell (3.1) .AddComponent (lista) Code: Copy Sub lista_Clicked(ItemId As String) Dim t As String = DBMh.SQLSelectSingleResult2("select title from faq where idx=?", Array As String(ItemId)) Dim v As String = DBMh.SQLSelectSingleResult2("select value from faq where idx=?", Array As String(ItemId)) Dim okno As ABMModalSheet = page.ModalSheet("AddModal") Dim tyt As ABMLabel = okno.Content.Component("tyt") Dim tresc As ABMEditor = okno.Content.Component("edit") tyt.Text = t tresc.SetHTML(v) tyt.Refresh tresc.Refresh If page.IsDesktop Then tyt.FontSize("34px") Else tyt.FontSize("14px") End If page.ShowModalSheet("AddModal") End Sub So is it bad?
Harris Expert Licensed User Longtime User Jul 5, 2018 #4 MichalK73 said: page.Cell (3.1) .AddComponent (lista) Click to expand... page.Cell (3.1) - should this not be: page.Cell (3,1) with a comma, not a period... yet this should generate error... Upvote 0
MichalK73 said: page.Cell (3.1) .AddComponent (lista) Click to expand... page.Cell (3.1) - should this not be: page.Cell (3,1) with a comma, not a period... yet this should generate error...
alwaysbusy Expert Licensed User Longtime User Jul 5, 2018 #5 it is weird that your get an event like 1_clicked. How do you add items to the list? Just checked and I can't find anything changed between 4.25 and 4.30 Upvote 0
it is weird that your get an event like 1_clicked. How do you add items to the list? Just checked and I can't find anything changed between 4.25 and 4.30
MichalK73 Well-Known Member Licensed User Longtime User Jul 6, 2018 #6 I followed the trail that @alwaysbus gave, checking adding items to the list. Code: Copy Dim list As ABMList = page.Component("lista") Dim wynik As List wynik = DBMh.SQLSelect("select * from faq") For i =0 To wynik.Size-1 Dim m As Map = wynik.Get(i) Dim pos As Int = i+1 list.AddItemWithTheme(m.Get("idx"),tytul(pos&". "&m.Get("title")),"poz") Next list.Refresh Code: Copy Sub tytul(value As String) As ABMLabel Dim a As ABMLabel a.Initialize(page,"1",value, ABM.SIZE_H5,True,"pozycja") a.Clickable = True If page.IsDesktop Then a.FontSize("24px") Else a.FontSize("14px") End If Return a End Sub And something like that does not work. However, I noticed that I gave there as id label "1" which did not bother with version 4.25. After changing to: Code: Copy Sub tytul(value As String) As ABMLabel Dim a As ABMLabel a.Initialize(page,value,value, ABM.SIZE_H5,True,"pozycja") a.Clickable = True If page.IsDesktop Then a.FontSize("24px") Else a.FontSize("14px") End If Return a End Sub Code: Copy Event->lista_clicked Everything is moving and working. But what effect does id_label have on the ABMList I do not know? Upvote 0
I followed the trail that @alwaysbus gave, checking adding items to the list. Code: Copy Dim list As ABMList = page.Component("lista") Dim wynik As List wynik = DBMh.SQLSelect("select * from faq") For i =0 To wynik.Size-1 Dim m As Map = wynik.Get(i) Dim pos As Int = i+1 list.AddItemWithTheme(m.Get("idx"),tytul(pos&". "&m.Get("title")),"poz") Next list.Refresh Code: Copy Sub tytul(value As String) As ABMLabel Dim a As ABMLabel a.Initialize(page,"1",value, ABM.SIZE_H5,True,"pozycja") a.Clickable = True If page.IsDesktop Then a.FontSize("24px") Else a.FontSize("14px") End If Return a End Sub And something like that does not work. However, I noticed that I gave there as id label "1" which did not bother with version 4.25. After changing to: Code: Copy Sub tytul(value As String) As ABMLabel Dim a As ABMLabel a.Initialize(page,value,value, ABM.SIZE_H5,True,"pozycja") a.Clickable = True If page.IsDesktop Then a.FontSize("24px") Else a.FontSize("14px") End If Return a End Sub Code: Copy Event->lista_clicked Everything is moving and working. But what effect does id_label have on the ABMList I do not know?
alwaysbusy Expert Licensed User Longtime User Jul 6, 2018 #7 I think it may be the Clickable = true thing. Using this you probably get the labels click event instead of the lists click event. Upvote 0
I think it may be the Clickable = true thing. Using this you probably get the labels click event instead of the lists click event.
MichalK73 Well-Known Member Licensed User Longtime User Jul 6, 2018 #8 Code: Copy Sub tytul(value As String) As ABMLabel Dim a As ABMLabel a.Initialize(page,"1",value, ABM.SIZE_H5,True,"pozycja") a.Clickable = False If page.IsDesktop Then a.FontSize("24px") Else a.FontSize("14px") End If Return a End Sub It works too. In version 4.25 as was a.Clickable = True it worked. The most important thing is that the problem is solved. Thank you for the tip. Upvote 0
Code: Copy Sub tytul(value As String) As ABMLabel Dim a As ABMLabel a.Initialize(page,"1",value, ABM.SIZE_H5,True,"pozycja") a.Clickable = False If page.IsDesktop Then a.FontSize("24px") Else a.FontSize("14px") End If Return a End Sub It works too. In version 4.25 as was a.Clickable = True it worked. The most important thing is that the problem is solved. Thank you for the tip.
Mashiane Expert Licensed User Longtime User Jul 7, 2018 #9 Just out of curiosity... Isn't it faster for a single call to the database better than running two whilst returning different fields in the same query? And then parse that query result? Or the impact is rather insignificant? Code: Copy Dim t As String = DBMh.SQLSelectSingleResult2("select title from faq where idx=?", Array As String(ItemId)) Dim v As String = DBMh.SQLSelectSingleResult2("select value from faq where idx=?", Array As String(ItemId)) Upvote 0
Just out of curiosity... Isn't it faster for a single call to the database better than running two whilst returning different fields in the same query? And then parse that query result? Or the impact is rather insignificant? Code: Copy Dim t As String = DBMh.SQLSelectSingleResult2("select title from faq where idx=?", Array As String(ItemId)) Dim v As String = DBMh.SQLSelectSingleResult2("select value from faq where idx=?", Array As String(ItemId))
MichalK73 Well-Known Member Licensed User Longtime User Jul 8, 2018 #10 Just so I wrote the code to make it easier. I did not consider the speed, because the base is still locally where the server on SSD. Upvote 0
Just so I wrote the code to make it easier. I did not consider the speed, because the base is still locally where the server on SSD.