CristianPeta Posted September 16, 2020 Share Posted September 16, 2020 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 More sharing options...
Hayri ASLAN Posted September 16, 2020 Share Posted September 16, 2020 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 More sharing options...
CristianPeta Posted September 16, 2020 Author Share Posted September 16, 2020 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 More sharing options...
CristianPeta Posted September 16, 2020 Author Share Posted September 16, 2020 1 hour ago, Hayri ASLAN said: If i understand correctly, you need to set a GroupIndex to SpeedButton. So set GroupIndex =1 and just call UniSpeedButton1.Down := True; I know about GroupIndex and as I said before all is working if I exclude SendResponse() Link to comment Share on other sites More sharing options...
Sherzod Posted September 16, 2020 Share Posted September 16, 2020 3 hours ago, CristianPeta said: UniSession.SendResponse(''); Hello, In your case you need use UniSession.AddJS... 1 Link to comment Share on other sites More sharing options...
CristianPeta Posted September 16, 2020 Author Share Posted September 16, 2020 Nice to know it's not UniGUI's fault. 1 Link to comment Share on other sites More sharing options...
CristianPeta Posted September 16, 2020 Author Share Posted September 16, 2020 28 minutes ago, Sherzod said: Hello, In your case you need use UniSession.AddJS... In this case HTML5 Audio demo should better use UniSession.AddJS instead of UniSession.SendResponse? Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now