Android Question B4XSearchTemplate - Confirm selected item before the completed event

Jmu5667

Well-Known Member
Licensed User
Longtime User
Hello

Is it possible to confirm the selection of an item before the completed event occurs. My case is I want the user to be able to confirm their selection which would then trigger the complete event, or if they choose not to confirm the selection, they remain on the list so they can select a different item.

Regards

John.
 

Mahares

Expert
Licensed User
Longtime User
user to be able to confirm their selection which would then trigger the complete event, or if they choose not to confirm the selection
It stops to confirm your selection,. The user has the option to refuse it. In that case the control goes back to the button_click and the list is displayed instantly again. Since the data is already indexed, it is instant to get a new choice.
B4X:
Sub btnSearch_Click
    Dim rs As ResumableSub = Dialog.ShowTemplate(SearchTemplate, "", "", "CANCEL")
    Wait For (rs) Complete (Result As Int)
    If Result = XUI.DialogResponse_Positive Then
        Dim MySelection As String = SearchTemplate.SelectedItem
        wait for (Dialog.Show($"You selected: ${MySelection}"$, "OK", "", "Cancel")) Complete ( res As Int)
        If res = XUI.DialogResponse_Cancel Then
            MySelection=""
            btnSearch_Click
        End If
        btnSearch.xLBL.Text =MySelection
        Log($"myselection is: ${MySelection}"$)
    End If
End Sub
I am using a swiftButton. You can use a regular one.
 
Upvote 0
Top