Hello,
I am using NSBasic 5.2.1.3 and the wait cursor is not displayed whenever the process are not stopped (I understand that is the normal functionality, however it says in the documentation that we can use SetTimeOut function as a workaround to have the wait cursor displayed before the process ends (in this case, I want to display the waitcursor before an ajax call). The thing is that this workaround is not working. Do you know any other way to do this?
My code is the following:
Function ImgFTBtnLunch_onclick()
If ExistLunch=True Then
WaitCursor True
SetTimeout(BuildRequest("L"),0)
Else
MsgBox("No existen recetas de comida con los ingredientes seleccionados")
End If
End Function
'-------------------------------------------------------------------------------------------------------------------------------
' The function that is called is the following
Sub BuildRequest(Timing)
Dim result
Dim counter
Dim counter2
Dim RecipesMsg
Dim empty
empty=True
'Clears the final message string
FinalMsg=UserOid & "|"
'Checks all the product list and store them in the FinalMsg string
If ScanCode="" Then
result=$("#LstBoxFilteringProducts").jqxListBox("getCheckedItems")
result2=$("#LstBoxFilteringNewProd").jqxListBox("getCheckedItems")
If result.length<>0 Or result2.length<>0 Then
FinalMsg=FinalMsg & Timing & "|" & CStr(CInt(result.length) + CInt(result2.length))
If result.length<>0 Then
For counter=0 To result.length-1
FinalMsg=FinalMsg & "|" & result[counter].label
Next
empty=False
End If
If result2.length<>0 Then
For counter=0 To result2.length-1
FinalMsg=FinalMsg & "|" & result2[counter].label
Next
empty=False
End If
End If
If (empty=True) Then
MsgBox "Se debe seleccionar al menos un producto"
Exit Sub
End If
Else
FinalMsg=FinalMsg & Timing & "|1|" & ScanProductName
End If
'Calls the GetRecipes web service to get the recipe information
response=WebServiceRequestGet("GetRecipes",FinalMsg)
If response<>"" Then
responseString=response
responseArray=Split(responseString,"|")
If CInt(responseArray[0])<>0 Then 'Validates if there is any recipe to process
elementsRecipe=responseArray[0]
ReDim DishOid(elementsRecipe)
ReDim ArrayImgDish(elementsRecipe)
ReDim ArrayNameDish(elementsRecipe)
counter2=0
For counter=1 To (elementsRecipe*3) Step 3
ArrayNameDish[counter2]=responseArray[counter]
ArrayImgDish[counter2]=responseArray[counter+1]
DishOid[counter2]=responseArray[counter+2]
counter2=counter2+1
Next
End If
End If
If elementsRecipe>0 Then
RecipeOrigin="FoodTime"
FrmFiltering=NSB.currentForm
TimingTitle=""
Select Case Timing
Case "B"
LblRecipeHeader.text="Desayunos"
Case "L"
LblRecipeHeader.text="Comidas"
Case "D"
LblRecipeHeader.text="Cenas"
Case "P"
LblRecipeHeader.text="Postres"
Case "T"
LblRecipeHeader.text="Bebidas"
End Select
ChangeForm(Recipe)
Else
MsgBox ("No existen recetas que cubran sus criterios seleccionados")
End If
Error=0
Catch err
Error=-1
MsgBox (err & vbCRLF & "Routine: BuildRequest")
End Try
End Sub
Thanks in Advance,
Adrian