Redirect after script was executed - angularjs

I am really new in webprogramming and using angularJs and ionic to create an app.
Here is my problem, morelikeley my issue that I want to deal with the right way:
I have got a button which will exchange some data with my server and then link to an other website.
I am now wondering if it is the correct way to add an ng-clicked on my button which then runs a script that talks to my server and after that calls the next website by $location.path()?
Problem with this is, that it always throws an error saying:
Error: $location is not defined $scope.click#http://localhost:8100/scripts/controllers.js:17:9 $parseFunctionCall#http://localhost:8100/lib/angular/angular.js:12237:15 #http://localhost:8100>/lib/ionic/release/js/ionic-angular.js:7788:9 $RootScopeProvider/this.$get</Scope.prototype.$eval#http://localhost:8100/lib/angular/angular.js:14291:16 $RootScopeProvider/this.$get</Scope.prototype.$apply#http://localhost:8100/lib/angular/angular.js:14389:18 #http://localhost:8100/lib/ionic/release/js/ionic-angular.js:7787:7 jQuery.event.dispatch#http://localhost:8100/lib/jquery/dist/jquery.js:4408:15 jQuery.event.add/elemData.handle#http://localhost:8100/lib/jquery/dist/jquery.js:4095:6 triggerMouseEvent#http://localhost:8100/lib/ionic/release/js/ionic.js:2641:3 tapClick#http://localhost:8100/lib/ionic/release/js/ionic.js:2630:3 tapMouseUp#http://localhost:8100/lib/ionic/release/js/ionic.js:2700:5
My other idea is to set an href on the button which links to the next website, but then i cannot ensure that my script was executed successfully before redirecting, or is there a way to handle this?
Thanks!

Related

Restrict React Router for one time

In my ReactJS project a link will be opened with some unique id .../connect/123456 By opening this user can have video call with someone. This is working but the problem is if copy the link and open in a new tab or new browser it still works. What I need is an error message says "Connection already made". How to achieve this?
You can solve this server side. Simply have a flag on your database that the call is already in progress. On the front-end side, simply fetch this flag from the database, if call is already in progress: then display the error message and redirect as necessary.

Oracle ADF - Redirect link is not working

I am developing a simple application using ADF comes with basic CRUD operations (create, read, update, delete). In this case, as you can see, I have dragged a link to the 1st column which is highlighted in yellow.
So whenever I deploy it and click that, it is supposed to redirect me to the Edit page where client will allow to make commit:
I did make sure the Action of link is associated with the Edit page (as highlighted in yellow above). However, the link wouldn't redirect me anywhere, no response.This is the unbounded task flow:
Okay so I have found out the solution. Due to the default setting, the application will be deployed on IE and this message will prompt out. As you can see, the message is mentioning about browser's compatibility. My IE is version 11.6, I'm not sure what's the issue here since my IE is kinda latest version but this message still pops out and affects the redirect link from working. However, simply copy the application URL to Google Chrome and run should fix this issue. Hope this helps in future.
If the two pages in the Unbounded Task Flow, then Add WildCard Control Flow Rule
and connect the two pages with the WildCard.
Or you can use the Popup instead of opening a new page for edit

logic apps - how to link to a run

