Thomas,

I used the two files you attached "jscookmenu.jsp" and "JSCookMenuBean.java" to create a menu to navigate between two jsp pages. The navigation don't work from either page to the other (no navigation at all).  Here is the snippet of code from the jsp that creates the menu:

<t:jscookMenu layout="vbr" theme="ThemePanel">
        <%/* Availaible jscookMenu themes: ThemeIE, ThemeMiniBlack, ThemeOffice, ThemePanel
             Availaible jscookMenu layout: hbr, hbl, hur, hul, vbr, vbl, vur, vul
             respect to Heng Yuan http://www.cs.ucla.edu/~heng/JSCookMenu
       */%>
  <t:navigationMenuItems id="nav_1"
                         value="#{ navigationMenu.JSCookMenuNavigationItems}" />
    <t:navigationMenuItem id="nav_2"
                        actionListener="#{navigationMenu.actionListener}"
                        itemLabel="#{messages['nav_about']}"
                        itemValue="go_about"
                        action="">                        icon="images/menublank.gif"/>
</t:jscookMenu>  

I have included the menu that was created when I ran the app:
<html>
<head>
<script type= "text/_javascript_" src="/faces/myFacesExtensionResource/org.apache.myfaces.component.html.util.MyFacesResourceLoader/11364315/navmenu.jscookmenu.HtmlJSCookMenuRenderer/JSCookMenu.js" ><!--

//--></script>
<script type="text/_javascript_" src="/faces/myFacesExtensionResource/org.apache.myfaces.component.html.util.MyFacesResourceLoader/11364315/navmenu.jscookmenu.HtmlJSCookMenuRenderer/MyFacesHack.js" ><!--

//--></script>
<script type="text/_javascript_" ><!--
var myThemePanelBase='/faces/myFacesExtensionResource/org.apache.myfaces.component.html.util.MyFacesResourceLoader/11364315/navmenu.jscookmenu.HtmlJSCookMenuRenderer/ThemePanel/';
//--></ script>
<script type="text/_javascript_" src= "/faces/myFacesExtensionResource/org.apache.myfaces.component.html.util.MyFacesResourceLoader/11364315/navmenu.jscookmenu.HtmlJSCookMenuRenderer/ThemePanel/theme.js"><!--

//--></ script>
<link rel="stylesheet" href
="/faces/myFacesExtensionResource/org.apache.myfaces.component.html.util.MyFacesResourceLoader/11364315/navmenu.jscookmenu.HtmlJSCookMenuRenderer/ThemePanel/theme.css" 
type="text/css" />
<meta HTTP-EQUIV= "Content-Type" CONTENT="text/html;charset=UTF-8" />
< title> The title</title>
<link rel="stylesheet" type="text/css" href="css/ipstyle.css" />
<link rel="shortcut icon" href="images/favicon.ico" />
</head>

<body>


<table id="header_group1" border="0" class="pageHeader"><tbody><tr><td>< img id="header_logo" src="images/IPIWebSiteHeader.gif" alt="" /></td><td>< span style="font-size:10px;color:#000000">Wednesday, January 4, 2006</span >
                


</td></tr>
<tr ><td><img id="header_spacer_main" src ="images/horizontal-spacer-main.gif" alt="" /></ td><td><img id="header_spacer_left" src="images/horizontal-spacer-right.gif" alt="" /></td></tr>
</tbody></table>

