You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Ilya Obshadko (Jira)" <ji...@apache.org> on 2020/02/25 09:35:00 UTC

[jira] [Commented] (TAP5-2604) FormFragment's renableInputFields does not consider nested FormFragments

    [ https://issues.apache.org/jira/browse/TAP5-2604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17044287#comment-17044287 ] 

Ilya Obshadko commented on TAP5-2604:
-------------------------------------

+1 here, FormFragment visibility change should propagate to descendant fragments only when disabling; enabling a fragment should not touch nested fragments at all.

> FormFragment's renableInputFields does not consider nested FormFragments
> ------------------------------------------------------------------------
>
>                 Key: TAP5-2604
>                 URL: https://issues.apache.org/jira/browse/TAP5-2604
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.4.4
>            Reporter: Willem van Duijn
>            Priority: Major
>              Labels: FormFragment
>
> I have nested FormFragments, all 'hidden' on initial page load.
> When the outer FormFragment is made visible in the browser (using a TriggerFragment mixin) the form-fragment.js Javascript code (renableInputFields function) targets all contained input fields and unsets the 'disabled' property, hence they will be sent to the server upon submit.
> However, it also does so for the hidden (t:formdata) input-field of nested FormFragments, which triggers validation of FormFragments that are hidden in the browser, resulting in error messages for invisible validate=required-fields. It should only do this for input elements not under control of a nested FormFragment. 
> The same applies to disableInputFields, although that one now works because if the outer FormFragment becomes hidden all nested ones should be made hidden too.
> Either this behaviour should be fixed, or nested FormFragments should not be allowed.
> In addition, the FormFragment only cares about 'input' fields; textarea's should also be considered.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)