multimesut Posted May 31, 2017 Share Posted May 31, 2017 Merhaba, Projemde anlık olarak js kodları çalıştırmam gerekiyor. AddJS ile bunu yapabiliyorum. SendResponse ilede bunu yapabiliyorum fakat SendResponse kullandığım yerdeki procedure nin o anki işlemleri çalışmıyor. Bu iki kod arasındaki fark nedir. Örnekte UniButton2Click da hiçbir şekilde UniLabel1 Caption u değişmiyor. SendResponse de neden böyle bir sorun oluşuyor? //UniLabel1 Caption sorunsuz bir şekilde değişiyor. procedure TMainForm.UniButton1Click(Sender: TObject); begin UniLabel1.Caption:='Mesut - 1'; UniSession.AddJS('alert("Mesut - 1");'); end; //UniLabel1 Caption hiçbir şekilde değişmiyor. procedure TMainForm.UniButton2Click(Sender: TObject); begin UniLabel1.Caption:='Mesut - 2'; UniSession.SendResponse('alert("Mesut - 2");'); UniLabel1.Caption:='Mesut - 2'; end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 31, 2017 Share Posted May 31, 2017 Merhaba, http://forums.unigui.com/index.php?/topic/1412-sendresponse-or-addjs/ Quote Link to comment Share on other sites More sharing options...
multimesut Posted May 31, 2017 Author Share Posted May 31, 2017 procedure TUniGUISession.SendResponse(RespStr:string; ExecCode: Boolean = True); Doğrudan tarayıcıya tek bir bildirim gönderir. Zaten gönderme sırasındaki tüm bekleyen JS kodlarını temizler. İstemci tarafında programlama için uygundur. Bkz. CleintEvents-4 demosu. ExecCode "True" ise kod yürütülür, aksi halde yürütülmez. procedure TUniGUISession.AddJS(JS:string); Her zaman çalıştırılan geçerli kod sırasına bir JS deyimi ekler. Thank you #Delphi Developer Quote Link to comment Share on other sites More sharing options...
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.