<
table border="0" class="pageBody"><
tbody><tr><td class="panelMenu"><
script type="text/_javascript_"><!--
var idJsp4_menu =
[[null, 'Home', 'idJsp4_menu:L#{navigationMenu.actionListener};Home:Ago_home', 'linkDummyForm', null],
['<img src="" 'About', 'idJsp4_menu:L#{navigationMenu.actionListener};go_about:Ago_about', 'linkDummyForm', null]];
//--></script>< div id="idJsp4_menu"></div>
<script type="text/_javascript_"><!--
cmDraw ('idJsp4_menu', idJsp4_menu, 'vbr', cmThemePanel, 'ThemePanel');
//--></script>





</td><td class= "panelSpacer"><img id="spacer" src= "images/vertical-spacer.gif" alt="" />

</ td><td class="panelContent">
<P>& nbsp;</P>
<P> Some text here </P>
            </td></
tr>
</tbody></table>
<form id= "linkDummyForm" name="linkDummyForm" style="display:inline" method="post" action="/about.jsf">< input type="hidden" name="jsf_tree_64" id="jsf_tree_64" value="H4sIAAAAAAAAAK1Qu07DQBBcGSLES7wKWgokqGxBQZMyEiFREIiXhFxYx/liX2TfHed1MA0dPR/AF6B8AV9AR8tP0FKzVgyJUIQoaO529nZn5mbwDrXMQlPbyGWG8Vi46W2XcZERNInkDKVW7pkV4hRtzjG34pApFgm7OWo2dGq0Egr3L9ffHtsfrw5M+zAb8FgmoaU+tP0OSXhDCa+S8MYkvL9K1DuwFPAv1EhYliGsdnqsz7yEqcijeakiGlsYjbXCa7gDx4eZoFRGWlnzx3aOrnq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4EP1OZGPApGR8LLQVlwpSuw75+1f11sW1vRimEDRqKKHpK6sdA5dxnt4+c+2HppgWWC/d5PiNJomC8r2HreKT7dcLrmCvd693ZMdja+TzJxKqExzdIkzL7VZRgNooDPQOctmBQrEwXZ+eet9o0SXQ1ktN7dTKmaHvfOKffx8MRFimZdl52TtFmI1K5THYYLQ8rma970WuD5yzw9z78vHg3AulEdudsW1xGZ3msCDvQjXcA4yFnPdv+R9bYVAXro3fJ+tFNWcsobCmkjc6HNyOe/dcUrHXnwEFD7UGxCS0Lj3ean7sGhk25F+GZnvV8z3ouG0in29CPCRJTtkjjdP+UMRsmoXxT10nq1jBQuxFgo5kwgjNhlgdrAxMBzEQoZ9kdIG43eVoHAAA=" /><input type="hidden" name ="jsf_viewid" id="jsf_viewid" value= "/about.jsp" /><input type="hidden" name="autoScroll" /><input type= "hidden" name="jscook_action" /><script type="text/_javascript_"><!--
function clear_linkDummyForm() {
var f = document.forms['linkDummyForm'];
f.elements['jscook_action'].value='';
f.target='' ;
}
clear_linkDummyForm();
//--></script></form><script type= "text/_javascript_"><!--
function getScrolling() {
var x = 0; var y = 0;
if (self.pageXOffset || self.pageYOffset) {
x = self.pageXOffset;
y = self.pageYOffset;
} else if ((document.documentElement && document.documentElement.scrollLeft)||(document.documentElement && document.documentElement.scrollTop)) {
x = document.documentElement.scrollLeft;
y = document.documentElement.scrollTop;
} else if (document.body) {
x = document.body.scrollLeft;
y = document.body.scrollTop;
}
return x + "," + y;
}
//--></ script>

</body>
</html>

In the navigation rules section of the myfaces-config.xml file I have the following rules:
....
        <from-view-id>*</from-view-id>

        <navigation-case>
            <from-outcome>go_home</from-outcome>
            <to-view-id>/home.jsp</to-view-id>
        </navigation-case>

        <navigation-case>
            <from-outcome>go_about</from-outcome>
            <to-view-id>/about.jsp</to-view-id>
        </navigation-case>
.....

The "JSCookMenuBean.java" was used just as it was provided. 

I am using the nightly build dated 12/30/2005.  Can you please tell me what I am missing?  Can someone please provide a working example of a JSCookMenu using a backing bean?

Thanks in advance....!

On 12/19/05, Thomas Spiegl <[EMAIL PROTECTED]> wrote:
Hi,

I implemented the actionListener for JSCookMenu. Get the latest version from SVN or use nightly build to get the new feature.
Attached you will find an example.

1) Example 1  Static
<t:navigationMenuItem id="nav_2"
    actionListener="#{navigationMenu.actionListener}"
    itemLabel="#{example_messages['nav_Home']}"
    itemValue="go_home"
    action=""
The actionListener JSCookMenuBean.actionListener(ActionEvent event) will be executed. HtmlCommandJSCookMenu is now holding the itemValue of the clicked menu entry. Additionaly the action attribute may be given to trigger a page navigation.

2) Example 2 Dynamic
Shows how to generate menu items 'dynamically' by using NavigationMenuItem(s) + how to define an ActionListener per item (see JSCookMenuBean.getJSCookMenuNavigationItems())
The actionListener JSCookMenuBean.actionListener(ActionEvent event) will be executed. HtmlCommandJSCookMenu is now holding the value that was set for the NavigationMenuItem (see JSCookMenuBean.getMenuNaviagtionItem(...))

