Listpicker elements not showed on first pick

Hi Everyone,
I have a listpicker populated with a recordset (same code of table taifun).

Someone can tell me why in a listpicker, when I press the first time, the list of items is not displayed, if I click again instead yes.
It happens only the firse time I run, from the second on I have no problems.
It happens on companion but on emulator too.

There is a way to do a refresh?

Please show your relevant blocks.

It sound like you are not loading the list to the listpicker elements until after you view the listpicker.

Here blocks.

listpicker.beforepicking call a query that populates list "listaDaMostrare". (it work)
Then, I add every item in three sublist, so I show 1 list in listpicker and I can control ID in other lists.

As I guessed, you are setting the listpicker1 elements AFTER you have called the listpicker (even though you think you have done it before the picker opens). The picker will open at the same time as you run the query.

Use a button to perform the actions in your beforePicking event, then call the listpicker to open at the end of the procedure riempiMenuListPicker in the if statement.

I get it.
But I can't use a button because I have to load the list when I click on the listpicker.

In this example:
https://puravidaapps.com/snippets.php#2nestedlistpicker
list are loaded on beforePicking event.
What is the difference? Same code, different results.

The only solution is to load lists directly on screen initializing.

This is not the same.... the elements are loaded from a list that already exists.

You can use a button. Simply change the visibility of the listpicker button to false and replace with a button. In your procedure, the if/else statement at the end, include the call Listpicker(x).Open block. This will open the listpicker with the loaded list.

great solution! Thanks :grinning:

Excuse me TIMA2,
now I modified it with your suggestion and added second ListPicker to show sublist.
Here code:

It works.
Just one detail.
When I pick on first ListPicker, list disappear and show second list, but the screen below appears for a moment.
There is no continuity between two list.
It is not nice to see.
Any suggenstion?

You could try something like this example:

twopickers.aia (3.3 KB)

All your screen elements are contained within an arrangement. When the Pick button is pressed, this arrangement is hidden, and another arrangement, with a black background (or a background colour matching your listpickers) is made visible. This is all reversed after a selection is made from the second listpicker.

Here is an example of how to show breadcrumbs for a nested List Picker.
The base table is pre-loaded at Screen Initialize time, so I was able to load at before Selection time ...
back


Capture
Capture2 Docs.csv (3.5 KB) DocumenterV4.aia (5.7 KB)
global Docs
global Selection
global Viewed
last

pop_Viewed
when Screen1 BackPressed

when ListPicker1 AfterPicking
push_viewed
back
All blocks: