1

ZK popup Component Issue [closed]

asked 2015-01-31 00:35:37 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2611 3 8
http://emrpms.blogspot.in...

updated 2015-01-31 00:36:06 +0800

I am having popup component in my zul as follows

<zk>
  <window>
  Some components goes here
    <popup id="exportExcel">
            <panel height="100px" width="200px" framable="true" 
                title="Panel2" border="normal" maximizable="true"
                style="margin-bottom:10px" closable="true">
                <panelchildren>
                    <separator></separator>
                    <separator></separator>
                    <vgrid>
                        <columns>
                            <column hflex="1"></column>
                            <column hflex="1"></column>
                            <column hflex="1"></column>
                        </columns>
                        <rows>
                            <row>
                                <vlayout>
                                    <button label="Export All Claims"
                                        onClick="@command('onExportClaims')" sclass="smallbutton" />
                                </vlayout>
                                <vlayout>
                                    <button
                                        label="Export All Line Items"
                                        onClick="@command('onExportLineItems')" sclass="smallbutton" />
                                </vlayout>
                                <vlayout>
                                    <button
                                        label="Export Rejected Line Items"
                                        onClick="@command('onExportRejectedLineItems')"
                                        sclass="smallbutton" />
                                </vlayout>
                            </row>
                        </rows>
                    </vgrid>
                </panelchildren>
            </panel>
        </popup>
    </window>
</zk>

In the MVVM , i am calling the popup as follows

    @Wire("#exportExcel")
    Popup exportExcelPopup;

    @Command
    public void onExcel(@BindingParam("target") Component targetComponent) {
        exportExcelPopup.open(this.win, "middle_center");
    }

@Command
public void onExportClaims() {
    exportExcelPopup.close();
    //Some code goes here
}

When i click on Export Claims Button, the popup closed and next time when we open the popup, then there is no problem. But when the popup is shown, instead of clicking of any of the buttons, if we use X mark in the panel, to close the popup, then when we again try to show the popup, it never shows.

I can understand that on clicking close button of the panel, then popup itself destroyed and cannot be created again. Any alternate solution for this ?

delete flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by Senthilchettyin
close date 2015-01-31 07:19:56

2 Answers

Sort by ยป oldest newest most voted
1

answered 2015-01-31 06:44:24 +0800

chillworld gravatar image chillworld flag of Belgium
5322 4 9
https://github.com/chillw...

Just set a command for the onclose in the panel. Stop the event propagation and close the popup like in onexportclaims.

Greetz chill

link publish delete flag offensive edit
0

answered 2015-01-31 07:18:16 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2611 3 8
http://emrpms.blogspot.in...

Yes I got it.

I added onClose Event for the window inside the popup component as follows

<popup id="exportExcel">
            <window id="winexceloptions" title="Export" width="620px"
                height="110px" border="normal" minimizable="false" closable="true"
                onClose="@command('onClosePopup')" sclass="myembedded"
                maximizable="false">

Then event handler is as follow

@Command
public void onClosePopup(
        @ContextParam(ContextType.TRIGGER_EVENT) Event event) {
    event.stopPropagation();
    exportExcelPopup.close();
}
link publish delete flag offensive edit

Question tools

Follow

RSS

Stats

Asked: 2015-01-31 00:35:37 +0800

Seen: 15 times

Last updated: Jan 31 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More