Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Buttons and labels does not refresh


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Mar 12, 2015 8:37 AM Last Post By: pss edn
pss edn

Posts: 45
Registered: 1/13/04
Buttons and labels does not refresh  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 8, 2015 1:20 PM
Working with XE7 Update 1, and this is my first Android application.

I see that buttons and labels in my application are not updated at all after changing .Enabled or .Visible state.
I am using the following code before calling a web service for a response, so I want to tell the user that must wait:

cmdSend.Enabled := False;
cmdSend.Refresh;
lblWait.Visible := True;
lblWait.Refresh;

But nothing happens. That is, the button continues enabled, and the hidden label does not show.
What is the correct way to apply those changes for immediate response.
Eli M

Posts: 1,346
Registered: 11/9/13
Re: Buttons and labels does not refresh  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 11, 2015 7:09 AM   in response to: pss edn in response to: pss edn
Is your web service call blocking?

Call Application.ProcessMessages; before making your call or put your call in an Anonymous thread.

http://www.fmxexpress.com/build-responsive-apps-with-timers-and-threads-using-delphi-xe6-firemonkey-on-android-and-ios/
pss edn

Posts: 45
Registered: 1/13/04
Re: Buttons and labels does not refresh  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 12, 2015 8:37 AM   in response to: Eli M in response to: Eli M
I am using TRestClient, TRestRequest and TRestResponse, and the code mentioned is executed just before calling RestRequest1.Execute, so this call i blocking.
Adding Application.Processmessages solves label.visible:=true, but does not solve button.enabled:=false;
I will have a look to the link you mention.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02