Return-Path: X-Original-To: apmail-myfaces-dev-archive@www.apache.org Delivered-To: apmail-myfaces-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 7B1F3DDD9 for ; Fri, 21 Dec 2012 15:51:13 +0000 (UTC) Received: (qmail 56431 invoked by uid 500); 21 Dec 2012 15:51:13 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 56389 invoked by uid 500); 21 Dec 2012 15:51:13 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 56365 invoked by uid 99); 21 Dec 2012 15:51:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Dec 2012 15:51:12 +0000 Date: Fri, 21 Dec 2012 15:51:12 +0000 (UTC) From: "Leonardo Uribe (JIRA)" To: dev@myfaces.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MYFACES-3659) Conditional include of scripts and stylesheets MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MYFACES-3659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13538156#comment-13538156 ] Leonardo Uribe commented on MYFACES-3659: ----------------------------------------- Please note I'm working in trunk, so the check is already part of MYFACES-3665. I see the diff was done from a previous version so in that version it is valid. I committed the patch, but I'll keep this open, because we need a junit test case for this one before close it. UIViewRoot.JAVAX_FACES_LOCATION_PREFIX is a private constant, and we cannot change it to public without break binary compatibility, so I moved the constant to FaceletCompositionContextImpl. DH >> Why is there in MyFaces always the old iterator style used instead of the for-each-loop? No special reason, both ways work in this part, I just copied the code from finalizeForDeletion(UIComponent). > Conditional include of scripts and stylesheets > ----------------------------------------------- > > Key: MYFACES-3659 > URL: https://issues.apache.org/jira/browse/MYFACES-3659 > Project: MyFaces Core > Issue Type: Bug > Affects Versions: 2.1.6 > Environment: MyFaces 2.1.6, Tomahawk20 1.1.11 > Reporter: dennis hoersch > Attachments: MYFACES-3659_2.diff, MYFACES-3659_2.zip, MYFACES-3659_3.diff, MYFACES-3659-3.patch, MYFACES-3659-4.patch, patch-MYFACES-3659.diff, patch-MYFACES-3659.zip > > > I am inserting a script 'X.js' dependent on a condition (c:if). The default case is to include it. If I change the underlying value within an action so that the condition evaluates to false, the script is still included. Also after any other following action. > Using F5 in Firefox the page is now rendered without the script. > The script 'X.js' was added to the view root and is never 'forgot' or removed. It is the same if the script is included in a composite component. In that case I even observed that the order of the scripts changes and the script 'X.js' is included before other basic scripts like jQuery on which 'X.js' depends. > ---- > > > > rendered="#{empty sessionScope.__isActive_ or sessionScope.__isActive_}"> > > > rendered="#{not empty sessionScope.__isActive_ and not sessionScope.__isActive_}"> > > > > > > > > > BLA > > > > ---- > Am I doing something wrong? Is there another (or better) way to include scripts conditionally? > ( > If I change 'HtmlOutputScriptHandler' to set the script transient, it works in the first glance, but I don't know the impact... > @Override > public void onComponentPopulated(FaceletContext ctx, UIComponent c, UIComponent parent) { > super.onComponentPopulated(ctx, c, parent); > c.setTransient(true); > } > ) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira