UI Plugin

Add Grails UI tag for YUI Menu

Details

  • Type: New Feature New Feature
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0
  • Fix Version/s: 1.1
  • Component/s: None
  • Labels:
    None
  • Patch Submitted:
    Yes

Description

support for YUI menu

some other notes:

  • for easy to run, the example gsp doesn't depend on the YUI and Bubble plugin, it uses hosted YUI files directly
  • allowed attributes are defined in static final variables and it is checked in development mode. so, in development, if unsupported attributes are used, developers are will be alerted. This usage is subject to review.

remarks:

  • the patch require GRAILSPLUGINS-599
  1. MenuTagLib.groovy
    20/Nov/08 7:04 AM
    10 kB
    Mingfai Ma
  2. topnavfromjswithanim.gsp
    05/Nov/08 8:52 AM
    10 kB
    Mingfai Ma
  1. GRAILSPLUGINS-600_demo.png
    28 kB
    07/Nov/08 9:05 AM

Activity

Hide
Mingfai Ma added a comment -

updated

Show
Mingfai Ma added a comment - updated
Hide
Mingfai Ma added a comment -

changed the way to define the 4th submenu as demonstration

Show
Mingfai Ma added a comment - changed the way to define the 4th submenu as demonstration
Hide
Mingfai Ma added a comment -

updated MenuTagLib.groovy

Show
Mingfai Ma added a comment - updated MenuTagLib.groovy
Hide
Mingfai Ma added a comment -

screenshot of the provided demo gsp. it's identical to the original YUI example.

To run the demo, just put the taglib to the taglib directory, and drop the gsp at any where in the Grails app

Show
Mingfai Ma added a comment - screenshot of the provided demo gsp. it's identical to the original YUI example. To run the demo, just put the taglib to the taglib directory, and drop the gsp at any where in the Grails app
Hide
Mingfai Ma added a comment -

updated to use the lazy declaration pattern in GRAILSPLUGINS-629. With the not-existed checking, there is no harm to user who has their GRAILSUI declared already

Show
Mingfai Ma added a comment - updated to use the lazy declaration pattern in GRAILSPLUGINS-629. With the not-existed checking, there is no harm to user who has their GRAILSUI declared already
Hide
Mark Fortner added a comment -

It would be useful if there was some way of tying menus and menu items to roles that have been defined in the web.xml file. There' s an implementation of this functionality in Struts-Menu http://struts-menu.sourceforge.net/userguide.html

Show
Mark Fortner added a comment - It would be useful if there was some way of tying menus and menu items to roles that have been defined in the web.xml file. There' s an implementation of this functionality in Struts-Menu http://struts-menu.sourceforge.net/userguide.html
Hide
Richard Polderman added a comment -

This MenuTagLib.groovy gives a compilation error with grails 1.1 beta 2.

MenuTagLib.groovy: 30: unable to resolve class GrailsUIException

Probably this has something to do with the new plugin location?

Show
Richard Polderman added a comment - This MenuTagLib.groovy gives a compilation error with grails 1.1 beta 2. MenuTagLib.groovy: 30: unable to resolve class GrailsUIException Probably this has something to do with the new plugin location?
Hide
Matthew Taylor added a comment -

So far I have put together a simple menu that can be used as a context menu. The markup to creates looks something like this:

<gui:menu id='myMenu' fixedcenter='true'>
            <gui:menuitem url='http://example.com'>Example</gui:menuitem>
            <!-- Grouped and titled -->
            <gui:menugroup title='Foodstuffs'>
                <gui:menuitem url='http://campbells.com'>Campbell's Soup</gui:menuitem>
                <gui:menuitem url='http://cheetos.com'>Cheetos</gui:menuitem>
                <gui:menuitem url='http://guiness.com'>Guiness</gui:menuitem>
            </gui:menugroup>
            <!-- Grouped, no title -->
            <gui:menugroup>
                <gui:menuitem url='http://nike.com'>Nike</gui:menuitem>
                <gui:menuitem url='http://reebok.com'>Reebok</gui:menuitem>
                <gui:menuitem url='http://adidas.com'>Adidas</gui:menuitem>
            </gui:menugroup>
            <!-- Submenu -->
            <gui:submenu id="outerSubmenu" label="Search Engines">
                <gui:menuitem url='http://yahoo.com'>Yahoo</gui:menuitem>
                <gui:submenu id="innerSubmenu" label='Google Search Results'>
                    <gui:menuitem url='http://google.com/search?q=yahoo'>Google on Yahoo</gui:menuitem>
                    <gui:menuitem url='http://google.com/search?q=msn'>Google on MSN</gui:menuitem>
                    <gui:menuitem url='http://google.com/search?q=google'>Google on Google</gui:menuitem>
                </gui:submenu>
                <gui:menuitem url='http://msn.com'>MSN</gui:menuitem>
            </gui:submenu>
        </gui:menu>

This will be committed in a few minutes. Then I'm going to be working on the menubar. Hopefully I can keep the markup very similar for the menubar, but it seems to have more of a javascript config. We'll see .

