Grails
  1. Grails
  2. GRAILS-8494

g:select taglib should allow the creation of disabled select options

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4-M2
    • Component/s: TagLib
    • Labels:
      None

      Description

      It would be nice to have a optionDisabled attribute with takes a Closure. If the closure evaluates to true then it should add the disabled attribute to the option that is rendered.

        Activity

        Hide
        Sandeep Samdaria added a comment - - edited

        I have attached a file patch which takes optionDisabled as an attribute.
        A closure can be passed to the optionDisabled and if the closure returns true,then it will be disabled.However,if the key is already "selected",then it won't be disabled.
        The patch needs to be applied on FormTagLib.groovy.
        I am new to the grails community. If you can guide me on what formal approach should I take to make the changes to the code.

        Show
        Sandeep Samdaria added a comment - - edited I have attached a file patch which takes optionDisabled as an attribute. A closure can be passed to the optionDisabled and if the closure returns true,then it will be disabled.However,if the key is already "selected",then it won't be disabled. The patch needs to be applied on FormTagLib.groovy. I am new to the grails community. If you can guide me on what formal approach should I take to make the changes to the code.
        Hide
        Sandeep Samdaria added a comment -

        Attaching the git patch created by STS.

        Show
        Sandeep Samdaria added a comment - Attaching the git patch created by STS.
        Hide
        Graeme Rocher added a comment -

        Thanks for the contribution!

        Show
        Graeme Rocher added a comment - Thanks for the contribution!

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Jon Palmer
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Last Reviewed:

              Development