How to manage Two WindowedApplication in Flex? - air

Case:
1) There are two .mxml files (Windowed Application): one is Log-in(Active Window/ Start up Window) and other is Main Window.
2) Main Window has viewstack
3) On log-in successful, log-inHandler called from Main Window.
4) log-inHandler access viewstack id of Main Window.
5) But viewstack id shows null.
Question:
1) How to solve this case?

You should not use 2 Windowed Applications
Make your Login page as a MXMLComponent
Add the Login page as a new NativeWindow from your main App, so you can communicate with it.

Related

Selenium : After clicking a Click in home page , one more screen appears and it got altogether different new DOM loaded

Selenium : After clicking a Click in home page , one more screen appears and it got altogether different new DOM loaded and am currently unable to handle any elements using selenium and getting Element not found exception
Note : Tried Manually to load the same page and in browser console provided the same element and got nothing . but after long time it shows element. Is there a way to handle it?
You can handle your child window using below code. Basically we need to switch web driver control from your parent window to child window and once you finish process then again you have to switch control back to your parent window for further process. We can use window_handles to get handle of all opened windows by web driver and then we can switch from one window to another in a web application
Different Windows
Python :
driver.switch_to_window(driver.window_handles[-1])
title=driver.title
To handle synchronisation issue you can always use different types of waits available in the selenium e.g: implicit, explicit etc.

DragAndDrop with Protractor accross tabs ( or windows )

I have 2 different web apps and I need to make automation test which cover this scenario:
I drag a picture from one app and paste it in another tab ( or window ) to other app.
There is no option to simulate with file upload because there is some logic when picture is dropped how they reference that image in both apps.
I did not find any solution which can drop outside of tab ( window ).
Any ideas?
you have to create a custom function to meet your goal.
Checkout: https://www.npmjs.com/package/html-dnd
With this package you can drag-drop on the same window, but if you extend the function and create a custom logic, for example:
onDragStart - element from window 1
{your logic to switch window}
OnDragEnd - element from window 2

Launching DocList Webtop Component within a Container

Are there any Documentum Webtop developers on here that know how to launch the DocList component within a simple container such as dialogcontainer ? I'm trying to implement some custom functionality for one of the screens in my Webtop-based application so that when the user clicks on the link for a folder, the DocList component is invoked to display the contents, then after the user is done looking at them, she can click the OK button provided by the container to return to the previous screen...
I've tried a couple different ways to do this. My first attempt was to use a dmf:link tag to call a new component I defined called doclistcontainer to contain the doclist component. My second attempt was to use a dmf:actionlink tag that called an action I defined which executes doclist within a container. In both cases, I end up with a blank screen, generic title, the OK button doesn't do anything... When I run a debugger on the code, I can see that the DocList behavioural class is being called despite the blank screen being displayed. What am I doing wrong?
Sheldon

titanium - get the current window

I'd like to be able to show an error message (or maybe even a success message!) to the user. However, this would be for an asynchronous event - so it is presumably possible for the user to have jumped to another page in-between the sending for the event and the response.
Given that that is the case, and given that i use a tabgroup as the "base" in the initial app.xml, how am i meant to access the current window? Ti.UI.getCurrentWindow() doesn't do anything on my system - no error, no nothing.
I'm using the Titanium 3 api.
Since your using a tab group you can use Titanium.UI.currentTab. Then you can get the window of the tab like this:
var theWindow = Titanium.UI.currentTab.window;
Specific doc reference (just in case).
Also, you can always use a Titanium.UI.AlertDialog, that will show up no matter what window your on, if it meets your requirements.
Yes you can use
Ti.UI.currentTab.window().
and since this is function so use "()", otherwise it will not give correct output
to get current window use Ti.UI.getCurrentWindow and not Ti.UI.getCurrentWindow()
Ti.UI.currentWindow only works if there is a window already open. The error you have is coming from the fact that when you create the MasterView, you have not yet opened up the window.
Look inside ApplicationWindow.js, you will see that you create the masterview before even opening the window.
If you want to set navbar items, either add them in the ApplicationWindow, app.js, or pass the window to the MasterView.
currentTab only works if your app uses tabs.
currentWindow and getCurrentWindow() only work if the window was opened using the url property of the Ti.UI.createWindow method.
If you're in any other situation, the current window is just not available, it seems.

How to detect if user has switched Rails 3

A user logs into my application in a tab in a browser
They get an email and click a link which opens a new tab in the same browser and logs them in under a different email say.
If they go back to the first tab they are no longer the same user and I want the page to automatically detect this and then reload or redirect them if they are unauthorized to view the page.
Anyway to do this?
Or, if you really want to know when user is switched the tab, try this library:
visibility.js
As stated by #Hck:
add javascript code to reload page periodically (for example once per 30 seconds) – Hck
JavaScript is pretty much the only way to make pages do stuff after they're loaded. Note that in pretty much any user authentication system, a given browser will only be logged in as one user at a time, so as soon as the second tab opens, that browser will be acting as the second user - they can still see the current content of the first tab, but links (for instance) will no longer work unless the second user was also authorized to use them.
There are some JQuery plugins that do this sort of thing, like PeriodicalUpdater, or you can write your own (an example).