Hi Thomas,

Oh yes.. clever.. that’s  an other way, it add more independency, thanks for the tip, I shall modify my code to give it a try.

By the way I define the complete menus in a XML file and, out from there, I construct the complete Menu(s) dynamically.

Doing so allows modifying the menu any time without having to touch my code and navigation rules.

With the new feature of the ActionListener I can then, based on the menu-node and user access level, decide about the navigation, etc. to perform.

 

If some other fellow developers are interested in more details, please feel free to post for (the old way I’ve done it, but the modif as suggested by Thomas are easy to apply).

 

JAVAPOLIS

N.B. from 12-16. DEC the Javapolis will be held in Antwerp (http://wiki.javapolis.com/confluence/display/JP05/Home).

I would like to ask if some developers or users of MyFaces, participating to the conference, would be glad to meet each other for exchange of hints and tips, etc.

Might be one who has already participated the last years has an idea, till now I was always at the JavaOne in SFO and there the breakfast was a good opportunity to meet before the sessions started. You know, in the evening developers are busy as they participates to the BOF’s.

 

Any interest or suggestions!

 

I wish all a nice weekend!

 

Cheers

Roland

 


From: Thomas Spiegl [mailto:[EMAIL PROTECTED]
Sent: Freitag, 25. November 2005 00:55
To: MyFaces Discussion; [EMAIL PROTECTED]
Subject: Re: Usage of PanelNavigation2

 

Roland,

you can now set the value for your NavigationMenuItem(s)

        NavigationMenuItem item = new NavigationMenuItem(label, action);
        item.setActionListener("#{navigationMenu.actionListener}");
        item.setValue(label);

you can access this value in your ActionListener:

    public String actionListener(ActionEvent event)
    {
        log.info("ActionListener: " +((HtmlCommandNavigationItem)event.getComponent()).getValue());
        return getAction1();
    }

So you do not need to rely on the menu node indexing.

Cheers
Thomas

On 11/11/05, Thomas Spiegl <[EMAIL PROTECTED]> wrote:

Thanks for testing! I will not touch the index strings, promised.

Cheers
Thomas

On 11/11/05, Roland Oertig <[EMAIL PROTECTED]> wrote:
>
> Thanks Thomas, it works perfectly.
>
> I have only one wish. Please keep the menu node indexing (zero base) and
> index string you return as it is now, because, you know, I and for sure
> others, defined or will define a split pattern to extract the node
> information based on the actual string content.
>
> You must a great weekend!
> Cheers
> Roland.
>
>
> -----Original Message-----
> From: Thomas Spiegl [mailto: [EMAIL PROTECTED]]
> Sent: Mittwoch, 9. November 2005 21:39
> To: MyFaces Discussion; [EMAIL PROTECTED]
> Subject: Re: Usage of PanelNavigation2
>
> You can use the NavigationMenuItems.setActionListener to add an
> ActionListener to your NavigationMenuItems You will need to checkout
> the current version of MyFaces to get this feature.
> eg. navigationItem.setActionListener("#{yourBean.actionListener}");
>
> YourBean
> ...
>  public String actionListener(ActionEvent event)
> ...
>
> regards
> Thomas
>
> On 11/4/05, Alberto Molpeceres <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > We are using PanelNavigation2 to show a menu of actions. We have
> > populated the menu and works pretty well. It gets rendered and it
> > calls backing bean methods as expected. But since we create this menu
> > dinamically in a backing bean, we can't define a diferent outcome for
> > each menu entry in faces-config.xml.
> >
> > So, how can we know in the destination JSP which option has been
> > selected?. Can we pass any kind of parameter to the NavigationMenuItem
> > and retrieve it in the method given as "action" parameter?.
> >
> > Thank you very much for your attention,
> >
> >   al.
> >
>
>
> --
> 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




--
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