Show
Matthew Taylor added a comment - So far I have put together a simple menu that can be used as a context menu. The markup to creates looks something like this:
<gui:menu id='myMenu' fixedcenter='true'>
            <gui:menuitem url='http://example.com'>Example</gui:menuitem>
            <!-- Grouped and titled -->
            <gui:menugroup title='Foodstuffs'>
                <gui:menuitem url='http://campbells.com'>Campbell's Soup</gui:menuitem>
                <gui:menuitem url='http://cheetos.com'>Cheetos</gui:menuitem>
                <gui:menuitem url='http://guiness.com'>Guiness</gui:menuitem>
            </gui:menugroup>
            <!-- Grouped, no title -->
            <gui:menugroup>
                <gui:menuitem url='http://nike.com'>Nike</gui:menuitem>
                <gui:menuitem url='http://reebok.com'>Reebok</gui:menuitem>
                <gui:menuitem url='http://adidas.com'>Adidas</gui:menuitem>
            </gui:menugroup>
            <!-- Submenu -->
            <gui:submenu id="outerSubmenu" label="Search Engines">
                <gui:menuitem url='http://yahoo.com'>Yahoo</gui:menuitem>
                <gui:submenu id="innerSubmenu" label='Google Search Results'>
                    <gui:menuitem url='http://google.com/search?q=yahoo'>Google on Yahoo</gui:menuitem>
                    <gui:menuitem url='http://google.com/search?q=msn'>Google on MSN</gui:menuitem>
                    <gui:menuitem url='http://google.com/search?q=google'>Google on Google</gui:menuitem>
                </gui:submenu>
                <gui:menuitem url='http://msn.com'>MSN</gui:menuitem>
            </gui:submenu>
        </gui:menu>
This will be committed in a few minutes. Then I'm going to be working on the menubar. Hopefully I can keep the markup very similar for the menubar, but it seems to have more of a javascript config. We'll see .
Hide
Matthew Taylor added a comment -

Menubar is implemented, with almost exactly the same markup as a menu:

<gui:menubar id='myMenubar'>
        <gui:menuitem url='http://example.com'>Example</gui:menuitem>
        <gui:submenu label='Foodstuffs'>
            <gui:menuitem url='http://campbells.com'>Campbell's Soup</gui:menuitem>
            <gui:menuitem url='http://cheetos.com'>Cheetos</gui:menuitem>
            <gui:menuitem url='http://guiness.com'>Guiness</gui:menuitem>
        </gui:submenu>
        <gui:submenu label='Shoes'>
            <gui:menuitem url='http://nike.com'>Nike</gui:menuitem>
            <gui:menuitem url='http://reebok.com'>Reebok</gui:menuitem>
            <gui:menuitem url='http://adidas.com'>Adidas</gui:menuitem>
        </gui:submenu>
        <gui:submenu id="outerSubmenu" label="Search Engines">
            <gui:menuitem url='http://yahoo.com'>Yahoo</gui:menuitem>
            <gui:submenu id="innerSubmenu" label='Google Search Results'>
                <gui:menuitem url='http://google.com/search?q=yahoo'>Google on Yahoo</gui:menuitem>
                <gui:menuitem url='http://google.com/search?q=msn'>Google on MSN</gui:menuitem>
                <gui:menuitem url='http://google.com/search?q=google'>Google on Google</gui:menuitem>
            </gui:submenu>
            <gui:menuitem url='http://msn.com'>MSN</gui:menuitem>
        </gui:submenu>
    </gui:menubar>

There are currently a few outlying issues:

GRAILSPLUGINS-799
GRAILSPLUGINS-800
GRAILSPLUGINS-801

But I wanted to get this committed and resolved for review.

Show
Matthew Taylor added a comment - Menubar is implemented, with almost exactly the same markup as a menu:
<gui:menubar id='myMenubar'>
        <gui:menuitem url='http://example.com'>Example</gui:menuitem>
        <gui:submenu label='Foodstuffs'>
            <gui:menuitem url='http://campbells.com'>Campbell's Soup</gui:menuitem>
            <gui:menuitem url='http://cheetos.com'>Cheetos</gui:menuitem>
            <gui:menuitem url='http://guiness.com'>Guiness</gui:menuitem>
        </gui:submenu>
        <gui:submenu label='Shoes'>
            <gui:menuitem url='http://nike.com'>Nike</gui:menuitem>
            <gui:menuitem url='http://reebok.com'>Reebok</gui:menuitem>
            <gui:menuitem url='http://adidas.com'>Adidas</gui:menuitem>
        </gui:submenu>
        <gui:submenu id="outerSubmenu" label="Search Engines">
            <gui:menuitem url='http://yahoo.com'>Yahoo</gui:menuitem>
            <gui:submenu id="innerSubmenu" label='Google Search Results'>
                <gui:menuitem url='http://google.com/search?q=yahoo'>Google on Yahoo</gui:menuitem>
                <gui:menuitem url='http://google.com/search?q=msn'>Google on MSN</gui:menuitem>
                <gui:menuitem url='http://google.com/search?q=google'>Google on Google</gui:menuitem>
            </gui:submenu>
            <gui:menuitem url='http://msn.com'>MSN</gui:menuitem>
        </gui:submenu>
    </gui:menubar>
There are currently a few outlying issues: GRAILSPLUGINS-799 GRAILSPLUGINS-800 GRAILSPLUGINS-801 But I wanted to get this committed and resolved for review.

People

Vote (6)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: