PDA

View Full Version : launch web page from UX?


ABC123

badnose
07-10-2013, 06:45 PM
Using the v12 UX component, I want the user to select a record from a list and launch the URL that is in one of the fields.... I don't see how to dynamically populate an Panelcard iFrameURL value with the current record. It would also be fine to launch a separate window if necessary. Any thoughts?

Davidk
07-10-2013, 07:43 PM
You need to set the "src" of your iFrame with the Return Field Value of your List.

Let's assume your List is returning the full URL e.g. http://www.alphasoftware.com

And let's assume your iFrame, in a PanelCard has an ID of IFRAME_1

In your List, List Properties, onClick Event (for example) you would put...


$('{dialog.ComponentName}.V.R1.IFRAME_1').src=this.value;

badnose
07-11-2013, 05:43 PM
Yes, that worked, thanks much for the quick and helpful response!

The iFrame is exhibiting some interesting display behaviors, but that may be more related to the links I am testing than anything else. Thanks!

badnose
08-21-2013, 07:30 PM
So, I am still having trouble making the content of the iFrame behave like it would if viewing it with the phone's native browser. the iFrame content won't scroll, shrink, expand.... it just shows the content that happens to fit within the view of the upper left corner of the page. I have played with various Style settings within the iFrame, but with no success on the mobile browser, though it does show scroll bars in the PC browser. Any ideas?

lutherhuffman
08-22-2013, 11:19 AM
Doug, are you using an iPhone/iPad for this?

badnose
08-22-2013, 03:39 PM
Hello Luther, yes using iPhone, haven't tried Android.

Clipper87
08-22-2013, 06:13 PM
http://www.w3schools.com/tags/att_iframe_scrolling.asp

Davidk
08-22-2013, 07:34 PM
Doug,

I think I would do it this way...

Instead of trying to deal with iFrame inside a Panel (it seems that a lot of iFrame stuff is depricated in favour of HTML5), how about letting Alpha do all the work for you.

You said you didn't mind if you launched another window, and this method kind of does that, but lets you come back... bonus.

Here's a video that walks you through the process... see if it's what you wanted to do.

http://youtu.be/QK0FXxPP9V0

badnose
08-23-2013, 12:42 AM
David,

Wow, what an elegant solution! This does work for me... link to an external page from my list, and the navigation functionality works. Your video was very helpful, I really appreciate you taking the time to think of this and share it with me. I have a number of details to work out, but this definitely solves my biggest roadblock.

Thanks again,
Doug

simeatan
09-22-2018, 09:40 PM
David,
I know this is an older thread but it's relevant to me now.
Trying to show up a simple web page. External URL like apple.com. No arguments or anything similar.
Following your video example and using the ActionScript of "Open a5w or html/url/pdf". The page opened up in Browser Window without any problems.
But I don't see the Back button and couldn't find it in any of the window properties.
More importantly, I'd prefer to have any of the other Targets: Window, DIV, TabbedUI Pane, Panel, Dynamic Panel.
Docked or not, Modal or Modeless - it doesn't matter.
Is it not possible in this scenario or I'm doing something wrong? I can imagine this is used a lot.
My AA version is 12.4.2 build 3670. Older version but it should be good for this. I think it's around 08/2016, and this thread is from 2013.
Attached is the sample component.
Thanks,
Sime
PS Initially, the goal was to show a GoogleMap supercontrol in the same dialog "Open a5w or html/url/pdf".
Same story, it worked in Browser Window and nothing showed up in the regular window.
I don't want to use the Map control since in this AA version there's no place for the google's API key, that started requiring.
Simple web page will do it.

Davidk
09-22-2018, 11:12 PM
Inspect your browser... you're most likely getting a 'sameorigin' error. Many sites do not allow loading in an iframe.

You're not seeing a "back" button because they way you're running it there is no back.

Is your intended target a Mobile Device? If so, then using something like window.open(url) will open the site and let you go back to your app.

If you're using PhoneGap Build then you can use the plugin InAppBrowser.

simeatan
09-22-2018, 11:42 PM
David, thanks for the quick reply! Not a PG user here. I tried the window.open solution (both developer preview and after uploaded to the server) and it showed up the web page but I kinda needed to get the focus back to the UX after that. From the few other tabs being open.
I wish the option Show in Window would work.
Thanks for your help!

simeatan
09-23-2018, 12:10 AM
I thought of using the F12 debugging and this showed up. Thanks for your guidance.

"Refused to display 'https://www.apple.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'." I'm yet to see what that means :)

45291

Davidk
09-23-2018, 12:33 AM
Right... that's what I mentioned... the 'sameorigin' error. Here's a very good, and detailed, discussion...

https://security.stackexchange.com/questions/67889/why-do-browsers-enforce-the-same-origin-security-policy-on-iframes

You're showing an image of a mobile device. Asking again... is your plan to run your web app on a mobile device?

simeatan
09-23-2018, 12:38 AM
Yes, it's the error that you mentioned originally. First time I hear about it. And the term clickjacking.
I'm playing with a test webapp, intended for mobile device, no PG, but friendly in a (any) web browser, if needed.
Nothing critical or current/live.

Davidk
09-23-2018, 01:00 AM
If you're using a mobile device then you can just use window.open("yourURL"). On a mobile device that will open a new tab, but will let you go back to your app.

simeatan
09-23-2018, 01:10 AM
Thanks David. I tested it and it's working fine. As a conclusion, is it safe to say that all of the other options but Browser Window are made obsolete by this error? Even if it doesn't show up on every browser. Maybe other options can be used for some intranet pages, or on the same server. Not Alpha's fault. I see it's a common problem (php, js etc) and the blocking makes a sense.