I have a dashboard in Power BI that shows me all the runs that have failed from Logic Apps, incl their runID. Currently I need to copy and paste that runID into the Logic App Runs UI to filter and then click on it to see the Run detail and find out where it failed.
When I click on a run, the runID is not added to the URL, it's loaded via some javascript. How do I generate a URL that will link to a specific run of a logic app instance?
A workaround for this is to add logging/tracked properties etc so that you will get which action failed directly with the runid, it's as close you will get for now I think.
[Edit] found a solution here:
https://toonvanhoutte.wordpress.com/2018/12/08/navigate-directly-to-the-logic-apps-run-details/
For Logic Apps (Standard) there is currently no deeplink available yet. Though Microsoft has added this to their backlog.
See: https://githubmemory.com/repo/Azure/logicapps/issues/358
Edit
Not official, but I figured a way to navigate directly to a Logic App (Standard) workflow. It is possible that a page refresh is needed after navigation though.
Url: https://portal.azure.com/#view/Microsoft_Azure_EMA/WorkflowMonitorBlade/id/%2Fsubscriptions%2F**subscription-id**%2FresourceGroups%2F**resource-group**%2Fproviders%2FMicrosoft.Web%2Fsites%2F**logic-app-name**%2Fworkflows%2F**workflow-name**/location/**location**/resourceId/%2Fworkflows%2F**workflow-name**%2Fruns%**run-id**/runProperties~/%7B%22waitEndTime%22%3A%22%22%2C%22startTime%22%3A%22%22%2C%22endTime%22%3A%22%22%2C%22status%22%3A%22%22%2C%22correlation%22%3A%7B%22clientTrackingId%22%3A%22%22%7D%2C%22workflow%22%3A%7B%22id%22%3A%22%22%2C%22name%22%3A%22%22%2C%22type%22%3A%22%22%7D%2C%22trigger%22%3A%7B%22name%22%3A%22%22%2C%22inputsLink%22%3A%7B%22uri%22%3A%22%22%2C%22contentSize%22%3A0%7D%2C%22outputsLink%22%3A%7B%22uri%22%3A%22%22%2C%22contentSize%22%3A0%7D%2C%22startTime%22%3A%22%22%2C%22endTime%22%3A%22%22%2C%22originHistoryName%22%3A%22%22%2C%22correlation%22%3A%7B%22clientTrackingId%22%3A%22%22%7D%2C%22status%22%3A%22%22%7D%2C%22outputs%22%3A%7B%7D%2C%22response%22%3A%7B%22name%22%3A%22%22%2C%22outputsLink%22%3A%7B%22uri%22%3A%22%22%2C%22contentSize%22%3A0%7D%2C%22startTime%22%3A%22%22%2C%22endTime%22%3A%22%22%2C%22correlation%22%3A%7B%22clientTrackingId%22%3A%22%22%7D%2C%22code%22%3A%22%22%2C%22status%22%3A%22%22%7D%7D/isReadOnly~/false

How do I get my button to redirect to a web page within the app?

So far, I have it so that when a user presses a button, a browser opens and redirects the user to my desired url. However, I want this to happen within the app instead of a web tab. How can I do this?
Use the BrowserComponent, just add it to the center of a border layout form and set the URL for that component. Check out the list of main components in Codename One within the developer guide.
Define a xml layout containing a widget called webview. Then in your activity you implement a listener to your button which invokes that xml with the desired page to load inside your webview. Google to find some code and return here with your code problems, if you find some. If this will be the case, open new questions provinding detailed info about your matters then we can help more. Best.
EDIT: Excuse me, just now, re-reading your question I think I really understand it, and the solution is very simple, just a line of code (to instruct your app to open a webpage inside your webview, and not the regular browser, outside your app). Try this:
wv = (WebView) findViewById(R.id.myWebView);
wv.setWebViewClient(new WebViewClient()); // needed to open url inside our webview, otherwise it will open at the default browser
wv.loadUrl(url);

How to get button Response/Request URLs in QTP?

How do I get Response/Request URLs (which are shown in F12 Developer tools - Network Tab) using QTP 11? Based on these URLs, I need to perform certain action in my application. Is there any alternate solution to get those URLs?
Scenario: Open IE browser and navigate to a URL, Press F12, Go to 'Network' tab. Click on 'Start Capturing' button. Now click on any button or link on the page, you will get a set of URLs in the Developer Tool (F12).
Firstly, do you need all of the URL requests generated from a button and/or link click? Remember that what you get from the "Network" tab in the developer tools also include URL's for fetching e.g. Javascript and CSS in addition to, for instance a GET request to an external API.
I'll try an provide you with an alternative approach. If what you are really requiring is the URL associated with each interactive element, then you should be able to get that by using the GetROProperty method like so:
strURL = Browser("YourBrowser").Page("MainPage").WebButton("aButton").GetROProperty("href")
A more generic script for fetching e.g. all the "href" properties for all the links on a page may be found in the following post: (HP QuickTest) How do I get HTTP status using QuickTest?.
Hope this helps.
UPDATE: With regards to your question regarding fetching of the URL's from the IE developer tools; As far as I know there is no way to fetch them from this view by using QTP.

Resources