After dirty flag check the new tab data is getting loaded in the current tab - jsf

While using JSF richfaces , on change done to a particular tab, dirty flag check is executed in javascript. A confirmation message is displayed while clicking another tab "There are changes made to the current tab, would you navigate to the new tab?". If i click Cancel and remain in the same tab, the new tab data gets loaded in the current screen. Any idea why this behaviour?

Related

Get pager working in a tab control

I have amended and XPage to have it expanded to have a tab control (2 tabs) and included a pager in one tab (the first tab\default tab). The pager is bound to a dynamicviewpanel using the "for" property. I have used dynamicviewpanels with pagers before with no issues, but when I click on the "next" or "2" icon to move forward a page it does not move page and the only change is the first tab vanishes and the 2nd tab is shown but the page still shows the first tabs data. How do I resolve this please? I thought it may require a full refresh put there is only a partial refresh
I appear to have this resolved. I just changed the pagers "partialRefresh" property to False. There is another component on the page that performs a refresh of the page anyway

dojo tabContainer - how to get tab id under right-mouse click popup menu for tab not in focus

I'm a dojo newbie and I'm modifying an existing application for my customer and adding an extra options to the popup menu....'Close all', and 'Close other tabs'. There already exists 'Close'.
Adding the extra menu items were fairly straightforward...'Close all' gets the tabContainer and iterates over the tabs removing them.
But for 'Close other tabs', i.e. close all other tabs except the one I right-clicked on, I can't figure out how to get the id of that tab, on which the right-mouse click was done.
The 'selectedChildWidget' is not the tab I want, it gives the tab which is currently selected...I right clicked on one of the other non selected tabs.
Any ideas? I have the mouse event but cannot find the path back to the tab it was triggered against, only the popup menu.
Many thanks, Andrew (going rapidly grey over this one)
Dijit Menus have a currentTarget property that indicates what node the menu is being displayed for. From a MenuItem's onClick handler, you can access the current target node with this.getParent().currentTarget:
closeMenu.addChild(new MenuItem({
label: 'Close all',
ownerDocument: document,
onClick: function (evt) {
// tab that was clicked
var tab = registry.byNode(this.getParent().currentTarget);
// tab's associated page is tab.page
}
}));

How to open the default popup from context menu in a chrome extension

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

Google Blogger - Refresh page opened in a tab from another tab

Question like this has been asked in SO before, and it seems it is not possible to grab the URLs opened in other tabs.
If you write blogs, then you could have seen the Preview button, which on click opens the blog post in preview mode in a new tab and each time you clicks that button the preview page which was opened previously get refreshed.
May be my question is not constructive, but I was wondering how they are capturing the tab and refreshing the page.
What kind of stuff they are using? If anybody got the knowledge, if you share it would be very helpful.
Update:
Firebugging reveals that the Preview is a button:
Here is what Blogger uses for preview link for my post:
Preview
So what they do is use anchor tag with target attribute of a custom name (previewpost+postID).
When you first click on preview link, no tab will have this custom name, so new tab will be opened. If you click on it again, no new tab will be opened since the tab with that name already exist.
UPDATE:
Using button, this is probably accomplished the same way using javascript window.open(URL,name,specs,replace) method where name specifies the target attribute or the name of the window.

In XPages mobile app, how to avoid appending resetContent=false/true after pressing Done?

I've a mobile page developed with ExtLib mobile controls:
http://hostname/mydb.nsf/MobileTest.xsp
The page consists of two appPages (i.e. a "mainPage" appPage & a "subPage" appPage).
Click on an entry in the mainPage will move to the subPage. Click on the "Done" button in the subPage will move back to the mainPage. After moving back to the mainPage, the resulting URL will automatically change to: http://hostname/mydb.nsf/MobileTest.xsp#mainPage&resetContent=false
When this happened, if I press the browser's refresh button on my iPhone, instead of showing the mainPage, a grey blank page will be displayed. Then, if I manually remove &resetContent=false from the URL and press the refresh button again, the mainPage will be displayed properly.
So, is there any way to suppress appending &resetContent=false (or true) after clicking on a Done button?
I have found the cause of this and have put a fix into the ExtLib, it will be in the next release. I don't know when that will be at the minute but will update when I know
See answer:
http://www.openntf.org/internal/home.nsf/response.xsp?action=openDocument&documentId=0B41430C59FA242C862579D50034D72A

Resources