Thanks again Thomas, but I coded like this:
*
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces/html" prefix="afh"%>
<%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<f:view>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=windows-1252"/>
<script language="JavaScript"
src="sag/jscookmenu/JSCookMenu.js"></script>
<link rel="stylesheet" href="sag/jscookmenu/ThemeOffice/theme.css"
type="text/css"/>
<script language="JavaScript"
src="sag/jscookmenu/ThemeOffice/theme.js"></script>
<title>untitled1</title>
</head>
<body><h:form binding="#{backing_untitled1.form1}" id="form1">
<t:jscookMenu layout="hbr" theme="ThemeOffice"
binding="#{backing_untitled1.jscookMenu1}"
id="jscookMenu1">
<t:navigationMenuItem
binding="#{backing_untitled1.navigationMenuItem1}"
action="LOGOFF_GLOBAL"
id="navigationMenuItem1"/>
<t:navigationMenuItem
binding="#{backing_untitled1.navigationMenuItem2}"
action="LOGOFF_GLOBAL"
id="navigationMenuItem2">
<t:navigationMenuItem
binding="#{backing_untitled1.navigationMenuItem3}"
action="LOGOFF_GLOBAL"
id="navigationMenuItem3"/>
<t:navigationMenuItem
binding="#{backing_untitled1.navigationMenuItem4}"
action="LOGOFF_GLOBAL"
id="navigationMenuItem4"/>
</t:navigationMenuItem>
</t:jscookMenu>
</h:form></body>
</html>
</f:view>
*And the menu is displayed, but I click on any navigationMenuItem,
nothing happen, no submit....
and here is the javascript generated to jscookmenu*
*
* <script type="text/javascript">var form1_jscookMenu1_menu =
[[null, '0', 'form1_jscookMenu1_menu:ALOGOFF_GLOBAL', 'form1', null],
[null, '0', 'form1_jscookMenu1_menu:ALOGOFF_GLOBAL', 'form1', null,[null, '0',
'form1_jscookMenu1_menu:ALOGOFF_GLOBAL', 'form1', null],
[null, '0', 'form1_jscookMenu1_menu:ALOGOFF_GLOBAL', 'form1', null]]];</script><div
id="form1_jscookMenu1_menu"></div>**
<script type="text/javascript"> cmDraw ('form1_jscookMenu1_menu',
form1_jscookMenu1_menu, 'hbr', cmThemeOffice, 'ThemeOffice');</script>*
*I think it is a bug,
I'm using the nightly build of 19/december/2005
Thanks.
*
Thomas Spiegl wrote:
I testet it a few hours ago and had no java script errors, can you
download a copy from svn and build a release?
On 12/19/05, *Dudu* < [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
Hmmmmmm
Then there are this bug really? the yesterday version?
Martin Marinschek wrote:
> Thomas just got this finished 2hours ago. So he actually meant the
> nightly build of today, not the one of yesterday ;)
>
> regards,
>
> Martin
>
> On 12/19/05, Dudu <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
>
>> Thomas.
>> he works almost well
>> I only replaced de libs with the nightly builded files.....
>> but now, when I click in a navigationMenuItem on menu, is not
submited
>> anything, the page do nothing....
>>
>> * <af:subform>
>> <x:jscookMenu layout="hbr" theme="ThemeOffice"
>>
>> styleLocation="jscookmenu/ThemeOffice"
>>
javascriptLocation="jscookmenu/ThemeOffice/"
>>
binding="#{backing_sag_index.jscookMenu1}"
>> id="jscookMenu1">
>> <x:navigationMenuItems
>> binding="#{backing_sag_index.navigationMenuItems1}"
>>
>> id="navigationMenuItems1"
>>
value="#{backing_sag_index.menu}"/>
>> </x:jscookMenu>
>> </af:subform>
>>
>>
>>
>> and the all javascript generated are like this...
>> *
>>
>> _cmSplit,[null, 'Rotas', 'id3__id5_jscookMenu1_menu:action',
'_id3', null],
>> [null, 'Fretes', 'id3__id5_jscookMenu1_menu:action', '_id3', null],
>> _cmSplit,[null, 'Transportes',
'id3__id5_jscookMenu1_menu:action', '_id3', null],
>> [null, 'Unidades', 'id3__id5_jscookMenu1_menu:action', '_id3',
null],
>> _cmSplit,[null, 'Seção', 'id3__id5_jscookMenu1_menu:action',
'_id3', null],
>> [null, 'Aplicações', 'id3__id5_jscookMenu1_menu:action',
'_id3', null],
>> [null, 'Causas', 'id3__id5_jscookMenu1_menu:action', '_id3',
null],
>> [null, 'Laboratórios', 'id3__id5_jscookMenu1_menu:action',
'_id3', null],
>> [null, 'Atividades', 'id3__id5_jscookMenu1_menu:action',
'_id3', null]],
>>
>> *I'm using the build of 18 december.*
>>
>> I'm thinking it is a bug..
>> Thanks
>>
>> Thomas Spiegl 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="go_home"/>
>>> 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]
<mailto:[EMAIL PROTECTED]>
>>> <mailto:[EMAIL PROTECTED]
<mailto:[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]
<mailto:[EMAIL PROTECTED]>
>>> <mailto: [EMAIL PROTECTED]
<mailto:[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]>
>>> <mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>>
>>> > <mailto: [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
>>> <mailto:[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]>>
>>> > <mailto: [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
>>> <mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>>>
>>> > > <mailto: [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
>>> <mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>>
>>> > <mailto: [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://br.yahoo.com/homepageset.html
<http://br.yahoo.com/homepageset.html>>
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > http://www.irian.at <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
>>>
------------------------------------------------------------------------
>>>
>>>
------------------------------------------------------------------------
>>>
>>> /*
>>> * Copyright 2004 The Apache Software Foundation.
>>> *
>>> * Licensed under the Apache License, Version 2.0 (the "License");
>>> * you may not use this file except in compliance with the
License.
>>> * You may obtain a copy of the License at
>>> *
>>> * http://www.apache.org/licenses/LICENSE-2.0
>>> *
>>> * Unless required by applicable law or agreed to in writing,
software
>>> * distributed under the License is distributed on an "AS IS"
BASIS,
>>> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied.
>>> * See the License for the specific language governing
permissions and
>>> * limitations under the License.
>>> */
>>> package org.apache.myfaces.examples.misc;
>>>
>>> import org.apache.commons.logging.Log;
>>> import org.apache.commons.logging.LogFactory;
>>> import org.apache.myfaces.custom.navmenu.NavigationMenuItem;
>>> import
org.apache.myfaces.custom.navmenu.jscookmenu.HtmlCommandJSCookMenu ;
>>>
>>> import javax.faces.event.ActionEvent;
>>> import java.util.ArrayList;
>>> import java.util.List;
>>>
>>> /**
>>> * @author Thomas Spiegl
>>> */
>>> public class JSCookMenuBean {
>>> private static final Log log =
LogFactory.getLog(JSCookMenuBean.class);
>>>
>>> public List getJSCookMenuNavigationItems()
>>> {
>>> List menu = new ArrayList();
>>> menu.add(getMenuNaviagtionItem("Home", "go_home"));
>>> return menu;
>>> }
>>>
>>> private static NavigationMenuItem
getMenuNaviagtionItem(String label, String action)
>>> {
>>> NavigationMenuItem item = new
NavigationMenuItem(label, action);
>>>
item.setActionListener("#{navigationMenu.actionListener}");
>>> item.setValue(label);
>>> return item;
>>> }
>>>
>>> public String actionListener(ActionEvent event)
>>> {
>>> String outcome = (String)((HtmlCommandJSCookMenu)
event.getComponent()).getValue();
>>> log.info("ActionListener: " + outcome);
>>> return outcome;
>>> }
>>> }
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>> _______________________________________________________
>> 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
_______________________________________________________
Yahoo! doce lar. Faça do Yahoo! sua homepage.
http://br.yahoo.com/homepageset.html