Hi @Alexander Stolte, I am trying to implement "SelectionList". I downloaded the example file in #1 and couldn't find a code segment that explains the correct way to do it.
The example code seen above:
- What would be the way to call .ShowPage?
- Is there a way to change the text size of the elements to make them smaller? (I have some records with text that does not look good, so large and with so many characters)
I have managed to run using .ShowPage in .Action, but when selecting an item, it returns the following error.
Graphic example to show you the problem with text size
The example code seen above:
- What would be the way to call .ShowPage?
- Is there a way to change the text size of the elements to make them smaller? (I have some records with text that does not look good, so large and with so many characters)
I have managed to run using .ShowPage in .Action, but when selecting an item, it returns the following error.
** Activity (main) Resume **
Error occurred on line: 1604 (AS_SettingsPage)
java.lang.RuntimeException: Object should first be initialized (View).
Did you forget to call Activity.LoadLayout?
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
at anywheresoftware.b4a.objects.B4XViewWrapper.GetView(B4XViewWrapper.java:335)
at ar.com.sysprofile.psahb.as_settingspage._refreshselectionlistitems(as_settingspage.java:3397)
at ar.com.sysprofile.psahb.as_settingspage._selectionitem_click(as_settingspage.java:3507)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:7535)
at android.view.View.performClickInternal(View.java:7512)
at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
at android.view.View$PerformClick.run(View.java:29488)
at android.os.Handler.handleCallback(Handler.java:984)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loopOnce(Looper.java:238)
at android.os.Looper.loop(Looper.java:357)
at android.app.ActivityThread.main(ActivityThread.java:8118)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:957)
B4X:
Sub Class_Globals
Private pnlSettings As AS_Settings
Private pnlSettingPage As AS_SettingsPage
End Sub
B4X:
'AS_Settings
pnlSettings.MainPage.AddGroup("set_basic", mdlFunctions.loc.Localize("def_values"))
pnlSettings.MainPage.AddDescriptionItem("set_basic", mdlFunctions.loc.Localize("set_fed_club"))
pnlSettings.MainPage.AddProperty_Action("set_basic", "fed_action", mdlFunctions.loc.Localize("fed"), "", Null, mdlFunctions.loc.Localize("cmb_select"))
pnlSettings.MainPage.AddGroup("set_advance", mdlFunctions.loc.Localize("set_advance"))
pnlSettings.MainPage.AddProperty_Boolean("set_advance", "appConnect", mdlFunctions.loc.Localize("set_user_login"), mdlFunctions.loc.Localize("link_app"), Null, False)
pnlSettingPage.Initialize(pnlSettings, mdlFunctions.loc.Localize("opt_short"))
pnlSettingPage.AddGroup("selection", mdlFunctions.loc.Localize("fed"))
Dim lstItems As List
lstItems.Initialize
For Each intID As Int In mdlFunctions.map_cmn_lst_federaciones.Keys
Dim strItem As String = mdlFunctions.map_cmn_lst_federaciones.Get(intID).As (List).Get(0).As (String)
lstItems.Add(pnlSettings.CreateSelectionListItem(strItem, Null, intID))
Next
pnlSettingPage.AddProperty_SelectionList("selection", "federation", lstItems, Array(), False, True)
pnlSettings.MainPage.Create
'AS_Settings
B4X:
Private Sub pnlSettings_ActionClicked(Property As AS_Settings_Property)
Select Case Property.PropertyName
Case "fed_action"
pnlSettingPage.ShowPage()
End Select
End Sub
Graphic example to show you the problem with text size