Return-Path: X-Original-To: apmail-tapestry-dev-archive@www.apache.org Delivered-To: apmail-tapestry-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BC6274796 for ; Sat, 25 Jun 2011 23:32:12 +0000 (UTC) Received: (qmail 87602 invoked by uid 500); 25 Jun 2011 23:32:12 -0000 Delivered-To: apmail-tapestry-dev-archive@tapestry.apache.org Received: (qmail 87446 invoked by uid 500); 25 Jun 2011 23:32:11 -0000 Mailing-List: contact commits-help@tapestry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tapestry.apache.org Delivered-To: mailing list commits@tapestry.apache.org Received: (qmail 87439 invoked by uid 99); 25 Jun 2011 23:32:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Jun 2011 23:32:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Jun 2011 23:32:08 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 892DE430946 for ; Sat, 25 Jun 2011 23:31:47 +0000 (UTC) Date: Sat, 25 Jun 2011 23:31:47 +0000 (UTC) From: "Robert Zeigler (JIRA)" To: commits@tapestry.apache.org Message-ID: <1382377619.40900.1309044707557.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (TAP5-1558) FormFragment should allow more fine grained control over when to be considered "invisible" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org FormFragment should allow more fine grained control over when to be considered "invisible" ------------------------------------------------------------------------------------------ Key: TAP5-1558 URL: https://issues.apache.org/jira/browse/TAP5-1558 Project: Tapestry 5 Issue Type: Improvement Components: tapestry-core Affects Versions: 5.3.0 Reporter: Robert Zeigler Priority: Minor The 5.2 line of Tapestry introduced the "alwaysSubmit" parameter to form fragment. This is nice because it allows the fragment to be submitted even if hidden. However, it doesn't cover all use cases. Consider a situation like:
...
...
User reveals tab 1, then reveals the form fragment on tab1 and makes changes. Now user reveals tab2. Note that the fragment on tab1 is still revealed in the context of tab1, but the entire tab1 is hidden. There is currently no way to make it so that "submit" will submit the information from the formfragment in both tabs and behave correctly in all situations. I will enumerate. Some definitions for clarity: fragmentX is the fragment on tabX. fragmentX visibility refers to the state of the actual fragment, rather than the state of the containing tab. So if fragment1 is visible, it means it's visible when tab1 is active... and I am considering it visible when tab2 is active, even though the entire tab1 is invisible. 1) If "alwaysSubmit" is false and fragment1 is invisible, you will get the correct behavior regardless of tab1/tab2 visibility 2) If "alwaysSubmit" is false and fragment1 is visible, you will get the correct behavior iff tab1 is active. If tab2 is active, fragment1's fields will not be submitted. 3) If "alwaysSubmit" is true and fragment1 is invisible, you will get incorrect behavior (well, technically, it's "correct": the information will be submitted, as per alwaysSubmit, but this is a case where you don't actually /want/ the information submitted if the fragment isn't visible) 4) If "alwaysSubmit" is true and fragment is visible, you will get correct behavior. You can conditionally "alwaysSubmit": alwaysSubmit on the same condition for visibility as the "visible" trigger. The problem here comes in the following scenario: User opens a page with fragment1 initially visible, but no data yet in the required field. User marks fragment1 as invisible. User submits the form. The submission will fail because "alwaysSubmit" was true at the time the form rendered. The culprit behind this is Tapestry's "isDeepVisible" method. It searches for visibility up to the point where it finds a form element. But in the case above, the form element contains the tab divs, so the fragment is determined to be invisible and the data not submitted for the inactive tab, even if the user clicked on the trigger to make the fragment visible while the tab was active. This is something of an edge case, but I think it can be handled cleanly by introducing a new parameter to formfragment, such as "visiblebound" (but better named!). The idea is to allow developers to specify an element or selector expression that bounds the search for visibility. The default would be the containing form element which would preserve the current behavior. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira