Roberto Nicchi Posted July 12, 2021 Share Posted July 12, 2021 possible ? if not, is it possible to create a JS function inside a frame ? Now i'm executing in the main form the click event of a button that is inside a frame. But i need to pass a parameter. If it's not possible the idea is to execute a js function inside the frame. Thanks Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 12, 2021 Share Posted July 12, 2021 46 minutes ago, Roberto Nicchi said: possible ? Yes... Quote Link to comment Share on other sites More sharing options...
Roberto Nicchi Posted July 12, 2021 Author Share Posted July 12, 2021 1 minute ago, Sherzod said: Yes... Thanks. I have tryed with thebutton.JSInterface.JSCall('click',[1]) but the result in an exception: a.preventDefault is not a function Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 12, 2021 Share Posted July 12, 2021 6 minutes ago, Roberto Nicchi said: I have tryed with thebutton.JSInterface.JSCall('click',[1]) but the result in an exception: a.preventDefault is not a function Yes, sorry. I have not noticed that it is not user-defined function. What did you want to achieve by passing parameter 1? Quote Link to comment Share on other sites More sharing options...
Roberto Nicchi Posted July 12, 2021 Author Share Posted July 12, 2021 In the main form (onkeydown event) when the user press F6, is exeuted the click js event of a button that is inside a frame (see the last post of the thread Grid is in dirty state - General - uniGUI Discussion Forums). In the click js event i would like to know if the function key (F6) has been pressed alone or together with SHIFT key. The idea was to execute JsCall passing a parameter. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 12, 2021 Share Posted July 12, 2021 5 minutes ago, Roberto Nicchi said: In the main form (onkeydown event) when the user press F6, is exeuted the click js event of a button that is inside a frame (see the last post of the thread Grid is in dirty state - General - uniGUI Discussion Forums). In the click js event i would like to know if the function key (F6) has been pressed alone or together with SHIFT key. The idea was to execute JsCall passing a parameter. Hmm, sorry, your case is not very clear to me. Quote Link to comment Share on other sites More sharing options...
Roberto Nicchi Posted July 12, 2021 Author Share Posted July 12, 2021 In the mainform.onkeydown event var shf:boolean; begin if key=VK_F6 then begin if ssShift in shift then shf:=true else shf:=false; Tstandard_frame(pc.activepage.Controls[0]).F6_but.JSInterface.JSCall('click',[]); // i want to pass the shf variable to the click event. end The frame.F6_but.click js event: function click(sender, e, eOpts) { if shift_has_been_pressed then // i miss this part now ajaxRequest(this, '_executeF6shift', []); else ajaxRequest(this, '_executeF6', []); } Quote Link to comment Share on other sites More sharing options...
Roberto Nicchi Posted July 13, 2021 Author Share Posted July 13, 2021 Ok, i have found a workaround. I have created another button not visible. Simple and works. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 13, 2021 Share Posted July 13, 2021 OK. 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.