Menu

#1 A new property for additional info

open
nobody
3
2006-04-07
2006-03-09
Anonymous
No

Hello:

First at all I wanna congratulate you for the great
Tap4 component. I 'll use it but I need a property that
can be save a value different to the value parameter
that already exists, to use for example to get a code
that let me establish if the menuitem should be visible
or not. Or better yet, that exists a boolean property
that compare automagically this property with a value
into POJO from server side to determine if the menuitem
will be visible or not.

Another thing is if the menuitem can be rendered as
disabled, sometimes isn´t necessary to hide, only
disable or enabled when some conditions are present.

Thanks for your time.

JQ

Discussion

  • perseios

    perseios - 2006-03-10

    Logged In: YES
    user_id=1415677

    Hi,
    Thanks for the ideas,

    If you subclass BasicJSCookMenuItem (or implement
    IJSCookMenu), you can add any property to the model you like.
    This may be a disabled-boolean or something else.
    These values can then be retrieved by OGNL or in the render
    methods of the IMenuItemRenderer to change some rendering.
    So you could disable your links using the disabled-property
    of the DirectLink that renders the navigation-link. Or
    alternatively render it with another color using another
    component to render the disabled items.

    Ok, this is no true disablement, since the 'disabled' items
    will still be highlighted at mouseover.

    Basically this reduces to the fact, that the original
    JavaScript library does highlight all items, having or not a
    URL.
    So, the best solution would be to make the JavaScript author
    add a disabled property to his item-definitions and this
    component just wrap it.
    If I change it in the JS, this causes problems, if the
    author later changes the library.

    Have to think about it a bit ;)

     
  • perseios

    perseios - 2006-04-07
    • priority: 5 --> 3
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.