Jump to content

UniSession.SendResponse() will disable interface updates


CristianPeta

Recommended Posts

If I have two TUniSpeedButton trying to set UniSpeedButton1.Down isn't working if I use UniSession.SendResponse() in the same call.

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniSpeedButton1.Down := True;
  UniSession.SendResponse('');//if this line is present then then previous change to Down doesn't work
end;

 

Link to comment
Share on other sites

2 hours ago, CristianPeta said:

If I have two TUniSpeedButton trying to set UniSpeedButton1.Down isn't working if I use UniSession.SendResponse() in the same call.


procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniSpeedButton1.Down := True;
  UniSession.SendResponse('');//if this line is present then then previous change to Down doesn't work
end;

 

Hi,

Can you explain more? What do you want to do with SendResponse?

If i understand correctly, you need to set a GroupIndex to SpeedButton.

So set GroupIndex =1 and just call UniSpeedButton1.Down := True;

Link to comment
Share on other sites

With SendResponse I want to play a sound:

UniSession.SendResponse('audioOK.load();audioOK.play();');

I solved it with a timer 100ms and activate the timer to do this job at the client side. And because TUniTimer.RunOnce will run only once per session I've done it myself.

//Timer function
function(sender)
{
  audioOK.load();
  audioOK.play();
  try{MainForm.UniTimerAudioOK.stopAll()}catch(e){};
}
procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniSpeedButton1.Down := True;
  UniTimerAudioOK.Enabled := False;//because stopAll() is called at client side
  UniTimerAudioOK.Enabled := True;
end;

P.S. maybe there is a better solution but my javascript knowledge is poor.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...