Custom UIViewRoot
Hi all, I implemented a custom UIViewRoot because I need to override the encodeBegin and encodeEnd methods. Unfortunately my methods never get called!? I declared my UIViewRoot class in faces-config as new component: component component-typejavax.faces.ViewRoot/component-type component-classtest.TestUIViewRoot/component-class /component The class: public class TestUIViewRoot extends UIViewRoot { public TestUIViewRoot() { super(); } public void encodeBegin(FacesContext context) throws IOException { //do some stuff super.encodeBegin(context); } public void encodeEnd(FacesContext context) throws IOException { //do some stuff super.encodeEnd(context); } ... } What I'm doing wrong? THANX! -- View this message in context: http://www.nabble.com/Custom-UIViewRoot-tf4447158.html#a12688634 Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: How do I know My JSF Version?
Hello, Michael. Your JSF version is basically defined by JSF implementation you use in your project. If you use one that ships with RAD7, i guess it would be 1.1. At least, web-facesconfig.dtd version has nothing to do with JSF impl version. If you use myfaces: 1. jar file naming should tell you much enough (myfaces-api-1.1.x.jar for 1.1 and myfaces-api-1.2.x.jar for 1.2). 2. you can always look into jar's META-INF. Most possibly it's contents will shred some light on implementation version used. I believe that something similar applies to RI. MichaelWa wrote: I am using IBM RAD7, when I create a JSF application from RAD, it shows following in faces-config file !DOCTYPE faces-config PUBLIC -//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN http://java.sun.com/dtd/web-facesconfig_1_0.dtd; However I checked with IBM website, it says RAD7 is fully support JSF1.1? Can someone tell me how do I check the version of current JSF? Thanks Michael
deploying demo of trinidad
hi; i am trying to deploy trinidad demo; so i succeed to deploy the version (trinidad-blank-1.0.2.war and trinidad-demo-1.0.2.war) but when i tried to deloy the (trinidad-demo-1.2.2.war) i found many problem like : 2007-09-15 15:29:09,403 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/trinidad-demo-1.2.2]] Exception sending context initialized event to listener instance of class org.apache.myfaces.webapp.StartupServletContextListener java.lang.NoClassDefFoundError: javax/el/ELResolver. thank you. -- View this message in context: http://www.nabble.com/deploying-demo-of-trinidad-tf4447751.html#a12690303 Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: deploying demo of trinidad
Hi. What is the server/version you are trying to deploy 1.2.x demo to? Does it support JSF 1.2 (JSP2.1) ? aj1m wrote: hi; i am trying to deploy trinidad demo; so i succeed to deploy the version (trinidad-blank-1.0.2.war and trinidad-demo-1.0.2.war) but when i tried to deloy the (trinidad-demo-1.2.2.war) i found many problem like : 2007-09-15 15:29:09,403 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/trinidad-demo-1.2.2]] Exception sending context initialized event to listener instance of class org.apache.myfaces.webapp.StartupServletContextListener java.lang.NoClassDefFoundError: javax/el/ELResolver. thank you.
Re: deploying demo of trinidad
i tried many server like tomcat 5 and jboss 4.0.5.GA but i always get error. and i dont know how it can support or not JSF 1.2 (JSP2.1) -- View this message in context: http://www.nabble.com/deploying-demo-of-trinidad-tf4447751.html#a12690521 Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: deploying demo of trinidad
JSF1.2 support was added in tomcat 6. If I'm not mistaken, JBoss = 4.2.0 is tomcat 6 based. So you should try upgrading to at least 4.2 if you want to use JSF 1.2. Hope it helps. aj1m wrote: i tried many server like tomcat 5 and jboss 4.0.5.GA but i always get error. and i dont know how it can support or not JSF 1.2 (JSP2.1)
Re: deploying demo of trinidad
i tried it in tomcat 6. but it didnt work. -- View this message in context: http://www.nabble.com/deploying-demo-of-trinidad-tf4447751.html#a12690629 Sent from the MyFaces - Users mailing list archive at Nabble.com.
RE: [JSF1.2] JspViewHandlerImpl flushing issue (was Re: [Trinidad] tr:table PPR failing)
Not sure if this will work for you. Tried using eclipse to create the patch, but with the way I changed the source it didn't seem to like it very much. Basically I moved lines 321 and 322 so they were after line 336. This way the flush is called after the endDocument method is called. Hope this helps, Tim Index: JspViewHandlerImpl.java === RCS file: /var/cvsroot/org.fv.vbm/src/org/apache/myfaces/application/jsp/JspViewHa ndlerImpl.java,v retrieving revision 1.1 diff -r1.1 JspViewHandlerImpl.java 321,323d320 // response.getWriter().write(stateAwareWriter.parseResponse()); stateAwareWriter.flushToWriter(response.getWriter()); 336a334,337 // response.getWriter().write(stateAwareWriter.parseResponse()); // Timothy M. Braun: Moved here to fix writer flush errors stateAwareWriter.flushToWriter(response.getWriter()); -Original Message- From: Martin Marinschek [mailto:[EMAIL PROTECTED] Sent: Friday, September 14, 2007 11:48 PM To: MyFaces Discussion Subject: Re: [JSF1.2] JspViewHandlerImpl flushing issue (was Re: [Trinidad] tr:table PPR failing) Hi Tim, could you supply a patch versus the new source-code - or somehow else highlight the differences you did? regards, Martin On 9/14/07, Adam Winer [EMAIL PROTECTED] wrote: (Changing subject to bring this to the attention of non-Trinidad folks) Tim, could you file a MYFACES JIRA issue? This looks like an important issue. It also explains why I haven't really seen this - I've done 95% of my testing with the RI, not the MyFaces 1.2 impl. -- Adam On 9/14/07, Timothy M. Braun [EMAIL PROTECTED] wrote: This seems to fix the problem. I moved the flush so it was after the call to the ppr writer endDocument method. Everything works beautifully now. Here is the source for the new JspViewHandlerImpl /* * Copyright 2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.myfaces.application.jsp; import org.apache.commons.logging.Log ; import org.apache.commons.logging.LogFactory; import org.apache.myfaces.application.DefaultViewHandlerSupport; import org.apache.myfaces.application.InvalidViewIdException; import org.apache.myfaces.application.ViewHandlerSupport ; import javax.faces.FacesException; import javax.faces.FactoryFinder; import javax.faces.application.Application; import javax.faces.application.StateManager; import javax.faces.application.ViewHandler ; import javax.faces.component.UIViewRoot; import javax.faces.context.ExternalContext; import javax.faces.context.FacesContext; import javax.faces.context.ResponseWriter; import javax.faces.render.RenderKit ; import javax.faces.render.RenderKitFactory; import javax.faces.render.ResponseStateManager; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest ; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import javax.servlet.jsp.jstl.core.Config; import java.io.IOException; import java.io.StringWriter; import java.io.Writer ; import java.util.Iterator; import java.util.Locale; /** * @author Thomas Spiegl (latest modification by $Author: baranda $) * @author Bruno Aranda * @version $Revision: 542008 $ $Date: 2007-05-27 19:45:19 +0200 (So, 27 Mai 2007) $ */ public class JspViewHandlerImpl extends ViewHandler { private static final Log log = LogFactory.getLog(JspViewHandlerImpl.class); public static final String FORM_STATE_MARKER = !--@@JSF_FORM_STATE_MARKER@@--; public static final int FORM_STATE_MARKER_LEN = FORM_STATE_MARKER.length(); private static final String AFTER_VIEW_TAG_CONTENT_PARAM = JspViewHandlerImpl.class + .AFTER_VIEW_TAG_CONTENT; private ViewHandlerSupport _viewHandlerSupport; public JspViewHandlerImpl() { if (log.isTraceEnabled()) log.trace(New ViewHandler instance created); } /** * @param viewHandlerSupport *the viewHandlerSupport to set */ public void setViewHandlerSupport(ViewHandlerSupport viewHandlerSupport) { _viewHandlerSupport = viewHandlerSupport; } /** * @return the viewHandlerSupport */ protected
Re: deploying demo of trinidad
I have just downloaded JBoss AS 4.2.1 and successfully ran trinidad examples 1.2.1 on it. Should you try the same - don't forget to remove myfaces JSF1.2 from war and accordingly remove startup listener from web.xml. aj1m wrote: i tried it in tomcat 6. but it didnt work.
Re: deploying demo of trinidad
thank u; me too i downloaded (jboss-4.2.1.GA) is it the same. can u try exemple of trinidad 1.2.2 bcuz i couldnt run them . and thank you very much for ur help -- View this message in context: http://www.nabble.com/deploying-demo-of-trinidad-tf4447751.html#a12691458 Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: deploying demo of trinidad
because while trying exemple of trinidad 1.2.2 on jboss 4.2.1 i get this error: ( WARN [org.jboss.web.jsf.integration.config.JBossJSFConfigureListener] MyFaces JSF implementation found! This version of JBoss AS ships with the java.net implementation of JSF. There are known issues when mixing JSF implementations. This warning does not apply to MyFaces component libraries such as Tomahawk. However, myfaces-impl.jar and myfaces-api.jar should not be used without disabling the built-in JSF implementation. See the JBoss wiki for more details.) -- View this message in context: http://www.nabble.com/deploying-demo-of-trinidad-tf4447751.html#a12691461 Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: deploying demo of trinidad
As I already wrote: Should you try the same - don't forget to remove myfaces JSF1.2 from war and accordingly remove startup listener from web.xml. JSF 1.2 spec requires JSF impl to be generally server-provided, if there are both project- and server-level JSF implementations then server's take precedence (JSF gurus, pls, correct me if I'm wrong here). So: 1. you must delete both myfaces-1.2.0-impl.jar and myfaces-1.2.0-api.jar from WEB-INF/libs/ of trinidad examples war 2. you must remove listener.../listener from web.xml And only after that deploy application on the server. aj1m wrote: because while trying exemple of trinidad 1.2.2 on jboss 4.2.1 i get this error: ( WARN [org.jboss.web.jsf.integration.config.JBossJSFConfigureListener] MyFaces JSF implementation found! This version of JBoss AS ships with the java.net implementation of JSF. There are known issues when mixing JSF implementations. This warning does not apply to MyFaces component libraries such as Tomahawk. However, myfaces-impl.jar and myfaces-api.jar should not be used without disabling the built-in JSF implementation. See the JBoss wiki for more details.)
Re: deploying demo of trinidad
thank u alot for ur presieus help; i found another solution that consist to add this code : context-param param-nameorg.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL/param-name param-valuetrue/param-value /context-param in order that igonre the jsf implementation integrate by jboss and that i can use myface. so i have a question is it the same that i use myface api and use jsf api. or there r some difference. -- View this message in context: http://www.nabble.com/deploying-demo-of-trinidad-tf4447751.html#a12691947 Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: Custom UIViewRoot
Hi, Did you use RI or myfaces? RI 1.1 did not support replacing the UIViewRoot component. Than you need to replace the ViewHandler like we did in tobago. Regards, Volker 2007/9/15, Manfred K. [EMAIL PROTECTED]: Hi all, I implemented a custom UIViewRoot because I need to override the encodeBegin and encodeEnd methods. Unfortunately my methods never get called!? I declared my UIViewRoot class in faces-config as new component: component component-typejavax.faces.ViewRoot/component-type component-classtest.TestUIViewRoot/component-class /component The class: public class TestUIViewRoot extends UIViewRoot { public TestUIViewRoot() { super(); } public void encodeBegin(FacesContext context) throws IOException { //do some stuff super.encodeBegin(context); } public void encodeEnd(FacesContext context) throws IOException { //do some stuff super.encodeEnd(context); } ... } What I'm doing wrong? THANX! -- View this message in context: http://www.nabble.com/Custom-UIViewRoot-tf4447158.html#a12688634 Sent from the MyFaces - Users mailing list archive at Nabble.com.
tr:inputDate
Hi, I am using the trinidad component tr:inputDate, and dont know if im doing something completely stupid. Whenever i click on the popup, it appears ok. I also have a tr:validateDateRange element with it, which takes the limit from a managed bean through some el. If, for example, i set the minimum date to be 15/09/2007 (dd/MM/) in the managed bean, whenever i click on the date picker icon, it brings up the popup ok, but i am not able to select the minimum date, and also if i click the first available date (in this case 16/09/2007), it populates the field with 15/09/2007. As you can imagine its been a source of frustration. Any ideas - ive been googling for hours with little success Regards, Andy
Re: Custom UIViewRoot
Thank you for your reply! We are using myfaces (1.1.5). I just had a look at the standard ViewHandler implementation, but I don't think that this is the right place for our needs. We have to modify the generated html output of the UIViewRoot (e.g. remove html, head, body tags if present, add javascript code and log the modified html code). How can we achieve this (what is the right place for this functionallity and how can we access the generated html markup)? Thanks! Volker Weber-5 wrote: Hi, Did you use RI or myfaces? RI 1.1 did not support replacing the UIViewRoot component. Than you need to replace the ViewHandler like we did in tobago. Regards, Volker 2007/9/15, Manfred K. [EMAIL PROTECTED]: Hi all, I implemented a custom UIViewRoot because I need to override the encodeBegin and encodeEnd methods. Unfortunately my methods never get called!? I declared my UIViewRoot class in faces-config as new component: component component-typejavax.faces.ViewRoot/component-type component-classtest.TestUIViewRoot/component-class /component The class: public class TestUIViewRoot extends UIViewRoot { public TestUIViewRoot() { super(); } public void encodeBegin(FacesContext context) throws IOException { //do some stuff super.encodeBegin(context); } public void encodeEnd(FacesContext context) throws IOException { //do some stuff super.encodeEnd(context); } ... } What I'm doing wrong? THANX! -- View this message in context: http://www.nabble.com/Custom-UIViewRoot-tf4447158.html#a12688634 Sent from the MyFaces - Users mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/Custom-UIViewRoot-tf4447158.html#a12694553 Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: tr:inputDate
and also if i click the first available date (in this case 16/09/2007), it populates the field with 15/09/2007. I remember this issue. Are you using java.sql.Date as the type for the property in the bean? I just changed it for java.util.Date and all works well for me. Regards Leonardo Uribe
Re: tr:inputDate
just double checked there- i am using java.util.Date... Regards, Andy - Original Message From: Leonardo Uribe [EMAIL PROTECTED] To: MyFaces Discussion users@myfaces.apache.org Sent: Sunday, 16 September, 2007 12:00:19 AM Subject: Re: tr:inputDate and also if i click the first available date (in this case 16/09/2007), it populates the field with 15/09/2007. I remember this issue. Are you using java.sql.Date as the type for the property in the bean? I just changed it for java.util.Date and all works well for me. Regards Leonardo Uribe
Re: [Trinidad] Understanding Trinidad Skinning?
It is working for me with the new configuration name and 1.0.3-SNAPSHOT On 9/14/07, md10024 [EMAIL PROTECTED] wrote: Hi Andrew, et. al., I'm having the same problem when running Trinidad 1.0.1. Was there any resolution to this? thanks, Mark Andrew Robinson-5 wrote: As I mentioned, disabling the compression did not work. As you can see from my post, I am getting CSS styles like .x6v. On 8/27/07, Simon Lessard wrote: Hello Andrew, Disabling compression does just that... .af_inputText_content is very readable imho. the underscore after af is always coming from | while all other underscores were translated from ::, also you can always remove the dot if the generated selector starts with .af_. So, .af_inputText_content comes from af|inputText::content. Regards, ~ SimonOn 8/26/07, Andrew Robinson wrote: Disabling the style compression only seems to help a little bit. The FileSystemStyleCache._getShortStyleClassMap still returns unreadable styles. For example, one of the selectors firebug showed was: .x6v, .portlet-section-selected, .xbv, .portlet-table-selected, .xc2 { the .x* styles are really near impossible to know where they came from. Is there an easy way to get all styles to stay in a readable state? Thanks, Andrew On 7/30/07, Jeanne Waldman wrote: Another tip: Use Firebug. It allows you to view the css that is rendered on acomponent by default and then you can inhibit anything you want in yourskin using -tr-inhibit. Also, by default we compress the styleclass names to boost performance.While creating your skin, you can disable this compression so that youcan see styleclass names that more closely resemble the css selectors. To do this, add to your web.xml file: org.apache.myfaces.trinidadinternal.DISABLE_CONTENT_COMPRESSION true And finally, looking at the xss files like Abhijit suggests will help you as well. - Jeanne Abhijit Ghosh wrote: Chris, On 7/28/07, *Chris Hane* wrote: We are trying to create our own custom skin for Trinidad and I have a basic question: First, where do the defaults for a paticular element come from? For example, we are trying to skin af:column::header-text. When we remove the color element, a default of #669966 is put into the transformed skin. The defaults are defined in base-desktop.xss and simple-desktop.xss.AFAIK your custom skin CSS is overlaid over the styles defined in base-desktop.xss and simple-desktop.xss.If you specify a style in your custom skin CSS it will override the default styles.The XSS files are actually XML files so you can read them if you want to find out the default values. Thanks, Abhi I found the skin selector documentation, is the another doc describing how skins works and their default values? I have css people working on defining the skin and they are having a slow time trying to figure this out. Second, the skin selector documentation states that it is not up-to-date. Where can I find updated info - source code only? Thanks, Chris View this message in context: Re: [Trinidad] Understanding Trinidad Skinning? Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: Custom UIViewRoot
You could replace the responsewriter and have full control over the output On 9/15/07, Manfred K. [EMAIL PROTECTED] wrote: Thank you for your reply! We are using myfaces (1.1.5). I just had a look at the standard ViewHandler implementation, but I don't think that this is the right place for our needs. We have to modify the generated html output of the UIViewRoot (e.g. remove html, head, body tags if present, add javascript code and log the modified html code). How can we achieve this (what is the right place for this functionallity and how can we access the generated html markup)? Thanks! Volker Weber-5 wrote: Hi, Did you use RI or myfaces? RI 1.1 did not support replacing the UIViewRoot component. Than you need to replace the ViewHandler like we did in tobago. Regards, Volker 2007/9/15, Manfred K. [EMAIL PROTECTED]: Hi all, I implemented a custom UIViewRoot because I need to override the encodeBegin and encodeEnd methods. Unfortunately my methods never get called!? I declared my UIViewRoot class in faces-config as new component: component component-typejavax.faces.ViewRoot/component-type component-classtest.TestUIViewRoot/component-class /component The class: public class TestUIViewRoot extends UIViewRoot { public TestUIViewRoot() { super(); } public void encodeBegin(FacesContext context) throws IOException { //do some stuff super.encodeBegin(context); } public void encodeEnd(FacesContext context) throws IOException { //do some stuff super.encodeEnd(context); } ... } What I'm doing wrong? THANX! -- View this message in context: http://www.nabble.com/Custom-UIViewRoot-tf4447158.html#a12688634 Sent from the MyFaces - Users mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/Custom-UIViewRoot-tf4447158.html#a12694553 Sent from the MyFaces - Users mailing list archive at Nabble.com.
Problems with JS CookMenu
Hello Community, I'm using MyFaces 1.1.5, Tomahawk 1.1.6 and Rich Faces 3.0.1. When I use JSCookMenu + rich:tabPanel, the JS CookMenu be under the tab panel.What could I do to bring the js cookmenu to front? Thanks, Marcos Sousa www.marcossousa.com Enjoy it!
[Trinidad] integrating maven-faces-plugin into maven war project
I have been making a war project. It is currently just one maven2 project. Up to now, my components have been hand built. Since I am using Trinidad, I have been either extending UIX/Core components or creating my own with Type support. Since maven-faces-plugin was available, I though I would try to integrate it into my project. I have it technically working, but there are problems and I have some questions. Hopefully someone has some solutions. 1) I have to run maven 2 times. The first time the XML files are put into the target. The second time the components are actually generated and compiled. I think this is because I have just one project. 2) I have code that was using one of the components. Here was the structure: UIInclude : UIXComponentBase references UINavigableRoot UINavigableRoot : UIViewRoot references UIInclude CustomViewHandler : FaceletsViewHandler references UIInclude IncludeHandler : TrinidadComponentHandler references UIInclude The obvious problems in making UIInclude generated is that the code that currently refer to it won't compile until the code generator has built the class. For the time being, I created a public abstract class UIIncludeBase that has all the methods and properties stubbed out that the other classes need, but I'm not sure if there isn't a better way. 3) The annotations on my UIIncludeTemplate are not carried to the generated UIInclude. I can do without this, but it would be really good to have this functionality. 4) If I move UIInclude to a new project, I have to move all the classes that it references, which is a very large refactoring step. Are there any recommendations on how to minimize my refactoring, fixing the compile twice problem and be able to use the Trinidad plugin? Thank you, Andrew
Re: [Trinidad] integrating maven-faces-plugin into maven war project
On 9/15/07, Andrew Robinson [EMAIL PROTECTED] wrote: I have been making a war project. It is currently just one maven2 project. Up to now, my components have been hand built. Since I am using Trinidad, I have been either extending UIX/Core components or creating my own with Type support. Since maven-faces-plugin was available, I though I would try to integrate it into my project. I have it technically working, but there are problems and I have some questions. Hopefully someone has some solutions. 1) I have to run maven 2 times. The first time the XML files are put into the target. The second time the components are actually generated and compiled. I think this is because I have just one project. Yeah, I believe the maven-faces-plugin requires two passes - one to generate a master faces-config plugin with all the includes, and later passes run off of that master. The Trinidad build works that way. 2) I have code that was using one of the components. Here was the structure: UIInclude : UIXComponentBase references UINavigableRoot UINavigableRoot : UIViewRoot references UIInclude CustomViewHandler : FaceletsViewHandler references UIInclude IncludeHandler : TrinidadComponentHandler references UIInclude The obvious problems in making UIInclude generated is that the code that currently refer to it won't compile until the code generator has built the class. For the time being, I created a public abstract class UIIncludeBase that has all the methods and properties stubbed out that the other classes need, but I'm not sure if there isn't a better way. In the Trinidad codebase we just live with this - the maven build generates the code before the compilation, so no biggie, though it is a mild irritant when developing with an IDE (needing to jump back out to Maven to rebuild code instead of doing it all within the IDE). 3) The annotations on my UIIncludeTemplate are not carried to the generated UIInclude. I can do without this, but it would be really good to have this functionality. I agree, that'd be an important enhancement. -- Adam 4) If I move UIInclude to a new project, I have to move all the classes that it references, which is a very large refactoring step. Are there any recommendations on how to minimize my refactoring, fixing the compile twice problem and be able to use the Trinidad plugin? Thank you, Andrew