PopupButton component


It worked … thanks
put the
Widgetset (Value = br.com.rafael sms.sgh_estoque.widgetset.Sgh_estoqueWidgetset ")
I had put -
Widgetset (Value = “br.com.rafaelsms.sgh_estoque.widgetset.PopupbuttonWidgetset”)
I was giving error.

Hello,

with the version 7.6.0 of vaadin the Popup button doesn’t work correctly (the buttons are always in visible state), have you the same problem ?

Thanks …

After many test, it worked (no prb)…

Hi Henri Kerola,

Good addon and thank you so much. Its been an year i’m using it. Now i have little issue with keyboard shortcuts.

I’m using Popupbutton inside a window.
i kept the setPopupVisible(true).
whenever the window is opened the PopupButton’s popup content also shown.
Inside the popup content i have some check boxes and one button.
I kept the keyboard shortcut for this button.

The Keyboard shortcut works fine if i use it immediately after opening the window, because the focus is on the window.

But Keyboard shortcut is not working if the focus is on the popup content.(This case happens when i select or deselect the checkboxes inside the popup content)

And Keyboard shortcut is working in case if i dont set the setPopupVisible(true) and manually open the popup content.

Is there any solution for this?

Thank You!
Mahmood.

Hi Mahmood,

Do you have a small code example demonstrating the problem?

Thanks,

-Henri

[code]
import org.vaadin.hene.popupbutton.PopupButton;

import com.vaadin.event.ShortcutAction.KeyCode;
import com.vaadin.event.ShortcutAction.ModifierKey;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CssLayout;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.NativeButton;
import com.vaadin.ui.Notification;
import com.vaadin.ui.OptionGroup;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;

public class AsampleClass extends CustomComponent {

private CssLayout mainLayout;

public AsampleClass() {
    buildMainLayout();
    setCompositionRoot(mainLayout);
}

private void buildMainLayout() {
    mainLayout = new CssLayout();
    
    final Window win = new Window();
    win.setWidth("500px");
    win.setHeight("500px");
    win.setModal(true);
    
    NativeButton btnClick = new NativeButton("Click");
    btnClick.addClickListener(new ClickListener() {
        public void buttonClick(ClickEvent event) {
            getUI().addWindow(win);
        }
    });
    
    PopupButton btnPopup = new PopupButton("Options");
    win.setContent(btnPopup);
    
    VerticalLayout vlyMain = new VerticalLayout();
    
    OptionGroup opt = new OptionGroup();
    opt.addItem("All");
    opt.addItem("Few");
    opt.addItem("None");

    NativeButton btnView = new NativeButton("View");
    btnView.setClickShortcut(KeyCode.V, ModifierKey.ALT);
    btnView.addClickListener(new ClickListener() {
        public void buttonClick(ClickEvent event) {
            Notification.show("View Button Clicked!!!");
        }
    });
    
    vlyMain.addComponents(opt,btnView);
    vlyMain.setWidth("500px");
    
    btnPopup.setContent(vlyMain);
    btnPopup.setPopupVisible(true);
    
    mainLayout.addComponent(btnClick);
    
}

}
[/code]After opening the window select some radio button and try keyboard shortcut “Alt+V”. This doesn’t work.
But if you manually open the popupbutton then it works.

Thankyou!
Mahmood.

Hi Henri,

Can we expect PopupButton to continue to work with Vaadin 8?

Yes. Most likely it will work without any changes but if not I am going to fix it to work with Vaadin 8.

Thank you,

-Henri

Please include details about the license in the MANIFEST.MF file for a future release. e.g.

Vaadin-License-Title: Apache 2.0 Vaadin-License-File: http://www.apache.org/licenses/LICENSE-2.0 As we currently check the license of each used library this would automatically include it.
Although it is not explicitely defined as mandatory the documention is available here:

https://vaadin.com/docs/-/part/framework/gwt/gwt-addons.html

Hİ !
I m create my MPopupButton extends PopupButton class… Everything is good. I m use this popupbutton…
However I want test to this button… Normally " $(ButtonElement.class).caption(“1”).first().click(); " its true.
But “$(MPopupButton.class).caption(”“).first().click();” its not compile in eclipse. I m getting 2 eror.

How do test my MPopupButton

Thaks for everything…

Hi Henri,
is it possible for you to add some layout functionality, to put the Popup to the left or right of the Button, instead putting it on top or bottom of the button? I played around with the alignments but had no success.

Regards,
Christian

Hi Henri,

is it compatible with vaadin8? cause when i click the button, the menu is empty.

[code]
public HomeMenu(String username) {
this.username = username;

    VerticalLayout popupLayout = new VerticalLayout();
    lbluser = new Label("Logged as: " + username);
    lbluser.setStyleName("loggedname");
    popupLayout.addComponent(lbluser);
    popupLayout.addComponent(getLogButton());
    
    this.addComponent(popupLayout);
}

[/code]made a demo call in the Designroot…

[code]
public EveLookAndFeel() {
Design.read(this);

    popupButton.setContent(getDemo());
    popupButton.setClosePopupOnOutsideClick(false);
    popupButton.setDirection(Alignment.BOTTOM_LEFT);
}

public void setHomemenu(HomeMenu homemenu) {
    //popupButton.setComponent(homemenu);
}

private Component getDemo() {
    return new HomeMenu("username");
}

[/code]but it is empty, look attachment.

31702.png

ok fixed myself - recompile widgetset :smiley:
But will you support more Alignment Positions, pls ? :slight_smile:

As you noticed, version 3 of PopupButton supports Vaadin 8.

Which Alignment positions would you need?

Thanks,

-Henri

Hi Henri,

could you please add the alignment for positioning the menu to the left/right of the button?

Thanks and regards,
Christian

Hey author it is a very nice Addon that i have liked from Vaadin Directory and making it work perfect and i have small doubts which are

  1. Is there a way to show popup on hover of button
  2. Is there a way not to show the down-arrow mark (Mostly i think this has to be handled with Css) but checking it out simpler way why i am asking is i hate CSS :stuck_out_tongue:

I have a problem with the following setup: Vaadin 7.7.9 and PopupButton 2.5.0:
Problem: I use popupButtons inside table rows.
Content of the PopupButton is a grid.
The Popup opens correct, but then stays open, no matter where the user clicks. This ends up in opening as many popups as you want in parallel. Using other components than grid works well.
Any suggestions? I really need input to solve this problem.
Thx.
UPDATE: Update to PopupButton 2.6.0 solved the problem!

Hi

I found this demo for vaadin
https://demo.vaadin.com/dashboard/#!dashboard

On the top right there is this notification button which opens a PopupView… The way this popup behaves is different from the standard PopupView of vaadin where this Popup opens right under button. There is also a count of notifications shown on the button.

Wondeing if this component is PopupButton. If not which one is this… If yes how can i achieve the same functionality.

I need this exact behavious in my application. If someone can point me to the code of this dashboard implementation would be of great help.

Thanks in Advance.
Hari

Christian Metzner:

Henri Kerola:

Rhonibaer: ok fixed myself - recompile widgetset :smiley:
But will you support more Alignment Positions, pls ? :slight_smile:

As you noticed, version 3 of PopupButton supports Vaadin 8.

Which Alignment positions would you need?

Thanks,

-Henri

Hi Henri,

could you please add the alignment for positioning the menu to the left/right of the button?

Thanks and regards,
Christian

Hi Henri,

I am not sure if this thread is still alive, but is it now possible to position the menu right of the button?

Thanks!
Sebastian

Henri Kerola:

Guy Brush:
Here’s my question: You wrote, the button opens its components above itself, when there’s not enough space below it. Where is this issue checked? I’d like to force my content always to be displayed below my button. Or any other hints?

That’s checked in the [client-side code]
(https://github.com/henrikerola/PopupButton/blob/master/src/org/vaadin/hene/popupbutton/widgetset/client/ui/VPopupButton.java#L160).

Hi
What if there is not enough place above either? Can I somehow change this behavior?
Thanks