Hi I am facing the problem on ICS like dialog is dismissed when we click outside dialog window, due to which I am getting problem like I don't get any confirmation from user.
Please help.
Check this method from the Android Developers site for dialog.
Try using the
dialog.setCanceledOnTouchOutside (boolean cancel)
Pass a boolean value to enable/disable dialog behaviour when touched outside of the dialog window.
Also go through these links:
How do I fire an event when click occurs outside a dialog
How to cancel an Dialog themed like Activity when touched outside the window?
I hope this answers your question.
You may use
dialog.setCancelable(true/false);
OR
dialog.setCanceledOnTouchOutside(true/false);
For the latest vesrions of Android;
It will disable outSideTouching event.
dialog.setCancelable(false)
Dialog CAN NOT cancel when touch out side OR press BACK key
dialog.setCanceledOnTouchOutside(false)
Dialog CAN NOT cancel when touched outside BUT ABLE to canceled when press BACK key
Related
I have a Windows 8.1 application.
In that I have a SettingsFlyout in ShowIndependent mode.
Inside the settings flyout I have a List
I want the SettingsFlyout to dismiss on click of any item in the list.
I would be very glad if someone can point me in the right direction to implement it. Thanks in advance.
Just call SettingsFlyout.Hide():
By default, the settings flyout is dismissed when the user presses the
back button, and is always light-dismissed when the user taps outside
of it. In most cases, you will not need to call the Hide method to
dismiss the settings flyout.
Calling the Hide method has the same behavior as light dismiss. It
always returns the user to your app and closes the settings pane,
regardless of whether the settings flyout was opened by calling Show
or ShowIndependent.
I m automating a page where there is a popup and on that there is radio button and a submit button, when i click on radio button my test fail giving error that hidden object cannot be performed action like click but its visible (not hidden) where as when i click on submit button on same popup is click. i have checked its properties but there is nothing which i can change it just have simple id,name,value which is changing dynamicly and for that i have even used regex
please help me out
Thanks
It's possible that there is another radio button on the page with similar properties. Is this a recorded object? Is the popup window listed as the parent?
Can you post the Regex you are using, the control's properties, and the properties of the popup window?
if your are using IE whose version is > 9.0.19 then there was a patch release by Microsoft to overcome this issue
http://blogs.msdn.com/b/visualstudioalm/archive/2013/09/17/coded-ui-mtm-issues-on-internet-explorer-with-kb2870699.aspx
I have developed a chrome extension that opens a popup when I click on the icon near the address bar. Everything works fine, however I want to add some functionality to it. So I thought I'd also add a context menu item so that the user can simply search for the highlighted word. I want the popup to showup when the user clicks on the item in the context menu(the default popup in the top right corner and not a new popup window or a new tab).
Can I have this functionality? If yes, how do I implement it?
You can't make the popup page show programmatically as if the user clicked it.
However, you can still have something display based on the background script / content menu click. There are 4 main options for your background script:
Open a new tab to the popup.html page
Programmatic injection of javascript to construct a popup-like dialog on the page
Content script message passing to do the same as above, using a running content-script.
Use the notifications API for a simple minimally stylized message to the user.
Options 2, 3, 4 will allow the user to stay on their tab without any navigation. The notifications API route is the simplest to use if you just want some quick notification to the user, and there are fewer security snags. 2 and 3 require more book-keeping, but you can make the dialog look like your popup.
There should be an API for it now (as in 2023)
https://developer.chrome.com/docs/extensions/reference/action/#method-openPopup
update: tried, but failed, there was a bug.
https://github.com/GoogleChrome/developer.chrome.com/issues/2602
hope they fix it soon.
I was looking for extensions that I have already been used, but forget its name. This extension opened up the result into Context Menu, without open new TAB or popup.
may be useful
https://developer.chrome.com/extensions/contextMenus
If I instantiate a popup button, I can dismiss it by selecting one of the options or by clicking somewhere else. Is there a good way to dismiss it from a script? I tried setting the menuHistory, but it doesn't seem to have any effect.
Mark - if you check the openStacks is the first line empty while the popup menu is displayed? I think it is and then you could test that way.
Answering my own question:
I haven't found a good way to determine whether a popup menu button is displayed yet - none of the usual property checks seem to work. But I sidestepped the issue thusly:
in my scrollwheel handler I
dispatch "menuPick" to button "PluginMenu"
Then in the menuPick handler of the PluginMenu button I have
if pItemName is empty then
lock screen
put word 2 of the selectedline of field "xyzzy" into tLine
select after line tLine of field "xyzzy"
click at the selectedloc
unlock screen
end if
where pItemName is the normal menuPick parameter.
If I could determine when the popup was visible I could limit the menuPick call to just the times when it's on screen, but otherwise the effect is just to click at the end of the line, deselecting the popup if it's on top.
Edit: the scrollwheel handler mentioned above is in the rawKeyUp handler of field "xyzzy".
Edit 2: as mentioned, that should be "rawKeyDown" instead of "rawKeyUp".
And as Trevor mentioned, checking line 1 of the openStacks makes it even better:
if line 1 of the openStacks is empty then
dispatch "menuPick" to button "PluginMenu"
end if
It may be that you need to fake your popup menu with a palette stack which closes on suspendStack. That way there's no blocking involved and you can close it whenever you like. You would need to mess with the focus of the field I think after opening the palette so it still has the focus.
I just tried clicking a button containing the following script then clicking on a popup button.
on mouseUp
set the uActive of me to not the uActive of me
if the uActive of me then send "test" to me in 2000 millisecs
end mouseUp
on test
put the millisecs
if the uActive of me then send "test" to me in 2000 millisecs
end test
The popup seems to be modal and blocks the timed routine in the button script. I'm thinking that Monte's idea of faking the popup might be a good one ;)
You can't access already open menus by script. However, on Windows, if you open the popup menu with the popup command in a mouseDown handler, the mouseDown handler will run till the end instantly. If you use a stack panel instead of a regular popup menu, you might be able to close the stack panel by script (I haven't tried this). I don't think that this is possible on Mac OS X because menus block any currently running scripts until the menu closes.
I have an android spinner which I call via the performClick method to show a list of items (the actual control is hidden from the user and is called from a checkbox, too complex to explain why I have done it this way).
If I do not want an item in the list, how can I dismiss the popup by clicking on the black area?
Does this make sense? :/
Edit: Sorry, forgot to mention that the users will not be able to operate the bottom buttons (device is going to be galaxy tab) as they will be covered up with protective layer due as they will be outdoors.
usually such a control is dismissed using the back key in the android applications. So I would suggest that you find a way to do it the same way on your control.
'Esc' button should do the same job..