Hi, I've got problem with following nested FormFragments. When I trigger
"hide" event for the inner form fragment the outer fragment hides too. 


<t:form>
 <t:checkBox t:id="outerCheckBox" value="outerValue"
t:mixins="triggerfragment" fragment="outerFragment"/>

 <t:formFragment t:id="outerFragment" show="showOuter" hide="hideOuter"
visible="outerVisible">

    Outer content

    <t:checkBox t:id="innerCheckBox" value="innerValue"
t:mixins="triggerfragment" fragment="innerFragment"/>

    <t:formFragment t:id="innerFragment" show="showInner" hide="hideInner"
visible="innerVisible">
      Inner content
    </t:formFragment>

  </t:formFragment>
</t:form>


After a short research I've found a piece of Tapestry.js that is responsible
for such behaviour:


  linkTriggerToFormFragment : function(spec) {
        var trigger = $(spec.triggerId);

        var update = function() {
            var checked = trigger.checked;
            var makeVisible = checked == !spec.invert;

            $(spec.fragmentId).fire(Tapestry.CHANGE_VISIBILITY_EVENT, {
                visible : makeVisible
            }, true);
        }
        
         /* Let the event bubble up to the form level. */
        if (trigger.type == "radio") {
            $(trigger.form).observe("click", update);
            return;
        }

        /* Normal trigger is a checkbox; listen just to it. */
        trigger.observe("click", update);
   }


Every Tapestry.CHANGE_VISIBILITY_EVENT is fired with "bubble" property set
to true, so it bubbles up the components tree, in this particular example
"hide" event is catched and processed both on innerFragment and
outerFragment level. Is this appropriate? How can I handle nested form
fragments?




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Problem-with-nested-FormFragment-TAP-5-2-5-tp4403488p4403488.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to