Page 1 of 1

mobilebusyindicator

Posted: Fri Feb 13, 2015 8:52 pm
by brandcode
I have 2 cards in my ios app,and my second card take some time to load about 4 seconds.
is possible to use the mobilebusyindicator until the card be loaded?
i have try to put the bellow code but indicator is No show up.

Code: Select all

on mouseUp
mobileBusyIndicatorStart
go to cd "card2"
end mouseUp
end on the card2 i have include the mobileBusyIndicatorStop.

Re: mobilebusyindicator

Posted: Sat Feb 14, 2015 10:14 pm
by jacque
I think I'd first try to figure out what is taking so long to change cards. Four seconds is a long time. Also, it may be that the indicator actually is being shown, but it is being removed so quickly that you don't see it. If the mobileBusyIndicatorStop command is in a preOpenCard handler then that could be the case. It would also mean that the delay isn't in leaving card 1, but in a preOpenCard or openCard handler on card 2.

What handler on card 2 removes the indicator?

Re: mobilebusyindicator

Posted: Sun Feb 15, 2015 12:44 pm
by brandcode
thank you for the replay.
i have make a test with button. like bellow

Code: Select all

on mouseUp
mobileBusyIndicatorStart
wait 4 seconds
mobileBusyIndicatorStop
end mouseUp
the above code working.
my card take some time because of data loading from database.The 4 seconds yes is a long time but is only in the beginning when i start the app,after is bellow 500 milliseconds to open.
so the mobileBusyIndicatorStart is on mouseUp and the mobileBusyIndicatorStop is on the opencard

Code: Select all

on opencard
mobileBusyIndicatorStop
end opencard

Re: mobilebusyindicator

Posted: Sun Feb 15, 2015 6:45 pm
by jacque
I see. I'm not sure why it doesn't work when you change cards, but the solution is probably to put the busy indicator commands directly into the handler that calls the database. That is the slow part, so just use it there. Show the busy indicator at the top of that handler and remove it in the last line of the same handler. The other parts of your script will be fast enough to show no delay.

Re: mobilebusyindicator

Posted: Sun Feb 15, 2015 7:04 pm
by brandcode
jacque wrote:I see. I'm not sure why it doesn't work when you change cards, but the solution is probably to put the busy indicator commands directly into the handler that calls the database. That is the slow part, so just use it there. Show the busy indicator at the top of that handler and remove it in the last line of the same handler. The other parts of your script will be fast enough to show no delay.
thank you jacque i will give a try.. and i post the results