How can I create a home button? - button

I am pretty new in the programming world. I am using Titanium, and I want a button that when I clicked on it, it will go back to the home window. Obviously, the button will be in another window.
I tried win2.open() and win2.show(), but it is not working. Any ideas?

Use titanium navigational controller
https://github.com/vuinguyen/Ti-Navigation-Controller
it would give you button for previous and home window

Jacl,
If you are in second window, just close that window on the click event of your button in the second window.
Try the following in second window
//I'm assuming that you have came from window1 to window2
//and you have a button btnHome at window 2 used to navigate back to home page
var thisWindow = Ti.UI.currentWindow;
btnHome.addEventListener('click', function(e){
thisWindow.close(); //Will close the current window and display the previous one
});
There is a similar question which is used to navigate between windows. Go through Titanium Mobile: cant navigate between pages.
You can use the following links also for references
http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.Window-property-url
http://docs.appcelerator.com/titanium/latest/#!/api/Global-method-require

Related

How Link button perform new tab when clicked even it has also jquery code to perform

Is it possible that a link button can open a tab window with a certain URL even it has also jquery code to perform like showing a popup box?
Let say when I click the link button, it popup messagebox came from jquery code and also open a new tab. is that possible?
jQuery deals with client side
LinkButton is a server side control
Check following STO thread:
Link Button
Also, opening a new tab can be handled by browsers, so some browser may open
a new tab while others may open a new window

Unable to switch to Alert without closing window popup in webdriver

Scenario:
Enter a keyword (Position) in a textbox
press Tab or click on the next element
A window popup appears
a list of position matching the criteria will be listed
click the required record
Popup window closes automatically
Alert will be displayed
have click on ok button of alert.
switch to main window and check the position details
Question :- i found many solutions in the site but all are about performing actions on window popup and close the popup then switch to alert or main browser
but my application closes the popup window automatically after selection,hence i cannot use the driver.close() or driver.switchto.defaultContent().
If i dont close the driver (for popup) im not able to identify the next alert displayed after popup.
if i switch directly to mainwindhandle, the alert dismiss is happening instead of accept.
Please anyone who know how to switch from window popup to alert without popup close help is needed...
Thanks ....
If alert dismiss is happening when you are trying to accept it, why don't you use alert.dismiss(), it will probably accept the alert in your context.
When you switch to the popup window, the driver focus is on the popup window. What you might want to do is, just after clicking the required record, switch to the main window then accept the alert.
This must be helpful for you . From your questions, Even after your pop up closes automatically you must be able to access your parent window element by switching back to it. There is no need of driver.close() all the time. Here is the code,
// do something with the pop up and it closes automatically here.
driver.switchTo().defaultContent();
driver.switchTo().frame("your parent window mainframe"));
// try to access your parent window element here

Get active modal QWidget

I need to know in my app if a modal window is opened when I click on a button.
So I'm searching for a method which permits to know if a modal window is opened in my application or no, and which returns the window (or NULL)
Is it possible?
See QApplication's static activeModalWidget

Not able to handle iframe and new window activity

I am not able to handle Iframe popups. In my application when i click on some buttons or link then open iframe pop up. activity which i do on that iframe popup is not recorded in selenium IDE.
select window command also not work.
When i click on link then it open in second window with same title. i am not able to handle that new window's activity.
Please provide me solution if any have.
You need to use the command Select Frame and not Select Window.

Open create content form modal and refresh view display in Drupal

I have a website developed using Drupal. What I want is to create a link which launches a modal window with a custom content create form, then when the form submits and the child window closes, a view or a display of a view in the parent must be refreshed.
I have tried using an excellent module like automodal and ajax_views_refresh but I can't get to set it right.
Any clues?
Figured out how to do this not so long ago, and while looking for a method to Preview content from the Modal Frame, came across your post. Hope this isn't to late to help.
Open parent.js under modules/modalframe/js
and insert location.reload(); around line 250 within this if statement:
if ($.isFunction(self.options.onSubmit)) {
self.options.onSubmit(args, statusMessages);
}
Now, when you click "Save" the child window closes and triggers a parent page refresh.

Resources