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 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. 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. 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 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. 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? 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! 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 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? 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? 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