最小化事件中的event.stopPropagation在zk 7.1中不起作用



这是我的代码

<window id="chatW" border="none" mode="overlapped"
    viewModel="@id('vm') @init('zul.chat.chattest.ChatController')"
    binder="@init(queueScope='application')"
    minimizable="true"
    onClick="@command('showChat')"
    title="${labels.conversation }" apply="org.zkoss.bind.BindComposer"
    onMinimize="@command('minimize')">
</window>

以及控制器最小化的方法

    @Command("minimize")
    @NotifyChange("minimizedWindow")
    public void minimize(
            @ContextParam(ContextType.TRIGGER_EVENT) MinimizeEvent event) {
        System.out.println("in minimize event" + event);
        event.stopPropagation();
    }

当我点击最小化按钮时,窗口消失。我如何才能阻止此事件?

您必须添加一个按钮才能返回窗口,请参阅下面的代码

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
    <window  height="100%" width="100%" border="normal">
    <panel id="panel" title="Panel" framable="true" height="400px" width="700px"
        maximizable="true" minimizable="true"  border="normal" collapsible="true" closable="true">
        <panelchildren>       
        <tabbox >
            <tabs>
                <tab label="Find"></tab>
                <tab label="Result"></tab>
            </tabs>
            <tabpanels>
                <tabpanel>
                    <grid id="OwnerMultipleGrd" 
                        mold="paging" pageSize="5" style="align:top;">
                        <columns>
                            <column align="center" width="25px">
                                <checkbox></checkbox>
                            </column>
                            <column align="center">Taxonomy</column>
                            <column align="center">Asset Type</column>
                            <column align="center">Category</column>
                            <column align="center">Sub-Category</column>
                            <column align="center" width="25px">
                                <image id="AddTaxononomyImg"
                                    src="/AMContribution/Icons/Add.png">
                                </image>
                            </column>
                        </columns>                      
                    </grid>
                </tabpanel>
                <tabpanel>
                    <grid id="demoGrid" 
                        mold="paging" pageSize="5" style="align:top;">                      
                        <auxhead>
                            <auxheader width="25px">                            
                            </auxheader>
                            <auxheader >
                                <image
                                    src="/TaxonomyManager/Icons/funnel.png" />
                                <textbox id="filter1" width="100px" />
                            </auxheader>
                            <auxheader >
                                <image
                                    src="/TaxonomyManager/Icons/funnel.png" />
                                <textbox id="filter2" width="100px" />
                            </auxheader>
                            <auxheader >
                                <image
                                    src="/TaxonomyManager/Icons/funnel.png" />
                                <textbox id="filter3" width="100px" />
                            </auxheader>
                            <auxheader >
                                <image
                                    src="/TaxonomyManager/Icons/funnel.png" />
                                <textbox id="filter4" width="100px" />
                            </auxheader>                            
                        </auxhead>
                        <columns>                           
                            <column width="25px"><checkbox></checkbox> </column>
                            <column>Taxonomy</column>
                            <column>Asset Type</column>
                            <column>Category</column>
                            <column>Sub-Category</column>                           
                        </columns>                      
                    </grid>
                    <div align="center">
                    <button>Submit</button> <button>Cancel</button>
                    </div>
                </tabpanel>
            </tabpanels>
        </tabbox>
         </panelchildren>
    </panel>
    <button label="restore">
        <attribute name="onClick">
            panel.setMinimized(false);
        </attribute>
    </button>
    </window>
</zk>

最小化效果必须在客户端停止,因为最小化效果不受服务器控制
看看这里。

最新更新