Show popup/window in a gwt tab - gwt

Is it possible to show a popup only in a certain gwt tab or a panel in that tab?
I've found methods to show a popups over the whole page, but not only in specific tabs.
When you switch the gwt tab, the popup should not be visible anymore and new popups should be able to be created, which again are only visible in the switched to gwt tab. Switching back to the other tab should then show the first popup again.
Optionally the rest of the tab, which is not covered by the popup, should not be clickable.
Are there any native methods for this? The gwt Popup Panel only seems to create popups for the whole page.
Edit: I've tried using smartgwts Window which seems to work just the way I want it to. When I switch the gwt-tab, the popup is no longer visible and returns when I switch back. The only problem is, that it isn't displayed right. The frame is placed on the far left side of the browser tab, while the content is displayed on the far left of the gwt-tab. If I move the content, the frame moves too. The frame is visible over the whole browser tab, while the content disappears if I drag it over the gwt-tab edge.
I guess it's because I'm adding a Window to a gwt-Panel. Is there any way to fix this without changing everything to smartgwt?

Not exactly, I think.
But, you can do something in the tab events, like hide the popup in tabs that it doesnt belongs. To avoid the lag of show/hide the popup, you can do this in the BeforeSelectionHandler, like this:
getView().getTabPanel().addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>()
{
#Override
public void onBeforeSelection(BeforeSelectionEvent<Integer> event)
{
showPopupupsForTab(event.getItem());
}
});
In showPopupupsForTab you can show the popups for this tab (you can handle this with a map or something) and hide the others...
Something like this.
Hope it helps.

Related

GWT - Move panel to new browser tab/window

I'm working on a GWT application that has the following layout:
- on top there's Menu Bar
- below that screen is separated into two panel by Split Layout Panel
When user clicks on a label in Menu Bar relevant information is show below in the left part of the screen. Then user clicks on an action item on that left part of the screen, and relevant information on that action item is displayed on the right part of the screen.
Clicking on an action item on the right part of the screen may also change relevant information on left part of the screen.
I want to extend on this by giving a possibility to drag/drop the panel on the right part of the screen to another browser tab/window. After that the right and left part of the screen should remain connected as if they are in the same browser tab/window.
Also, that new tab/window should only display that right panel, while Menu Bar and left panel, along with Split Layout Panel should not be present (this is less important but it would be great if it can be done).
Another important thing is that current visual representation of application is not changed but only extended with this functionality.
Is that something that can be done and if it is how to do it?
Thank you for your help.
I think you would have to use "HTML5" native drag and drop to drag between browser instances, so that would limit browser support. Both tabs would already have to have your code loaded into them so they could respond to these events.
If you have a server back end (not just static HTML/JS) then you could communicate via the server. Otherwise maybe "HTML5" client side storage to store blobs of data describing the panel contents. Probably easier re-render in the new browser/tab.

select menu inside a div with fixed position on mobile safari, iphone

I am building a site that has a header with a fixed position which contains a select menu. The header is supposed to stay locked to the top of the screen due to the position:fixed in css. However, when clicking the select menu in mobile safari on iphone, the header no longer stays locked to the top when the ios select menu opens. It seems that ios is centering the div with the select menu onto the visible area of the screen above the menu. This doesn't happen when the page is scrolled to the top, but when the address bar is not visible, it "breaks" like so. Haven't found any other answers, maybe I'm asking the question the wrong way. I can't post links to code yet, any help is appreciated.
http://selfconstruc.tv/menu-open.PNG
http://selfconstruc.tv/menu-closed.PNG
For now I don't think there is a perfect solution to deal with the focus jumping.
In my case I hide the header on focus in and show again in focus out and it works well.
I don't know if in your case this could be a workaround.
You can try this:
// detect ios device
if(navigator.userAgent.match(/(iPad|iPhone|iPod)/gi)){
// hide header on focus in and show on focus out
jQuery("#content").focusin(function(){
jQuery('#your-header-id').hide();
})
jQuery("#content").focusout(function(){
jQuery('your-header-id').show();
})
}
The #content is a div where you should have all your controls, the jQuery .focusin() detects the focus event on parent elements, so every control will trigger the focus event. You hide the header on focus and show after that. Hope this helps!

How to have a popup scrolling in the same way that others elements?

I can not solve my problem. As example, my website : www.mananaseguro.com.
In the home page, I have some popup appearing just under movies's poster (when the mouse is over the poster). But when I scroll UP (for example), the popup will not appear just under the poster. Their is a space between them. I tried to add the popup to the home's page panel but it did not succeed.
So is it possible to simulate the good popup behavior? (the popup must stay under the poster).
Or more precisely, is it possible to attach a DecoratedPopupPanel to another panel inside the page in order to have the popup scrolling in the same way that others elements?
Try using the PopupPanel#showRelativeTo() method.
You can achive good popup behavior by using below property.
popup.setPopupPosition(left, top)
Pass movie image x and y index position in top and left. and make consistent look and fill.

Ajax Control Toolkit - Use client-side button to activate tab

I'm using the TabContainer/TabPanel components of the Ajax Control Toolkit.
I'd like to hide the tabs themselves and use a button elsewhere on the page to activate (bring to the front) one of the tabs without posting back to the server.
I can show and hide the tabs by grabbing their clientIDs and manually setting the visibility and display styles.
But is there a javascript function I can call to do this and perform whatever magic happens behind the scenes when I click an actual tab?
Example:
var tab = $find(“tabContainer’s ClientID”);
tab.set_activeTabIndex(1); // active the second tab panel
tab.getFirstTab().set_enabled(false); // disable the first panel

Coda Slider Tab Navigation

I am using Coda-Slider for my website and I want to know if there is a way to change the content of each tab. For example, the user navigates onto tab2 where I placed a link to redirect the user to another page. Is there a way NOT to navigate away from the page nor the tab but instead load the link inside the tab? I was thinking it would look something like a modal box that would stay inside the tab instead of popping up.
see 19. Coda-Slider Sliding Tabs or you might want to try 35. JQuery IDTabs if you want the effect to be non-intrusive