Hi there
I need a user to confirm an action with a Yes/No and subsequent processes should happen after the button click, depending on whether a yes or a no is selected.
Can someone please advise if there is a way around this? This is just my example, it works but does not wait..
I need a user to confirm an action with a Yes/No and subsequent processes should happen after the button click, depending on whether a yes or a no is selected.
Can someone please advise if there is a way around this? This is just my example, it works but does not wait..
B4X:
Sub Confirm(sEvent As String, sTitle As String, sMessage As String)
Msgbox2(sEvent, sMessage, sTitle, Array As String("Yes", "No"))
End Sub
Sub btnDelete_Click
Dim btn As ImageView
btn = Sender
'msa.with(mst.pulse).duration(500).playon(btn)
jobMap = CurrentComment
media_id = jobMap.Get("media_id")
day_comment_id = jobMap.Get("day_comment_id")
' confirm from the user
Confirm("DeleteComment_Click","Delete Comment", "Are you sure that you want to delete this comment?")
End Sub
' code to use for confirm
Private Sub DeleteComment_Click(ButtonText As String)
' your code
Select Case ButtonText.tolowercase
Case "yes"
'ProgressDialogShow2("Loading, please wait...",False)
modMashiane.showspinner(hd)
dbAction.Initialize
dbAction.Put("action", "delete")
dbAction.Put("day_comment_id", day_comment_id)
dbAction.Put("media_id", media_id)
modMashiane.ExecutePHP(Me,dbAction, "delete", "comments.php", media_id)
Case "no"
End Select
End Sub