Cheers
Thomas




On 12/19/05, Thomas Spiegl <[EMAIL PROTECTED] > wrote:
Yes thats right, you cannot pass values to your action Method. The actionListener feature needs to be added to the JSCookMenu.

Thomas


On 12/19/05, Dudu <[EMAIL PROTECTED]> wrote:



Thanks Thomas,
But do you know  how I can get what  navigationMenuItem was clicked,
because it are created dinamically, and depending the navigationMenuItem
clicked, a tab will be created......
I cannot to call a action passing some values? Am I right?
I'm stopped because this problem.
Thanks again.


Thomas Spiegl wrote:
> ActionListener does not work with jscookMenu and navigationMenuItem.
> You may use the navigationMenuItem.action attribute to trigger your
> backingBean action.
>
> Regards
> Thomas
>
> On 12/19/05, *Dudu* < [EMAIL PROTECTED]
> <mailto: [EMAIL PROTECTED]>> wrote:
>
>     Sorry,
>     JscoockMenu
>
>     ps: I'm reading about <adf:setActionListener> to know if it solve this
>     problem, but I'm no sure about it.....
>     thanks
>
>     Thomas Spiegl wrote:
>     > What kind of menu are you using jscookMenu or panelNavigation2?
>     >
>     > Thomas
>     >
>     > On 12/19/05, *Dudu* < [EMAIL PROTECTED]
>     <mailto: [EMAIL PROTECTED]>
>     > <mailto: [EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>>> wrote:
>     >
>     >     Hi,
>     >     I several NavigationMenuItems, created dinamically. I want
>     when a
>     >     user
>     >     click on a menu,  I want to create a new tab.....
>     >
>     >     But I do not know:
>     >     1 - How to get what navigationMenuItem was clicked.
>     >     2 - How to set dynamically a method of a backing bean?
>     >
>     >     Initially is this
>     >
>     >
>     >
>     >
>     >
>     >
>     >     _______________________________________________________
>     >     Yahoo! doce lar. Faça do Yahoo! sua homepage.
>     >     http://br.yahoo.com/homepageset.html
>     >
>     >
>     >
>     >
>     > --
>     > http://www.irian.at
>     >
>     > Your JSF powerhouse -
>     > JSF Consulting, Development and
>     > Courses in English and German
>     >
>     > Professional Support for Apache MyFaces
>     S
>
>
>
>
>
>     _______________________________________________________
>     Yahoo! doce lar. Faça do Yahoo! sua homepage.
>     http://br.yahoo.com/homepageset.html
>
>
>
>
> --
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces






_______________________________________________________
Yahoo! doce lar. Faça do Yahoo! sua homepage.
http://br.yahoo.com/homepageset.html




--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces



--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces


Reply via email to