Vaadin 7 add buttons into Accordion com.vaadin.ui.TabSheet.Tab caption

早过忘川 提交于 2019-12-12 04:25:49

问题


Is it possible to add a buttons in Vaadin 7 to Accordion com.vaadin.ui.TabSheet.Tab caption ?

Right now I can only add a String into Tab caption.

This is my current screen:

I need to add the same Edit/Remove icons(as I have for Live Chat and WMA) near the General and Julia Group tab captions.


回答1:


Unfortunately it's not possible.

You could create a server-side composition, which behaves like Accordion but then you could design the component so that you can add buttons to tab captions. You could start with something like this:

public class MyAccordion extends CustomComponent {

    public MyAccordion() {

        VerticalLayout layout = new VerticalLayout();
        setCompositionRoot(layout);
        // TODO layout should contain all tabs and tab captions
    }
}

Another option would be to create an extension by using GWT or Javascript and on the client-side modify DOM so that there a two buttons on tab captions.



来源:https://stackoverflow.com/questions/38550981/vaadin-7-add-buttons-into-accordion-com-vaadin-ui-tabsheet-tab-caption

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!