AMIT Posted August 19, 2011 Share Posted August 19, 2011 I would like to know if it is possible to write Code to Open new browser windows in UniButton Onclick event Quote Link to comment Share on other sites More sharing options...
dionel1969 Posted August 19, 2011 Share Posted August 19, 2011 Hello !!! The OnClick event of Buttons and other compoment refers to process in the server. For the clients process you have to use ClientEvents to do that. ClientEvents - ExtEvents - Onclick: function Onclick(sender) { window.open('url'); } I use it for Buttons and Labels too and works. Quote Link to comment Share on other sites More sharing options...
dionel1969 Posted August 19, 2011 Share Posted August 19, 2011 IMHO, thinking about this now, I think that ClientEvents, as it name indicate, must be appear in the "Events" palette. Quote Link to comment Share on other sites More sharing options...
AMIT Posted August 19, 2011 Author Share Posted August 19, 2011 Hello !!! The OnClick event of Buttons and other compoment refers to process in the server. For the clients process you have to use ClientEvents to do that. ClientEvents - ExtEvents - Onclick: function Onclick(sender) { window.open('url'); } I use it for Buttons and Labels too and works. Thank you for your reply. I wonder the 'url' must be predefined, isn't it? Is it possible to do something on the server in the onclick event such as dynamic creating pdf file and store it on the server. Then create the clientevent and replace 'url' to point to the location that we just create the pdf file. My purpose is just want to have the onclick button to work as the sequence like follow. 1. Generate the PDF 2. Send the generated PDF to the client by open the new window at the client side Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted August 20, 2011 Administrators Share Posted August 20, 2011 TUniURLButton will be implemented. Quote Link to comment Share on other sites More sharing options...
AMIT Posted August 25, 2011 Author Share Posted August 25, 2011 TUniURLButton will be implemented. Do you have a schedule to release TUniURLButton? Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted August 26, 2011 Administrators Share Posted August 26, 2011 Do you have a schedule to release TUniURLButton? Soon! Quote Link to comment Share on other sites More sharing options...
yzzd Posted May 29, 2012 Share Posted May 29, 2012 Soon! See here, me crazy, try a night Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 29, 2012 Administrators Share Posted May 29, 2012 See here, me crazy, try a night Your point? Quote Link to comment Share on other sites More sharing options...
Jean-Marc Kiener Posted January 26, 2015 Share Posted January 26, 2015 Hi, I coming up with the same problem. I have a Form with a button on it. On OnClick Event of the button, i wrote something like: Procedure TMainForm.UniButton1Click(Sender: TObject); begin UniSession.AddJS('window.open("http://www.plotjet.ch/exp/exp.dll?SessionID="' + SessionID + ',"_blank","");'); end; The problem is, that on each browser i try open a new browser window, the popup blocker occurs. Internet says, that is ok because i call the window.open in a answer of a ajax call. I this case, popup blocker will occur. So for test i write that in the ExtEvents Ext.button.Button.click event: function click(sender, e, eOpts) { window.open("http://www.plotjet.ch/exp/exp.dll","_blank",""); } That works well, no popup blocker comes up. But i have to do lot more work before i can call window.open. I have to ask a webservice for a sessionID and have to give this SessionID somehow to the ExtEvent Click function. What would be the way to do that? 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.