CristianPeta Posted September 16, 2020 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; Quote
Hayri ASLAN Posted September 16, 2020 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; Quote
CristianPeta Posted September 16, 2020 Author 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. Quote
CristianPeta Posted September 16, 2020 Author 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() Quote
Sherzod Posted September 16, 2020 Posted September 16, 2020 3 hours ago, CristianPeta said: UniSession.SendResponse(''); Hello, In your case you need use UniSession.AddJS... 1 Quote
CristianPeta Posted September 16, 2020 Author Posted September 16, 2020 Nice to know it's not UniGUI's fault. 1 Quote
CristianPeta Posted September 16, 2020 Author 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? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.