Upasana
Upasana

Reputation: 45

how to add a popup with an exiting functionality of hybris backoffice?

I want to add the popup to an existing functionality of backoffice. When a user click on the icon a popup will be populated with a text box and submit button.

I have tried many things but still can't find any proper solution. Help me in that to resolve the issue.

Upvotes: 2

Views: 694

Answers (1)

Benkerroum Mohamed
Benkerroum Mohamed

Reputation: 1936

Create a new class that extends org.zkoss.zul.Window Class :

public class CustomWindow extends Window {

}

Then create a render method and add your components :

public class CustomWindow extends Window {
    
    
        public void render(WidgetInstanceManager wim) {
            initComponent(wim);
            final Vlayout container = new Vlayout();
            final Labeltext =new Label("text");
            final Button button = new Button("button");
            container.appendChild(button);
            container.appendChild(text);
            this.appendChild(container);
            setClosable(true);
    
        }
    }

Then you can open your custom window with :

CustomWindow customWindow = new CustomWindow ();
customWindow.render(getWidgetInstanceManager());
customWindow.setParent("add parent component here");
customWindow.doModal();

Adapt the code to correspond more to your needs.

Hope this helps.

Upvotes: 1

Related Questions