Tapestry
  1. Tapestry
  2. TAPESTRY-2261

TriggerFragment mixin should work with Radio as well as Checkbox components

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.11
    • Fix Version/s: 5.0.12
    • Component/s: None
    • Labels:
      None

      Description

      Currently, it sees the radio being selected, but when a different radio is clicked, it doesn't hide the associated form fragment.

        Activity

        Howard M. Lewis Ship created issue -
        Hide
        Howard M. Lewis Ship added a comment -

        The issue is that you can observe the client-side "change" event, but that seems to only trigger when the Radio is selected; when it is de-selected (because a different radio was selected) there is no event, so you end up with both form fragments, when they should be exclusive.

        Show
        Howard M. Lewis Ship added a comment - The issue is that you can observe the client-side "change" event, but that seems to only trigger when the Radio is selected; when it is de-selected (because a different radio was selected) there is no event, so you end up with both form fragments, when they should be exclusive.
        Hide
        Howard M. Lewis Ship added a comment -

        Not the only ones who've hit this nasty:

        http://dev.rubyonrails.org/ticket/7895

        Show
        Howard M. Lewis Ship added a comment - Not the only ones who've hit this nasty: http://dev.rubyonrails.org/ticket/7895
        Hide
        Howard M. Lewis Ship added a comment -

        Here's a hack I'm using for a client:

        radioTriggerHack : function(radio, element)
        {
        var radio = $(radio);

        $(radio.form).observe("change", function() {

        var elem = $(element)

        if (! radio.checked && elem.visible())

        { elem.formFragment.hide(); }

        });
        }

        Basically, observe every change throughout the containing form, and use that as an opportunity to check to see if the element is visible but shouldn't be.

        This kind of thing could be integrated into tapestry.js, i.e., the FormFragment object could add this additional listener if the triggering object's type is "radio" (not "checkbox").

        Show
        Howard M. Lewis Ship added a comment - Here's a hack I'm using for a client: radioTriggerHack : function(radio, element) { var radio = $(radio); $(radio.form).observe("change", function() { var elem = $(element) if (! radio.checked && elem.visible()) { elem.formFragment.hide(); } }); } Basically, observe every change throughout the containing form, and use that as an opportunity to check to see if the element is visible but shouldn't be. This kind of thing could be integrated into tapestry.js, i.e., the FormFragment object could add this additional listener if the triggering object's type is "radio" (not "checkbox").
        Howard M. Lewis Ship made changes -
        Field Original Value New Value
        Status Open [ 1 ] In Progress [ 3 ]
        Howard M. Lewis Ship made changes -
        Fix Version/s 5.0.12 [ 12313048 ]
        Resolution Fixed [ 1 ]
        Status In Progress [ 3 ] Closed [ 6 ]
        Mark Thomas made changes -
        Workflow jira [ 12426531 ] Default workflow, editable Closed status [ 12568150 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12568150 ] jira [ 12591238 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        4d 17h 54m 1 Howard M. Lewis Ship 19/Mar/08 15:24
        In Progress In Progress Closed Closed
        1h 13m 1 Howard M. Lewis Ship 19/Mar/08 16:38

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Howard M. Lewis Ship
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development