dionel1969 Posted June 16, 2011 Posted June 16, 2011 Hello: Is there a way to "Open in new window", "Open in new tab", etc... another application, more or less like TURLLabel that exists??? For example: I have a main application that has submodules. All they reside in an separate application, but they all work together. Is there a way to click on image (button) and open in a separate window or browser tab for example: http://localhost:60001/ ???? Another question: Can I change default cursor to handpoint cursor to indicate user that can click on the image??? Quote
Stephan Posted June 16, 2011 Posted June 16, 2011 Hi Dionel I use this way procedure TMainForm.UniButton2Click(Sender: TObject); begin ShellExecute(Handle,'open','http://localhost:8077',nil,nil,SW_ShowNormal); end; / Stephan Quote
Administrators Farshad Mohajeri Posted June 16, 2011 Administrators Posted June 16, 2011 Hello: Is there a way to "Open in new window", "Open in new tab", etc... another application, more or less like TURLLabel that exists??? For example: I have a main application that has submodules. All they reside in an separate application, but they all work together. Is there a way to click on image (button) and open in a separate window or browser tab for example: http://localhost:60001/ ???? We will have TUniURLButton for this. Another question: Can I change default cursor to handpoint cursor to indicate user that can click on the image??? In todo list. 1 Quote
Administrators Farshad Mohajeri Posted June 16, 2011 Administrators Posted June 16, 2011 Hi Dionel I use this way procedure TMainForm.UniButton2Click(Sender: TObject); begin ShellExecute(Handle,'open','http://localhost:8077',nil,nil,SW_ShowNormal); end; / Stephan This will not work on web clients, as above code is executed inside server. Quote
Stephan Posted June 16, 2011 Posted June 16, 2011 Sorry my mistake, i've tested this only on my machine ... (but it' funny if you push the button and the browser window pop up on the server ... ) sorry again /Stephan Quote
dionel1969 Posted June 16, 2011 Author Posted June 16, 2011 We will have TUniURLButton for this. When more or less??? > Change cursor ... In todo list. When more or less??? Quote
Administrators Farshad Mohajeri Posted June 16, 2011 Administrators Posted June 16, 2011 Can't give an exact date. We will have a feature centric version dedicated to such issues. 0.87 or 0.88 can be the target. Quote
dionel1969 Posted June 16, 2011 Author Posted June 16, 2011 Two questions !!! What is the meaning of property: CustomFiles of ServerModule???? 1- If that property is to use in client side to load jscript or other client script will be good to have this: execscript(aProcName: string) and in this case just generate this for onClick event of html object. 2- If that property is not for client script files, will be good to have a property for that, could be: ScriptFiles: TStrings and then will be good to have execscript(aProcName: String); With one of above it will be possible to run this: openwindow(zURL,....) of javascript. It est, sometime I got people some general tool to extract the information they want. I give they the common reports, but there are some report or kind of report that give user the possibility to extract the data they want and transfer it to SPSS, Excel, etc... then they could process with other tools. So, if Framework give some possibility to add some client scripts, in this case, then we will have the possibility to do in different way the same task. Quote
Administrators Farshad Mohajeri Posted June 17, 2011 Administrators Posted June 17, 2011 Custom files property allows you to load custom JS and CSS files into browser. Our jQuery demo demonstrates its usage. For comprehensive client side scripting usage next version 0.86 will implement many new features. Quote
dionel1969 Posted June 17, 2011 Author Posted June 17, 2011 Custom files property allows you to load custom JS and CSS files into browser. Our jQuery demo demonstrates its usage. For comprehensive client side scripting usage next version 0.86 will implement many new features. Ok, I'll be waiting impatiently. Quote
dionel1969 Posted June 19, 2011 Author Posted June 19, 2011 Custom files property allows you to load custom JS and CSS files into browser. Our jQuery demo demonstrates its usage. For comprehensive client side scripting usage next version 0.86 will implement many new features. 2 questions: 1- Ok, I solve the problem to call external link. Just using TUniLabel, setting property TextConversion to txtHTML and setting property text to: <a href="http://www.domain.com:60001" target="new">Click here</a>. It works perfectly, but I need now OnClick event of the UniLabel to do the same but inside the same application, it est, like this: http://www.domain.com:60000/#InternalLink1 It means, that the application will call something inside the same application, not external. It will be soon??? 2- (This one is not concerning to UniGUI) Calling external link put two application in the same page tab in Google Chrome. It is possible to open one new page tab for each external application??? I have to modify target property of anchor tag???? Quote
Administrators Farshad Mohajeri Posted June 19, 2011 Administrators Posted June 19, 2011 2 questions: 1- Ok, I solve the problem to call external link. Just using TUniLabel, setting property TextConversion to txtHTML and setting property text to: Click here. It works perfectly, but I need now OnClick event of the UniLabel to do the same but inside the same application, it est, like this: http://www.domain.co.../#InternalLink1 It means, that the application will call something inside the same application, not external. It will be soon??? 2- (This one is not concerning to UniGUI) Calling external link put two application in the same page tab in Google Chrome. It is possible to open one new page tab for each external application??? I have to modify target property of anchor tag???? 1-Label OnClick will be implemented but can't say in which exact release. 2-yes, you need to change the target. Quote
dionel1969 Posted June 20, 2011 Author Posted June 20, 2011 Ok, thank you for your time. I find this in internet: When you use the target="_blank" attribute for the hyperlink <a> tag, all links with that attribute will open in new windows or tabs. When you use the target="new" or target="anything" attribute, the first click on any link with that attribute will open in a new window called new or anything. Any subsequent click on any link with that attribute will open in the same window called new or anything. Quote
eduardoA Posted March 7, 2016 Posted March 7, 2016 Olá/Hi, Dionel. To access another page in Delphi Code using UniGUI: begin UniSession.AddJS('window.location = ''' + url + ''';'); // to use the same window {or} UniSession.AddJS('window.open(''https://support.wwf.org.uk'', ''_blank'');'); // to open a new window/tab end; Quote
mroustaei Posted June 27, 2018 Posted June 27, 2018 hello Eduardo Alcantarathish code UniSession.AddJS('window.open(''https://support.wwf.org.uk'''_blank'');' ); // to open a new window/tab corect and use my program but open page in popup blocker how to open url without popup blocker in browser Quote
Ron Posted June 27, 2018 Posted June 27, 2018 You can do cross-domain scripting by using JQuery's http get, if you have a local webserver running with header setup for allowing cross-domain calls: UniSession.AddJS('$.get("http://127.0.0.1/test.php?event='+inttostr(EventID)+'", function( data ){' + ' ajaxRequest(MainForm.form, ["testEvent"], { response : data }); '+ ' }); '); I had to use this solution to avoid router NAT setup, and use a local apache httpd with php to catch the call, and then execute a local exe file to check the cash drawer status via a DLL routine. It works great. Why not go through the browser as you are then behind firewalls and routers etc. It seems like the perfect solution. I also have a delphi service that can serve it, but it seems like separating the http server with the other parts makes it more stable when it comes to drops in db connection due to network errors. To allow cross-domain access for indy httpd add a custom header: AResponseInfo.CustomHeaders.AddValue('Access-Control-Allow-Origin', '*'); To allow cross-domain access for apache use a virtualhost directive with a header command: <VirtualHost *:80> DocumentRoot "c:\dev\apache22\htdocs" Header set Access-Control-Allow-Origin "*" </VirtualHost> Of course you should restrict these to a specific domain for security reasons. Without the header the server will get the command, but the browser will cut the response. But how to solve automatic login and/or user change by RFID? Catch a running session... 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.