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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...