0

DEMO onClick event for menuitem in menupopup not working in ZKEE-bin-5.0.5?

asked 2011-02-10 04:03:11 +0800

Steva77 gravatar image Steva77 flag of Italy
1014 3
http://www.research.softe...

updated 2011-02-10 04:06:08 +0800

I can't get the manager class extending GenericForwardComposer get onClick event from menupopup's menuitems...
With ZKEE-bin-5.0.5 the demo code at http://www.zkoss.org/zkdemo/menu/pull-down_menu does not prompt any popup :(((

<zk>
    <style>.z-menubar-hor, .z-menubar-ver { border: 1px solid #D8D8D8; }</style>
    <menubar id="menubar" width="100%" >
        <menu label="Project" image="/widgets/menu/pull-down_menu/img/luggage.png">
            <menupopup>
                <menuitem label="New" onClick="alert(self.label)"
                    image="/widgets/menu/pull-down_menu/img/report-paper.png" />
                <menuitem label="Open" onClick="alert(self.label)"
                    image="/widgets/menu/pull-down_menu/img/folder-horizontal-open.png" />
                <menuitem label="Save" onClick="alert(self.label)"
                    image="/widgets/menu/pull-down_menu/img/disk-black.png" />
                <menuitem label="Exit" onClick="alert(self.label)"
                    image="/widgets/menu/pull-down_menu/img/door-open-out.png" />
            </menupopup>
        </menu>
        <menu label="Help" image="/widgets/menu/pull-down_menu/img/question.png">
            <menupopup>
                <menuitem label="Bug Report" onClick="alert(self.label)"
                    image="/widgets/menu/pull-down_menu/img/bug.png" />
                <menu label="About">
                    <menupopup>
                        <menuitem label="About Potix" image="/widgets/menu/pull-down_menu/img/information-white.png"
                            onClick="alert(self.label)" />
                    </menupopup>
                </menu>
            </menupopup>
        </menu>
        <menu image="/widgets/menu/pull-down_menu/img/color.png">
            <menupopup>
                <menu label="Color Picker 1" content="#color=#ff9933" />
                <menu label="Color Picker 2" content="#color=#31548C" />
            </menupopup>
        </menu>
        <menuitem label="ZK Web Framework" image="/images/zk16x16.png" onClick="alert(self.label)" />
    </menubar>
</zk>

Actually, the popup is prompted only for

<menuitem label="ZK Web Framework" image="/images/zk16x16.png" onClick="alert(self.label)" />

i.e. the only menuitem not included in menupopup....

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2011-02-10 06:43:51 +0800

Steva77 gravatar image Steva77 flag of Italy
1014 3
http://www.research.softe...

FOUND THE ISSUE!
I had this configuration in zk.xml:

<!--	Block request for inaccessible widgets for the whole application -->
<listener>
	<listener-class>org.zkoss.zkmax.au.InaccessibleWidgetBlockService$DesktopInit</listener-class>
</listener>	

This actually prevents the onClick event on the menupopup's menuitem to be fired.
Maybe the behaviour is correct - I do not know this configuration's behaviour very well.
If you copy this configuration in a new project, the demo example included in index.zul does not work as well.
Hope it helps,

link publish delete flag offensive edit

answered 2011-02-11 02:43:53 +0800

SimonPai gravatar image SimonPai
1696 1

Please do not cross-post. Let's concentrate discussion here.

Regards,
Simon

link publish delete flag offensive edit

answered 2011-02-11 05:09:57 +0800

Steva77 gravatar image Steva77 flag of Italy
1014 3
http://www.research.softe...

Sorry - I did not know the issue on the two posts was the same until I found out the problem - just wanted to "close" the thread for future readers.
Thanks for the feedback,
cheers
Stefano

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-02-10 04:03:11 +0800

Seen: 634 times

Last updated: Feb 11 '11

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