Jump to content

How to open another url


dionel1969

Recommended Posts

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

Link to comment
Share on other sites

  • Administrators

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.

  • Upvote 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Administrators

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 4 years later...

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;
Link to comment
Share on other sites

  • 2 years later...

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

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...