You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2007/07/26 19:35:15 UTC

svn commit: r559897 - in /myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets: ScriptHandler.java StyleHandler.java

Author: bommel
Date: Thu Jul 26 10:35:14 2007
New Revision: 559897

URL: http://svn.apache.org/viewvc?view=rev&rev=559897
Log:
(TOBAGO-425) <tc:style> & <tc:script> is not loaded if clicking on a <tc:link> with actionListener

Modified:
    myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/ScriptHandler.java
    myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/StyleHandler.java

Modified: myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/ScriptHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/ScriptHandler.java?view=diff&rev=559897&r1=559896&r2=559897
==============================================================================
--- myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/ScriptHandler.java (original)
+++ myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/ScriptHandler.java Thu Jul 26 10:35:14 2007
@@ -57,31 +57,29 @@
       throws IOException, FacesException, ELException {
 
     if (parent instanceof UIPage) {
-      if (ComponentSupport.isNew(parent)) {
-        UIPage page = (UIPage) parent;
-        if (file != null) {
-          page.getScriptFiles().add(file.getValue(faceletContext));
-        }
-        if (onload != null) {
-          page.getOnloadScripts().add(onload.getValue(faceletContext));
-        }
-        if (onunload != null) {
-          page.getOnunloadScripts().add(onunload.getValue(faceletContext));
-        }
-        if (onexit != null) {
-          page.getOnexitScripts().add(onexit.getValue(faceletContext));
-        }
-        StringBuffer buffer = new StringBuffer();
-        Iterator iter = findNextByType(TextHandler.class);
-        while (iter.hasNext()) {
-          TextHandler text = (TextHandler) iter.next();
-          buffer.append(text.getText(faceletContext));
-        }
-        String content = buffer.toString().trim();
+      UIPage page = (UIPage) parent;
+      if (file != null) {
+        page.getScriptFiles().add(file.getValue(faceletContext));
+      }
+      if (onload != null) {
+        page.getOnloadScripts().add(onload.getValue(faceletContext));
+      }
+      if (onunload != null) {
+        page.getOnunloadScripts().add(onunload.getValue(faceletContext));
+      }
+      if (onexit != null) {
+        page.getOnexitScripts().add(onexit.getValue(faceletContext));
+      }
+      StringBuffer buffer = new StringBuffer();
+      Iterator iter = findNextByType(TextHandler.class);
+      while (iter.hasNext()) {
+        TextHandler text = (TextHandler) iter.next();
+        buffer.append(text.getText(faceletContext));
+      }
+      String content = buffer.toString().trim();
 
-        if (content.length() > 0) {
-          page.getScriptBlocks().add(content);
-        }
+      if (content.length() > 0) {
+        page.getScriptBlocks().add(content);
       }
     } else {
       throw new TagException(tag, "Parent is not of type UIPage, type is: " + parent);

Modified: myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/StyleHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/StyleHandler.java?view=diff&rev=559897&r1=559896&r2=559897
==============================================================================
--- myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/StyleHandler.java (original)
+++ myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/StyleHandler.java Thu Jul 26 10:35:14 2007
@@ -51,22 +51,20 @@
       throws IOException, FacesException, ELException {
 
     if (parent instanceof UIPage) {
-      if (ComponentSupport.isNew(parent)) {
-        UIPage page = (UIPage) parent;
-        if (style != null) {
-          page.getStyleFiles().add(style.getValue(faceletContext));
-        }
-        StringBuffer buffer = new StringBuffer();
-        Iterator iter = findNextByType(TextHandler.class);
-        while (iter.hasNext()) {
-          TextHandler text = (TextHandler) iter.next();
-          buffer.append(text.getText(faceletContext));
-        }
-        String content = buffer.toString().trim();
+      UIPage page = (UIPage) parent;
+      if (style != null) {
+        page.getStyleFiles().add(style.getValue(faceletContext));
+      }
+      StringBuffer buffer = new StringBuffer();
+      Iterator iter = findNextByType(TextHandler.class);
+      while (iter.hasNext()) {
+        TextHandler text = (TextHandler) iter.next();
+        buffer.append(text.getText(faceletContext));
+      }
+      String content = buffer.toString().trim();
 
-        if (content.length() > 0) {
-          page.getStyleBlocks().add(content);
-        }
+      if (content.length() > 0) {
+        page.getStyleBlocks().add(content);
       }
     } else {
       throw new TagException(tag, "Parent is not of type UIPage, type is: " + parent);