Re: [Trinidad] rendering pre-formatted html text
Renzo Tomaselli wrote: Hi, I wonder if any component in Trinidad is suitable for rendering a pre-formatted chunk of html text. Assume I allow to edit html through TinyMCE or alike, then I save the resulting html text. Whenever I want to render it in readonly mode, I need to include it as it is within the page DOM model. I know I can do it the dirty way - by playing with js and innerHTML, just I wonder about any cleaner - component-oriented solution. I know about tr:outputFormatted, but this seems very limited in terms of supported formatting. h:outputText (or tr:outputText) with escape=false should do the trick. L.
Re: A question about integration of JSF and Spring
See also Spring's own documentation: http://static.springframework.org/spring/docs/2.5.x/reference/webintegration.html#jsf and, linked from there: http://jsf-spring.sourceforge.net/ or just try: http://www.google.com/search?q=spring+jsfie=utf-8oe=utf-8aq=trls=org.mozilla:en-US:officialclient=firefox-a for a wealth of articles and information. L. Gerald Müllan wrote: Hi, a nice introduction with code examples was published by cagatay on his blog: http://cagataycivici.wordpress.com cheers, Gerald On Feb 3, 2008 1:32 PM, Matthias Wessendorf [EMAIL PROTECTED] wrote: check code.google.com/p/facesgoodies On Feb 3, 2008 1:17 PM, Thomas Chang [EMAIL PROTECTED] wrote: Hi all, I am looking for tutorials, documentations about inegration of JSF/MyFaces and Spring. Could someone help me? Regards Thomas Ihre erste Baustelle? Wissenswertes für Bastler und Hobby Handwerker. -- Matthias Wessendorf further stuff: blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf mail: matzew-at-apache-dot-org
Re: Trinidad table paging
Francisco Passos wrote: Great to know you've got it working. I'm now using the process scope feature of Trinidad and it's works fine but it means that I will have to clear the process scope context manually at the appropriate time within the application to avoid high memory consumption on the server side. That is exactly why I'm choosing to avoid to use process scope as much as I'm avoiding session. I guess I'll only use it if I need to do something session-scoped that requires support for tabbed browsing, for instance. I haven't played much with process scope and haven't used it recently, so I could be wrong, but: That's the point of process scope, though; the clean-up is handled for you automatically. That's the difference between process scope and session scope. IIRC, the way it works is that data you place *into* process scope in request N will be available *from* process scope in request N+1, but will be gone in request N+2 unless you explicitly refresh it. L.
Component nesting error with 1.0.1 from trunk
I just upgraded an application from a pre-release build of 1.0-incubating to a snapshot of 1.0.1 build from trunk a couple of days ago, and (after making a few changes to my templates to accommodate component name changes and such) am getting the following errors in my logs. Can anyone offer any hints to narrow down my diagnostic process? What component(s) should I be looking to replace, and what would I need to use instead? Thanks, L. SEVERE: Warning: illegal component hierarchy detected, expected UIXCommand but found another type of component instead. java.lang.ClassCastException: org.apache.myfaces.trinidad.component.core.nav.CoreGoLink at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.NavigationPaneRenderer.renderContent(NavigationPaneRenderer.java:124) at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.NavigationPaneRenderer.encodeAll(NavigationPaneRenderer.java:87) at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:208) at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:694) at org.apache.myfaces.trinidad.component.UIXCollection.encodeEnd(UIXCollection.java:525) at org.apache.myfaces.trinidadinternal.uinode.UIComponentUINode._renderComponent(UIComponentUINode.java:337) at org.apache.myfaces.trinidadinternal.uinode.UIComponentUINode.render(UIComponentUINode.java:279) at org.apache.myfaces.trinidadinternal.uinode.UIComponentUINode.render(UIComponentUINode.java:256) at org.apache.myfaces.trinidadinternal.ui.BaseRenderer.renderChild(BaseRenderer.java:425) at org.apache.myfaces.trinidadinternal.ui.BaseRenderer.renderNamedChild(BaseRenderer.java:397) at org.apache.myfaces.trinidadinternal.ui.laf.base.desktop.PageHeaderLayoutRenderer.renderContent(PageHeaderLayoutRenderer.java:405) at org.apache.myfaces.trinidadinternal.ui.BaseRenderer.render(BaseRenderer.java:93) at org.apache.myfaces.trinidadinternal.ui.laf.base.xhtml.XhtmlLafRenderer.render(XhtmlLafRenderer.java:84) at org.apache.myfaces.trinidadinternal.uinode.UIXComponentUINode.renderInternal(UIXComponentUINode.java:192) at org.apache.myfaces.trinidadinternal.uinode.UINodeRendererBase.encodeEnd(UINodeRendererBase.java:70) at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:694) at org.apache.myfaces.trinidad.render.RenderUtils.encodeRecursive(RenderUtils.java:69) at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:282) at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:304) at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.renderContent(PanelPartialRootRenderer.java:72) at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.BodyRenderer.renderContent(BodyRenderer.java:136) at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.encodeAll(PanelPartialRootRenderer.java:152) at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.BodyRenderer.encodeAll(BodyRenderer.java:78) at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:208) at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:694) at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:242) at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239) at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580) at com.foo.projility.web.faces.application.ProjectivaViewHandler.renderView(ProjectivaViewHandler.java:178) at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:181) at com.apress.projsf.weblets.faces.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:70) at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41) at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:442) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1051) at com.foo.projility.web.auth.UserAuthenticationFilter.doFilter(UserAuthenticationFilter.java:80) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1042) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174) at
Re: [Trinidad] plugins build broken?
I just tried upgrading to the latest Maven and have the same error. For now, I've hacked my local poms to require 1.0.1-incubating-SNAPSHOT of this plugin as a work-around. I'll repost the build error to the dev list for further attention. L. Laurie Harper wrote: I just tried checking out the current trunk from its new home and found I can't build it :-( I get a failure building the plugins, which then leads to a failure to build the 'trinidad' module. The failure is in the build for the Apache Trinidad Maven XRTS Plugin and looks like either an issue with qdox or an issue with the plugin code being processed by qdox. What do I need to do to get this working? I've tried 'mvn -cpu install' with no improvement; am I using too old a version of Maven? L. [EMAIL PROTECTED] java -version java version 1.5.0_05 Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-83) Java HotSpot(TM) Client VM (build 1.5.0_05-48, mixed mode, sharing) [EMAIL PROTECTED] mvn --version Maven version: 2.0.4-maestro-1.0.1 [EMAIL PROTECTED] svn info Path: . URL: http://svn.apache.org/repos/asf/myfaces/trinidad/trunk/plugins Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68 Revision: 542764 Node Kind: directory Schedule: normal Last Changed Author: mmarinschek Last Changed Rev: 538505 Last Changed Date: 2007-05-16 05:53:47 -0400 (Wed, 16 May 2007) Properties Last Updated: 2007-05-30 02:14:05 -0400 (Wed, 30 May 2007) [EMAIL PROTECTED] pwd /Users/laurie/Zotech/projects/projectiva/trinidad/plugins [EMAIL PROTECTED] mvn install [INFO] Scanning for projects... [INFO] Reactor build order: [INFO] Apache Trinidad Maven Plugin Parent [INFO] Apache Trinidad Maven Faces Plugin [INFO] Apache Trinidad Maven Javacc Plugin [INFO] Apache Trinidad Maven i18n Plugin [INFO] Apache Trinidad Maven JDev Plugin [INFO] Apache Trinidad Maven Javascript Plugin [INFO] Apache Trinidad Maven XRTS Plugin [INFO] Apache Trinidad Maven Tag Documentation Report [INFO] Apache MyFaces Trinidad Archetype [INFO] Building Apache Trinidad Maven XRTS Plugin [INFO]task-segment: [install] [INFO] [INFO] [plugin:descriptor] [INFO] Using 2 extractors. [INFO] Applying extractor for language: java [INFO] [ERROR] FATAL ERROR [INFO] [INFO] syntax error @[199,67] in file:/Users/laurie/src/business/agile/projects/projectiva/trinidad/plugins/maven-xrts-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/xrts/XRTSParser.java [INFO] [INFO] Trace com.thoughtworks.qdox.parser.ParseException: syntax error @[199,67] in file:/Users/laurie/src/business/agile/projects/projectiva/trinidad/plugins/maven-xrts-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/xrts/XRTSParser.java at com.thoughtworks.qdox.parser.impl.Parser.yyerror(Parser.java:504) at com.thoughtworks.qdox.parser.impl.Parser.yyparse(Parser.java:610) at com.thoughtworks.qdox.parser.impl.Parser.parse(Parser.java:488) at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:296) at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:312) at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:308) at com.thoughtworks.qdox.JavaDocBuilder$1.visitFile(JavaDocBuilder.java:365) at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:43) at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34) at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34) at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34) at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34) at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34) at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34) at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34) at com.thoughtworks.qdox.directorywalker.DirectoryScanner.scan(DirectoryScanner.java:52) at com.thoughtworks.qdox.JavaDocBuilder.addSourceTree(JavaDocBuilder.java:362) at org.apache.maven.tools.plugin.extractor.java.JavaMojoDescriptorExtractor.execute(JavaMojoDescriptorExtractor.java:477) at org.apache.maven.tools.plugin.scanner.DefaultMojoScanner.populatePluginDescriptor(DefaultMojoScanner.java:69) at org.apache.maven.plugin.plugin.AbstractGeneratorMojo.execute
[Trinidad] plugins build broken?
I just tried checking out the current trunk from its new home and found I can't build it :-( I get a failure building the plugins, which then leads to a failure to build the 'trinidad' module. The failure is in the build for the Apache Trinidad Maven XRTS Plugin and looks like either an issue with qdox or an issue with the plugin code being processed by qdox. What do I need to do to get this working? I've tried 'mvn -cpu install' with no improvement; am I using too old a version of Maven? L. [EMAIL PROTECTED] java -version java version 1.5.0_05 Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-83) Java HotSpot(TM) Client VM (build 1.5.0_05-48, mixed mode, sharing) [EMAIL PROTECTED] mvn --version Maven version: 2.0.4-maestro-1.0.1 [EMAIL PROTECTED] svn info Path: . URL: http://svn.apache.org/repos/asf/myfaces/trinidad/trunk/plugins Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68 Revision: 542764 Node Kind: directory Schedule: normal Last Changed Author: mmarinschek Last Changed Rev: 538505 Last Changed Date: 2007-05-16 05:53:47 -0400 (Wed, 16 May 2007) Properties Last Updated: 2007-05-30 02:14:05 -0400 (Wed, 30 May 2007) [EMAIL PROTECTED] pwd /Users/laurie/Zotech/projects/projectiva/trinidad/plugins [EMAIL PROTECTED] mvn install [INFO] Scanning for projects... [INFO] Reactor build order: [INFO] Apache Trinidad Maven Plugin Parent [INFO] Apache Trinidad Maven Faces Plugin [INFO] Apache Trinidad Maven Javacc Plugin [INFO] Apache Trinidad Maven i18n Plugin [INFO] Apache Trinidad Maven JDev Plugin [INFO] Apache Trinidad Maven Javascript Plugin [INFO] Apache Trinidad Maven XRTS Plugin [INFO] Apache Trinidad Maven Tag Documentation Report [INFO] Apache MyFaces Trinidad Archetype ... [INFO] Building Apache Trinidad Maven XRTS Plugin [INFO]task-segment: [install] [INFO] [INFO] [plugin:descriptor] [INFO] Using 2 extractors. [INFO] Applying extractor for language: java [INFO] [ERROR] FATAL ERROR [INFO] [INFO] syntax error @[199,67] in file:/Users/laurie/src/business/agile/projects/projectiva/trinidad/plugins/maven-xrts-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/xrts/XRTSParser.java [INFO] [INFO] Trace com.thoughtworks.qdox.parser.ParseException: syntax error @[199,67] in file:/Users/laurie/src/business/agile/projects/projectiva/trinidad/plugins/maven-xrts-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/xrts/XRTSParser.java at com.thoughtworks.qdox.parser.impl.Parser.yyerror(Parser.java:504) at com.thoughtworks.qdox.parser.impl.Parser.yyparse(Parser.java:610) at com.thoughtworks.qdox.parser.impl.Parser.parse(Parser.java:488) at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:296) at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:312) at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:308) at com.thoughtworks.qdox.JavaDocBuilder$1.visitFile(JavaDocBuilder.java:365) at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:43) at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34) at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34) at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34) at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34) at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34) at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34) at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34) at com.thoughtworks.qdox.directorywalker.DirectoryScanner.scan(DirectoryScanner.java:52) at com.thoughtworks.qdox.JavaDocBuilder.addSourceTree(JavaDocBuilder.java:362) at org.apache.maven.tools.plugin.extractor.java.JavaMojoDescriptorExtractor.execute(JavaMojoDescriptorExtractor.java:477) at org.apache.maven.tools.plugin.scanner.DefaultMojoScanner.populatePluginDescriptor(DefaultMojoScanner.java:69) at org.apache.maven.plugin.plugin.AbstractGeneratorMojo.execute(AbstractGeneratorMojo.java:99) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534) at
NavigationHandler registration
I have a requirement to register a custom NavigationHandler implementation at the bottom of the delegation stack, rather than at the top as happens when registering through WEB-INF/faces-config.xml. Basically, I need to make sure that delegating navigation handlers, such as Shale's DialogNavigationHandler, or the equivalent in Trinidad, delegate to my nav handler, *not* the other way around. Basically, my nav handler needs to replace MyFaces' default implementation, with the normal registration of delegating nav handlers from faces-config.xml files wrapping that. I know JSF (at least prior to 1.2, anyway) doesn't provide a mechanism to achieve this; does MyFaces? I know I can modify the standard-faces-config.xml file bundled in myfaces-impl.jar to get what I want (actually, that sets my nav handler up as the first delegating handler above MyFaces', but that's 'good enough' for my purposes). What i'd like, though, is a config option that would have the same effect. Alternatively, is there any other mechanism I can use to achieve this, MyFaces-specific or otherwise? Thanks, L.
creating 'empty' select items
How do I create an 'empty' SelectItem? I'd like to present a selectOneChoice which allows the target model value to be set to 'null'. But I can't create a 'null' SelectItem: SelectItems[] items = new SelectItems[] { new SelectItem(null, (none)), new SelectItem(1, one), ... }; The SelectItems constructor has an explicit check for a null value or label. Short of inventing a 'flag' value for every option list and using a custom converter to translate it back to 'null' during apply values, how do I get an 'empty' item in my SelectItems array? L.
Re: creating 'empty' select items
Mike Kienenberger wrote: If I recall, one of the constructors does allow you to inconsistently pass in a null. Unfortunately not, at least in 1.1.1 (the version I'm currently using); the only constructor that doesn't have the check is the no-args constructor :-) And in JSF 1.2, I just saw a change-request go through to allow nulls. Ah, so this is a spec-enforced limitation? However, I use a flag value. [...] In my (auto-generated) converters, [...] That works, provided you're willing to define a converter for every use of select items... I'd rather avoid having to add a bunch of converters just to allow this :-( Unfortunately, it sounds like the only way to do that may be to write a custom component, which seems a bit crazy... I'll have a look at whether there's support for this in Tomahawk or Trinidad first, though. L. On 8/12/06, Laurie Harper [EMAIL PROTECTED] wrote: How do I create an 'empty' SelectItem? I'd like to present a selectOneChoice which allows the target model value to be set to 'null'. But I can't create a 'null' SelectItem: SelectItems[] items = new SelectItems[] { new SelectItem(null, (none)), new SelectItem(1, one), ... }; The SelectItems constructor has an explicit check for a null value or label. Short of inventing a 'flag' value for every option list and using a custom converter to translate it back to 'null' during apply values, how do I get an 'empty' item in my SelectItems array? L.
Re: configuring ViewControllerMapper
Matthias Wessendorf wrote: Looks like a Shale /Struts/ related question. Yes, any further questions on this topic should be asked on the struts-users list. Your backing bean needs to be a ViewController, when using Shale. If your page is located like /trees/entry.jsf the bb behind needs to be declared as trees$entry Actually, that's entirely optional. It's also not the issue in this case, see below: HTH, Matthias btw. here is a nice blog entry about a custom ViewHandlerMapper ([1]) [1] http://tinyurl.com/ghr79 On 4/5/06, Schaal, Roland [EMAIL PROTECTED] wrote: Hi, how can I configure the ViewControllerMapper in my application? My application gives me a warn: WARN org.apache.shale.view.faces.ViewViewHandler - No ViewControllerMapper has been configured for this application In my web.xml I tried: context-param param-nameorg.apache.shale.view.VIEW_MAPPER/param-name param-valueorg.apache.shale.view.impl.DefaultViewControllerMapper/param-value /context-param ...but there is no effect. Can somebody give me a hint? The DefaultViewControllerMapper should be installed by default unless you override it. Make sure you have Shale properly configured as documented [1] on the project web site. If that doesn't get you going, post again on the appropriate list. HTH, L. [1] http://struts.apache.org/struts-shale/using.html#using-configuring
Re: [OT]Problem with accessing form Element using javaScript
Legolas Woodland wrote: Hi thank you for reading my post. I have this problem in my web application : generated html which i view in my browser has this : [code] span id=form1:staticText8 style=border-width: 1px; border-style: solid; border-color: rgb(0, 0, 0) rgb(0, 0, 0) rgb(0, 0, 0) rgb(0, 0, 0); height: 15px; left: 23px; top: 392px; position: absolute; width: 145pxMy test Value/span [/code] In my java Script function i have: [code] function setNewColors(obj) { if(obj=='Yellow'){ document.getElementById(form1:statictext8).style = left: 25px; top: 383px; position: absolute; width: 143px; border-width: 1px; border-style: solid; border-color:#fdffca; background-color:#fdffca; color: #00;; } } [/code] i trigger the color change function in : [code] select style=left: 264px; top: 240px; position: absolute; width: 288px class=MnuStd id=form1:dropDown1 name=form1:dropDown1 size=1 onchange=setNewColors(this.value);dropDown_changed('form1:dropDown1'); return false; [/code] When i select yellow from the drop down box , it call color change but in javaScript console of FireFox i get an error like : [code] Error: document.getElementById(form1:statictext8) has no properties Source File: http://localhost:28081/pluto/portal/Publisher/.. Line: 299 [/code] can some one please tell me what is my mistake ? You can't say elem.style = ... in Javascript. Style isn't a string-valued property, it's a 'special' accessor for an object with CSS style properties. You need something more like with(document.getElementById(form1:statictext8).style) { left = '25px'; top = '383px'; ... } L.
Re: DEFAULT_SUFFIX question again
[EMAIL PROTECTED] wrote: so it turns out I can't use *.jsf as the file extension if I am already using for the filter stuff to go to Faces Servlet. What is bizarre though is when I start using *.faces as my filter and *.jsf as my file extension, MyFaces sends back jsp:root and stuff to the browser instead of changing everything to html. It does not seem to be processing the *.jsf(JSF jsp) file. Any one know why? Yes, you would need to tell your servlet container to process *.jsf files as JSPs. It has no way of knowing what a .jsf file is unless you tell it. How you do that would probably depend on what servlet container you're using. For Tomcat, you would do it be specifying a servlet mapping for *.jsf in your web.xml. L.
Re: Yet another calendar (also works in Java Studio Creator)
I should probably point out that now Dojo is in MyFaces (albeit in sandbox) there's YYAC (yet yet another calendar :-); Dojo has a 'date picker' widget. It's very pretty, but less functional than Edwin's looks to be - for example, I don't think it's internationalized at all. Just thought I'd mention it, since that one is free of any IP concerns. L. Martin Marinschek wrote: Like it! The JavaScript code is very clean, nicely done! Want to sign an ICLA and donate the codebase to MyFaces? Craig can help you out with how this works. regards, Martin On 3/15/06, Edwin Goei [EMAIL PROTECTED] wrote: On 3/14/06, Martin Marinschek [EMAIL PROTECTED] wrote: If you can send me the code off- or onlist, that would be great. There's a source zip download at http://blogs.sun.com/roller/resources/edwingo/sample-simple-2.2.1-src.zip to go along with the component authoring article http://wiki.java.net/bin/view/Javatools/CustomComponentLibraries. -Edwin -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Compile error , dependency on struts tiles
The dependency would be to support the Tomahawk Tiles support I expect. It ought to marked optional, but would still be needed to compile. The problem may be due to a recent move of the Tiles artifacts in the ASF Maven repository. I know Tiles now lives under a different group ID. The old repository location might have been cleared out already? L. Marco Mistroni wrote: hello, if i remember correctly, that dependency was in the project.xml, but for some reason it was disabled... check your project.xml (or is itnow pom.xml) ... if i m correct, there's a component in myfaces that is an extension of tiles...that's why that dependency is needed. hth marco On 3/15/06, Arash Bijanzadeh [EMAIL PROTECTED] wrote: I am trying to compile the head of myFaces but it has dependencies to struts-tiles which edmaven do not dl them. And build breaks. I wonder why Tomahawk should be depend on Struts tiles? It looks very strange. -- from debian manifesto: Debian Linux is a brand-new kind of Linux distribution. Rather than being developed by one isolated individua l or group, as other distributions of Linux have been developed in the past, Debian is being developed openly in the spirit of Linux and GNU.
Re: (Validation) required=true should change my css style of inputbox e.g. background:red
Yep, that's the simplest solution. If you don't want to emit the style/styleClass value from a backing bean you can also use a variant such as h:inputText ... styleClass=#{mybean.required ? 'required' : ''}/ Regarding your concern about doing this in a data table, you shouldn't have any problem provided you have the isRequired() method on each row item in your table model. L. CONNER, BRENDAN (SBCSI) wrote: if you can compute the style you want from the information you have in one of your managed beans, I believe you can also do one of the following: h:inputText ... style=#{myBean.myStyle}/ or h:inputText ... style=#{myBean.myStyle}/ - Brendan -Original Message- From: Christian Bohn [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 15, 2006 8:46 AM To: MyFaces Discussion Subject: Re: (Validation) required=true should change my css style of inputbox e.g. background:red Hi, why don't you simply define two inputfields and render only one like this: t:inputText rendered=#{the EL-expression you used in your required-attribute or simply true or false} required=true styleClass=red / t:inputText rendered=#{! the EL-expression you used in your required-attribute or simply true or false} required=false styleClass=normal / greetings Chrstian
Re: return url from action method, OR other option....
Mario Ivankovits wrote: Hi Dean! but, unfortunately, I have to query another service for the URL to really redirect to!!! This means, I can't put the URL in the faces-config.xml file. Is there any way to do any of these options(or otherslist is not exhaustive probably) I am not definitely sure, but maybe a navigation handler could help. *) create a class which extends from javax.faces.application.NavigationHandler *) create a constructor which takes one parameter which is also a NavigationHandler - we call it originalHandler *) override handleNavigation *) configure this class in your faces-config.xml *) if the fromAction is a url (e.g. starts with http://) get the externalContext/response object - cast it to httpServletresponse and *) call sendRedirect (or so, cant remember now) *) else call originalHandler.handleNavigation Note that you can achieve the same thing in your backing bean action, without having to install a view handler. The trick is to tell JSF you've handled the response so it skips generating one. Something like this: public String myAction() { String url = getMyUrl(); FacesContext ctx = FacesContext.getCurrentInstance(); ctx.getExternalContext().redirect(url); ctx.responseComplete(); return null; } L.
Re: Shale Clay vs. Facelets templating
Yee CN wrote: I am in the middle of migrating to facelets and at the same time planning for Shale. It seems to me that Shale Clay and Facelets templating overlaps to a large degree. Is there any guideline on whether the two should/can coexist and which one should be use for any particular circumstances? They probably can co-exist, but I'd strongly recommend not trying to make them ;-) You're right, they do overlap a lot. In fact I think they're pretty close to functionally equivalent, bar syntactic differences and a few minor points. I don't know Clay well enough to say that with certainty, though, so if Gary shoots me you'll know why ;-). So my advice would be to pick either one or the other. Personally I did as you are doing: started using JSF, then started using Facelets, then added Shale into the mix. You can pick and choose which bits of Shale you use, adding in each feature as you have need for it, so this works well. And if you did want to start using Facelets today but switch to Clay later, it shouldn't be too big a deal. You could also start using Clay directly, without having to immediately start using any of the rest of Shale until you're ready to do so. With the possible exception of the View Controller feature, I don't think Clay requires much else. Gary will no doubt be able to add additional insight. L.
Re: [JSF] Tiles and Reusable Template
Garner, Shawn wrote: I tried using tiles with JSF and found it does not work very well. You end up having to define every page in the tiles.xml file that you want to use the template for. Are there any other approaches to creating a reusable template that uses multiple jsp pages? Seems like I should be able to just include a page and override the body, title portion without redefining the template for every page. You may be able to do what you want with Tiles using the JSP tags instead of the XML file. Alternatively, take a look at Facelets or Shale Clay. L.
Re: Dealing with exceptions in getters
Michel Goldstein wrote: Hi, I have a very basic use case in which I need to access an external service on a getter. However, this access might fail and cause an exception. When the exception happens, I would like to redirect the user to an error page that would explain that the service is unavailable and do not allow the user to access that functionality until the service comes back up (so I can't really just add to a message and render the message using the h:message tag). My first approach was in the lines of: public TreeNode getData() { log.debug(Called getData); try { return resource.getDataAsTreeNode(); } catch (Exception e) { log.error(Cannot access resource!); getUserMessages().addMessage(Cannot access a required resource. Your access will be limited until the resource is available again.); FacesContext ctx = FacesContext.getCurrentInstance(); ctx.getApplication ().getNavigationHandler().handleNavigation(ctx,,error); return null; } } However, the problem is that the getter is being called twice during the page processing and on the second time it throws an exception claiming that the state is invalid during redirect. By the way, the error page navigation rule in faces-config.xml uses the redirect/ directive mostly to change the URL on the browser so that the user can see that it is an error page. My question then is a little bit more basic than this: what it looks like to me is that I'm using the wrong pattern here to deal with exceptions. What should be the right pattern? Add ctx.renderResponse() at the end of your exception handling code. That'll tell JSF to jump straight to rendering the response when the current phase ends. I think that'll do the trick. L. Thank you, Michel Just for completeness sake, here is the stack trace of the error: 2006-02-22 13:01:10,485 44493 ERROR [TP-Processor3] [/ptd].[jsp] - Servlet.service() for servlet jsp threw exception javax.faces.el.EvaluationException: Cannot get value for expression '#{ test.data}' at org.apache.myfaces.el.ValueBindingImpl.getValue( ValueBindingImpl.java:402) at org.apache.myfaces.custom.tree2.UITreeData.getValue( UITreeData.java:264) at org.apache.myfaces.custom.tree2.HtmlTreeRenderer.encodeChildren( HtmlTreeRenderer.java:173) at javax.faces.component.UIComponentBase.encodeChildren( UIComponentBase.java:527) at javax.faces.webapp.UIComponentTag.encodeChildren( UIComponentTag.java:474) at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java :361) at org.apache.jsp.exportViewResults_jsp._jspx_meth_t_tree2_0( org.apache.jsp.exportViewResults_jsp:381) at org.apache.jsp.exportViewResults_jsp._jspx_meth_f_view_0( org.apache.jsp.exportViewResults_jsp:176) at org.apache.jsp.exportViewResults_jsp._jspService( org.apache.jsp.exportViewResults_jsp:100) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java :97) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service( JspServletWrapper.java:322) at org.apache.jasper.servlet.JspServlet.serviceJspFile( JspServlet.java:291) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java:173) at org.apache.catalina.core.ApplicationDispatcher.invoke( ApplicationDispatcher.java:672) at org.apache.catalina.core.ApplicationDispatcher.processRequest( ApplicationDispatcher.java:463) at org.apache.catalina.core.ApplicationDispatcher.doForward( ApplicationDispatcher.java:398) at org.apache.catalina.core.ApplicationDispatcher.forward( ApplicationDispatcher.java:301) at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch( ServletExternalContextImpl.java:416) at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView( JspViewHandlerImpl.java:234) at org.jenia.faces.template.handler.ViewHandler.renderView( ViewHandler.java:74) at org.apache.myfaces.lifecycle.LifecycleImpl.render( LifecycleImpl.java:372) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:109) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java:173) at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter( ExtensionsFilter.java:129) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(
Re: question for outputLink/commandLink
Yasushi Okubo wrote: Hi, experts I would like to create a simple text link that kicks off javascript by onmouseover, but avoid to do submit() or go to another webpage, and I also need to show the data stored in my backing bean. The Html line could be like the following. I played with both outputLink/outoutCommand, but it alway tries to display webpage or submit a new request by clicking or onclick. I would like to disable to submit for commandLink/outputLink for onclick. How could I do it ? Or is there any other method other than outputLink/commandLink that can avoid submit()/going to another page ? a href=_blank onmouseover=doPopupMolWeight(); onmouseout=close_window_mol(); 'NeedToDisplayDataStoredInBackingBeanHere' /a I tried something like the following with outputLink, but it submits a request to the server when I click the link after executing javascript doNothing(). h:outputLink value=#{value} onclick=doNothing() onmouseover=doPopupMolWeight(); onmouseout=close_window_mol(); / h:commandLink value=#{value} onclick=doNothing() onmouseover=doPopupMolWeight(); onmouseout=close_window_mol(); / As with any Javascript event handler, you need to return false if you want to prevent the default action from taking place. Add a 'return false;' at the end of your doNothing() function [or, since that function presumably doesn't do anything, you could just replace it with the return in the onclick attribute.] L.
Re: ADF Faces oracle skin
See the skinning guide: http://www.oracle.com/technology/products/jdev/101/howtos/adfskins/index.html L. Yogesh Chaudhari wrote: Hi Jonas, I am using ADF faces since last couple of months, I liked the Oracle skin, I am using this theme for our Intranet application. I just want to change the skin font to verdana, how I can override it. Thanks, Yogesh On 2/20/06, Jonas Jacobi [EMAIL PROTECTED] wrote: Hi Dirk, The Oracle specific skin (beige/blue called BLAF) will not be included in the donation or any future release of the commercial solution to ADF Faces. The last release that includes the old Oracle look and feel is available from JDeveloper 10.1.3. We are working on a new Oracle skin, but personally I think we should have a MyFaces skin for the components instead of the Oracle skin :) I have already started on this MyFaces skin and as soon as I have something that covers most components I will contribute it back to the project. I just wanted Sean to be done with the new MyFaces website so that I could mimic its style for the new skin. Thanks Jonas Dirk Wilhelm wrote: Hello, i just deployed the demo.war from the adf faces drop in zip to my tomcat and noticed that the oracle skin is not included in this version? In the skinning example page the oracle skin looks exactly the same as the simple skin. Is there a way to include this skin? Thanks for help, Dirk -- Jonas Jacobi Author: Pro JSF and Ajax: Building Rich Internet Components Blog: http://www.orablogs.com/jjacobi
Re: t:div and validation saving
Or ditch JSPs altogether and switch to Facelets or Shale Clay; much nicer ;-) L. Volker Weber wrote: You need to enclose all plain html in verbatim, but don't put jsf in verbatim. try somthing like this: t:div rendered=#{portalbean.useCase eq 'submitNew'} f:verbatim tr td width=5%#160; /td td align=left rowspan=4 class=rightCellLine /f:verbatim h:outputLabel value=#{labels.regCal_when} #160; / t:inputCalendar id=kalenderrenderAsPopup=true popupButtonString=Click here to show Calendar renderPopupButtonAsImage=true popupDateFormat=dd/MM/ popupTodayString=#{labels.regCal_today} popupWeekString=#{labels.regCal_week} required=true value=#{regcalbean.currentEvent.dateChosen} /t:inputCalendar#160;#160;#160;#160; f:verbatim /f:verbatim h:message for=kalender styleClass=error / /t:div Regards, Volker Philippe Lamote wrote: Yes, I have. (Well, had) I removed the verbatims and now it works - functionally. Easthetically the page became a mess since now he's also rendering the plain (non-jsf) HTML inside hidden divs (I mean divs with rendered = false) , which he did do not previously. Some more explanation: I had a table with elements defined in pure HTML (using table, tr and td) I had parts of the table (collection of rows) that I wanted to show or hide, depending on the Use Case. So I was using the t:div rendered=f(some var) wrapping these column sets. I added verbatim tags to properly hide/show the html markup inside these divs. Now I removed the verbatim tags. Functionally it works but he's showing the HTML inside the hidden divs. To solve this, does this basically mean I will have to rewrite all HTML to purely JSF code as the mix of both obviously entails some annoying side effects? ( thx for the advice already) Philippe On 20 Feb 2006, at 23:16, Volker Weber wrote: Hi Philippe, you have jsf tags inside of f:verbatim? AFAIK this will not work, you should close the verbatim before the jsf tags, and reopen after. Regards, Volker Philippe Lamote wrote: Hi List, Another problem I've run into today: -- I have in my page a div like this: (inside a form) ... !-- For the Use Case Submit New Calendar: -- t:div rendered=#{portalbean.useCase eq 'submitNew'} f:verbatim tr td width=5%#160; /td td align=left rowspan=4 class=rightCellLine h:outputLabel value=#{labels.regCal_when} #160; / t:inputCalendar id=kalender renderAsPopup=true popupButtonString=Click here to show Calendar renderPopupButtonAsImage=true popupDateFormat=dd/MM/ popupTodayString=#{labels.regCal_today} popupWeekString=#{labels.regCal_week} required=true value=#{regcalbean.currentEvent.dateChosen} /t:inputCalendar#160;#160;#160;#160; ... h:message for=kalender styleClass=error / /f:verbatim /t:div All is rendered well when the Use Case chosen equals submitNew, so far no problem. The currentEvent for its value, is of Type CalendarEvent where the relevant part of that class states: .../** * The chosen Date: */ private Date dateChosen; /** * @return Returns the dateChosen. */ public Date getDateChosen() { return dateChosen; } /** * @param dateChosen The dateChosen to set. */ public void setDateChosen(Date dateChosen) { this.dateChosen = dateChosen; } (in the constructor dateChosen is not instantiated to avoid a default date of today in the inputCalendar field - this makes no difference as to the issue however) The problem: The weird stuff is twofold: 1/ The inputCalendar is a required element. Yet, when I don't fill anything in, I get no complaints. 2/ It turns out that despite the fact all data inside the div is rendered, NONE of this data is actually saved. In fact whatever I type into it, the value stays null. All data of currentEvent outside the div is saved correctly. Any ideas as to the why? I don't think this is how div is supposed to work, is it? Philippe
Re: ADF Faces oracle skin
You don't have to create a whole theme if you don't want to, just write a little CSS. The skinning documentation, in conjunction with the Oracle theme files, will let you figure out what font assignments you'll need to override. L. Yogesh Chaudhari wrote: Thanks for the reply, I do not want to create new theme, I just want to change font for Oracle theme. But I guess I have to use themes as it or write my own. Thanks, Yogesh On 2/20/06, Laurie Harper [EMAIL PROTECTED] wrote: See the skinning guide: http://www.oracle.com/technology/products/jdev/101/howtos/adfskins/index.html L. Yogesh Chaudhari wrote: Hi Jonas, I am using ADF faces since last couple of months, I liked the Oracle skin, I am using this theme for our Intranet application. I just want to change the skin font to verdana, how I can override it. Thanks, Yogesh On 2/20/06, Jonas Jacobi [EMAIL PROTECTED] wrote: Hi Dirk, The Oracle specific skin (beige/blue called BLAF) will not be included in the donation or any future release of the commercial solution to ADF Faces. The last release that includes the old Oracle look and feel is available from JDeveloper 10.1.3. We are working on a new Oracle skin, but personally I think we should have a MyFaces skin for the components instead of the Oracle skin :) I have already started on this MyFaces skin and as soon as I have something that covers most components I will contribute it back to the project. I just wanted Sean to be done with the new MyFaces website so that I could mimic its style for the new skin. Thanks Jonas Dirk Wilhelm wrote: Hello, i just deployed the demo.war from the adf faces drop in zip to my tomcat and noticed that the oracle skin is not included in this version? In the skinning example page the oracle skin looks exactly the same as the simple skin.. Is there a way to include this skin? Thanks for help, Dirk -- Jonas Jacobi Author: Pro JSF and Ajax: Building Rich Internet Components Blog: http://www.orablogs.com/jjacobi
Re: Adding Image Icons to Drop Down Lists
Why bother? Just do f:selectItem ... style=background-image: url(/images/icons/someIcon.gif);/ L. Andrew Robinson wrote: You could build your own custom renderer to do this. On 2/17/06, Mike Duffy [EMAIL PROTECTED] wrote: There is a cool technique to add image icons to drop-down lists: option id=issuetype value=1 style=background-image: url(/images/icons/someIcon.gif); selected=selectedSome Label/option Is there anyway to do this with SelectItems in JSF? Thx. Mike __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Tomahawk 'extensions' filter: alternatives?
Craig McClanahan wrote: This part of the problem, at least, is pretty easy to deal with :-). Call FacesContext.setResponseWriter() -- perhaps after calling getResponseWriter() to save the original one, if any -- in a before render response phase listener, and do the inject-and-copy trick in the corresponding after render response listener. Ah-ha! That's what I was looking for :-) But isn't this approach what you suggested may not work well with, for example, JSPs, if any of the response is generated without going through the response writer? Shale Remoting plays this sort of game to deal with asynchronous AJAX callbacks. It's on my TODO-list to look into Shale Remoting. It just got bumped up a bit ;-) Are you saying that Shale includes support for injecting references to static resources into a response, or just that it uses the technique above for whatever? L.
Re: commandLink encode/decode behaviour
Hmm, I don't want to get into relying on implementation specifics in a general-purpose component library. I guess I'll need to manage a hidden input of my own. Thanks, L. Dennis Byrne wrote: This is not standardized. MyFaces exposes this w/ HtmlRendererUtils.HIDDEN_COMMANDLINK_FIELD_NAME , which has always been _link_hidden_ . Dennis Byrne -Original Message- From: Laurie Harper [mailto:[EMAIL PROTECTED] Sent: Thursday, February 16, 2006 04:38 PM To: users@myfaces.apache.org Subject: commandLink encode/decode behaviour From the reference documentation for the commandLink component: Both the encode and decode behavior require the ability to get the id/name for a hidden field whose value is set by the JavaScript form submit. This name must be constructed as follows: * Get the clientId for the form of which this component is a child. * AppendNamingContainer.SEPARATOR_CHAR. * Append a constant string that is the same for all command link components in the tree. In the following text, this String is called hiddenFieldName. There's no mention of how to determine the 'constant string that is the same for all command link components'. Is there any standard way to do that? The reason I want to is that I'm creating components that need to use Javascript to trigger a form submit in order to fire actions / listeners on the back end. I'd prefer to re-use the existing hidden input rather than have to manage an additional one just for my components. L.
Re: Tiles and javascript code generated after html content
Costa Basil wrote: Hi: I am using tiles and I noticed that the final html content contains this piece of javascript code at the end after the /html tag. Is there a way to fix this? Things seem to work tough in IE, however, it kind of worries me. Thanks form id=linkDummyForm name=linkDummyForm style=display:inline method=post action=/cps/p/contacts/contactsSummary.jspinput type=hidden name=linkDummyForm:_link_hidden_ /script type=text/javascript!-- function clear_linkDummyForm() { var f = document.forms['linkDummyForm']; f.elements['linkDummyForm:_link_hidden_'].value=''; f.target=''; } clear_linkDummyForm(); //--/script/form I think that only happens if you use command links without an enclosing h:form. I could be wrong though... L.
Re: Tomahawk 'extensions' filter: alternatives?
Werner Punz wrote: Laurie Harper schrieb: I have a need for similar functionality to the Tomahawk Extensions filter, and have been thinking about ways to achieve it without requiring user config. I was hoping I could find a standard JSF hook that I could plug into through a faces-config entry but haven't come up with anything viable yet. So I thought I'd ask the obvious question: Is the extensions filter the only viable approach? If not, what are the other options and the reasons they were rejected in favour of the filter? It seems to be a somewhat common problem that people either don't install the filter or don't get it configured correctly, so I'm guessing if there were a better way, the Tomahawk components would be using it... If it's simply the case that no-one's invested the time to implement a configuration-free alternative, and someone can describe what's involved, I'll be happy to contribute an implementation :-) L. Actually no, the filter is not the only viable approach, you could replace the filter with a phase listener. I personally have the same problems as you have with the servlet filter approach, it works, but it is too problematic for the end users. But in the end I thing all JSF projects should consolidate on a common resource loading mechanism. John Fallows has an interesting project, Weblets, that one is a common resource format, with its own resource loading mechanism for every framework there is. For JSF he uses a phase listener (which is a snap in without user config) and a ViewHandler (which can be moved into a tools class, I talked those things over with him, the ViewHandler was only used to achieve API similarity to JSF) Interesting. I was under the impression that Weblets did not and would not support the 'add script elements to the document head' part of the equation. I'll have to have another look at it. L.
Re: Tomahawk 'extensions' filter: alternatives?
Craig McClanahan wrote: Interesting. I was under the impression that Weblets did not and would not support the 'add script elements to the document head' part of the equation. I'll have to have another look at it. I think that is true for weblets, and it is definitely true for Shale Remoting. What remoting offers is a helper class that computes the calculate the appropriate resource URL for you to render. Actually adding the script element (or call addResource() in the case of Tomahawk) is still your responsibility. Right, ant that's the bit I'm trying to come up with a generic, portable, configuration-free solution for. The trouble is, I can't find a general hook in JSF that would allow post-processing the generated response. I suppose I could take another tack and look into whether there's a way to register a servlet filter programmatically and, if so, if there's a way to determine the URL mappings for the FacesServlet reliably. Failing that, I can detect when there's something already configured (i.e. if the Tomahawk extension filter is installed, use it; if ADF Faces is being used, tie in to whatever it does; etc; otherwise, require additional configuration. L.
Re: Tomahawk 'extensions' filter: alternatives?
Craig McClanahan wrote: On 2/17/06, Laurie Harper [EMAIL PROTECTED] wrote: Craig McClanahan wrote: Interesting. I was under the impression that Weblets did not and would not support the 'add script elements to the document head' part of the equation. I'll have to have another look at it. I think that is true for weblets, and it is definitely true for Shale Remoting. What remoting offers is a helper class that computes the calculate the appropriate resource URL for you to render. Actually adding the script element (or call addResource() in the case of Tomahawk) is still your responsibility. Right, ant that's the bit I'm trying to come up with a generic, portable, configuration-free solution for. The trouble is, I can't find a general hook in JSF that would allow post-processing the generated response. That's where my provide a custom ResponseWriter thought mght come into play. I may have mis-understood what you said before, but I thought it was to the effect that this idea wouldn't work if any part of the response was rendered without going through response writer, and that would probably be a problem with JSPs? I suppose I could take another tack and look into whether there's a way to register a servlet filter programmatically There is not :-(. and, if so, if there's a way to determine the URL mappings for the FacesServlet reliably. That you can do, by parsing web.xml yourself. There's code for this you could crib from Shale Remoting if you need it ( org.apache.shale.remoting.faces.MappingsHelper). Doesn't help much if I can't use the information to then add the filter :-( L. Failing that, I can detect when there's something already configured (i.e. if the Tomahawk extension filter is installed, use it; if ADF Faces is being used, tie in to whatever it does; etc; otherwise, require additional configuration. L.
Re: ADF Faces processScope problem
James Moores wrote: Hi, I know that it's probably a bit early to be looking for ADF Faces help here in light of the fact that it's only just joined MyFaces, but I'm getting no joy at all on the Oracle forums and people on this list have been so helpful that I thought it was worth a try: I use the ADF Faces 'Process scope' facility a great deal. Unfortunately I have a significant problem. My backing beans cannot be initialized from the faces-config because their values come from a database. I therefore use a separate backing bean to populate the values (because the beans are reused by different pages). The problem is that this initialization bean isn't naturally referenced on the page, and so it's never created by the framework and the initialization doesn't happen. I've gotten around this by putting in a dummy reference to the bean, that triggers my initialization code either in the constructor or in a dummy 'get' method e.g.: af:outputText value=initializingBean.init ... rest of jsp page... This works fine except that now if I change anything in the process scope during the execution of either the constructor or the get method on my 'initializingBean' then it's added nicely (confirmed by printing out the Map). The problem is by the time an action method (or actionListener) is called, the new values in the Map have dissapeared and the state of the map is reset back to what it was before the call to initializingBean. Looking at the source code for ProcessScopeMap (adf-faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/co ntext/ProcessScopeMap.java) I found a rather worrying comment: // =-=AEW This strategy assumes that the ProcessScopeMap // will be inherited from a prior request, have things // added and removed prior to Render Response *without // the token being requested*, then have the token used // repeatedly during Render Response *without further // mutations*. Both of these assumptions seem very // dubious! Now I'm not sure if theis has anything to do with my problem, but it looks a bit suspect. Unfortunately I don't know enough about the internals of either MyFaces or ADF Faces to *fix* the problem. There seems to be very little documentation about processScope's and many postings on the Oracle forum on the subject have gone unanswered. I know it's an experimental feature, but it's a pretty important one! I've been banging my head against a brick wall with this one for nearly a week now so any light anyone can shed on this or ideas of how I could better do my initialization later in the phase cycle (which I think is the problem) would be greatly appreciated. Based on the comment, it would seem that your problem is that you need to do your initialization *earlier* in the phase cycle -- i.e. before the Render Response phase begins. Shale's View Controller feature [1] provides a great solution to this; the init() and prerender() hooks would be the two options you'd want to consider for doing your initialization. If you don't want to use Shale, you could implement the same approach in your own app with a little bit more work. Basically, you'd implement your own phase listener and call your initialization logic in beforePhase(). I don't have a sample code snip to hand, but it's fairly straightforward. L. [1] http://struts.apache.org/struts-shale/features-view-controller.html
Tomahawk 'extensions' filter: alternatives?
I have a need for similar functionality to the Tomahawk Extensions filter, and have been thinking about ways to achieve it without requiring user config. I was hoping I could find a standard JSF hook that I could plug into through a faces-config entry but haven't come up with anything viable yet. So I thought I'd ask the obvious question: Is the extensions filter the only viable approach? If not, what are the other options and the reasons they were rejected in favour of the filter? It seems to be a somewhat common problem that people either don't install the filter or don't get it configured correctly, so I'm guessing if there were a better way, the Tomahawk components would be using it... If it's simply the case that no-one's invested the time to implement a configuration-free alternative, and someone can describe what's involved, I'll be happy to contribute an implementation :-) L.
commandLink encode/decode behaviour
From the reference documentation for the commandLink component: Both the encode and decode behavior require the ability to get the id/name for a hidden field whose value is set by the JavaScript form submit. This name must be constructed as follows: * Get the clientId for the form of which this component is a child. * AppendNamingContainer.SEPARATOR_CHAR. * Append a constant string that is the same for all command link components in the tree. In the following text, this String is called hiddenFieldName. There's no mention of how to determine the 'constant string that is the same for all command link components'. Is there any standard way to do that? The reason I want to is that I'm creating components that need to use Javascript to trigger a form submit in order to fire actions / listeners on the back end. I'd prefer to re-use the existing hidden input rather than have to manage an additional one just for my components. L.
Re: Tomahawk 'extensions' filter: alternatives?
Craig McClanahan wrote: On 2/16/06, Cagatay Civici [EMAIL PROTECTED] wrote: Hi Laurie, It seems a phaselistener is what you are looking for, it is pluggable and does not require any user configuration. One thing you can do in a filter that you cannot in a phase listener is wrap the response object, so that you can intercept the output and modify it. ExtensionsFilter does this so it can postprocess and insert the resource tags. The closest you could come in a phase listener would be to interject a ResponseWriter that buffered up the output -- then, after Render Response complete, goes in and does the same sort of injection followed by writing the modified response out to the real client. That should work, as long as *all* of the output were done via ResponseWriter. I suspect that will be true if you are using something like Facelets or Clay, but likely *not* to be true if you are using JSP pages. Yep, that's exactly the problem. Weblets, Shale Remoting and a few other options exist for actually serving static content from a jar; the problem is inserting the references to that content (scripts and CSS for the most part). The 'buffering response writer' idea was one of the things I looked at but I didn't see an easy way to inject one. Sounds like that wouldn't work portably in any case, though. Maybe this is something worth raising in the JSF WG, though I imagine it's a bit late in the development of the 1.2 spec to get something like this in there. L.
Re: Shale Dialog Manager vs. t:saveState
CONNER, BRENDAN (SBCSI) wrote: After having done several native MyFaces application implementations, I'm just starting to do initial research into Shale. The motivation to do this is that, from my understanding, Shale offers a framework allowing relatively painless debugging of JSF actions. I noticed on the site that Shale provides support for multi-screen conversations via its Dialog Manager. Can someone comment on how using this compares to using t:saveState? Are there situations in which using one is preferred to using the other? They do rather different things. t:saveState allows you to 'attach' arbitrary data to the saved view state, effectively allowing you to preserve backing bean state or other data across requests. Shale Dialogs is more like a simple workflow management framework; it allows you to describe a series of states and state transitions that represent a 'dialog' between the user and your application. I think Shale Dialogs and Spring Webflow are pretty similar in intent, if the comparison helps. Also, what other benefits (or drawbacks) can I expect from using Shale? (I probably should ask this in the Shale user group, but I figured people in this user group would have some interesting feedback as well.) Shale is a 'value added' framework for JSF; in other words, it adds various useful features on top of what JSF already provides. For an overview of what's available, see the Shale Features section of the project site: http://struts.apache.org/struts-shale/index.html#Shale_Features L.
Re: how to declare mvn dependencies on myfaces and javax.faces?
Dave Brondsema wrote: Now that myfaces is using maven to build, what is the proper way for my project to declare its dependencies on JSF? I want to only declare my dependency on JSF, not on MyFaces in particular. For example: dependency groupIdjavax.faces/groupId artifactIdjsf-api/artifactId version1.1/version scopecompile/scope /dependency But how do I relate that to myfaces-api-1.1.2-SNAPSHOT.jar? Is there a way to mvn install the api jar as javax.faces/jsf-api? AFAIK, you'd have to do that manually. Maven certainly doesn't have any way to automatically map an 'API artifact' to some other artifact that provides that API. L.
Re: Why ViewRoot.getComponent(clientId) return null?
Dave wrote: In a PhaseListener, first get all the clientId(s) with queued messages, then try to find the components. But ViewRoot.findComponent(clientId) return null. public void beforePhase(PhaseEvent event) { FacesContext context = event.getFacesContext(); UIViewRoot root = context.getViewRoot(); IteratorString itr = context.getClientIdsWithMessages(); while (itr.hasNext()) { String clientId = itr.next(); UIComponent component = root.findComponent(clientId); // ERROR: component is null } } Thanks for ideas. I would guess you need to check what phase you are in before proceeding. It doesn't make much sense to call findComponnet before the Restore View phase, for example. L.
Re: formatted values in param
Or use c:set to store it into a bean. Andrew Robinson wrote: If you are using facelets, you could use an EL function to format the value On 2/9/06, Peter Maas [EMAIL PROTECTED] wrote: Hi all, I wondered how to store formatted values in a parameter. Say I would like to set a formatted date as a message property... Something like this: //---// h:outputFormat value=#{messages['searchresults.lastModified']} f:param value=#{searchObject.lastModified} f:convertDateTime pattern=d MMM locale=nl_NL / /f:param /h:outputFormat //---// this doesn't work since the param tag doesn't allow body content... and it doesn't seem to have support for using converters Is it possible to temporarely store the results of a conversion into a reusable variable? -P
Re: myfaces Oracle ADF (or other component libraries)
Tom Butler wrote: Can I use Oracle ADF components together within a MyFaces application? Same question for other component libraries? Or, are these mutually exclusive (use a different front controller)? You can use ADF Faces together with MyFaces and/or the Tomahawk components. Component libraries can generally be used together without problems, although I understand Tobago is an exception. L. Also, anyone know when Tobago first release will be? I was looking at their website - some pretty cool stuff in the works. Re-usable components in my opinion are really the strength of JSF.
Re: How I can read managed property value from faces-config file in class constructor?
Yogesh Chaudhari wrote: Hi, I would like to read show managed property value in InvoiceBean class constructor so I can populate different resultset in invoices arraylist to display on page. Thanks, Yogesh public class InvoiceBean { private String show; ArrayList invoices; public InvoiceBean () { System.out.println(show invoices + show); invoices = getInvoices(); } faces-config managed-bean managed-bean-nameinvoiceALLBean/managed-bean-name managed-bean-classorg.adr.faces.backing.InvoiceBean/managed-bean-class managed-bean-scoperequest/managed-bean-scope managed-property property-nameshow/property-name property-classjava.lang.String/property-class valueALL/value /managed-property /managed-bean managed-bean managed-bean-nameinvoicePENDINGBean/managed-bean-name managed-bean-classorg.adr.faces.backing.InvoiceBean/managed-bean-class managed-bean-scoperequest/managed-bean-scope managed-property property-nameshow/property-name property-classjava.lang.String/property-class valuePENDING/value /managed-property /managed-bean .. .. .. /faces-config The short answer is you can't. Properties are set on a bean after it's constructed (since before it's constructed there's nothing to set a property on...). You have a couple of options: - call getInvoices() from setShow() - call getInvoices() lazily when needed, after the show property has been set. I'd recommend the latter but either would work. L.
Re: 'Simulating' commandLink from Javascript
Volker Weber wrote: Hi Laurie, Laurie Harper wrote: Thanks for the response, but that's not what I'm trying to do. I don't need to locate and invoke an existing command link; I don't have a command link to invoke. I need to achieve the same effect as clicking a command link would give. In other words, I need to write a Javascript function which, when invoked, does the same thing the onClick handler a commandLink generates would do. The best I can come up with so far is to create a custom component which extends HtmlCommandLink and overrides the encode/decode methods, but creating a whole new component just to be able to create Javascript onClick handlers seems rather excessive. To invoke a action on the server you need to have a component, because the event is created inside the decode of the component. On the client side you need the cliendId of this Component to do the same thing as a onClick handler of a commandLink would do. Hmm, OK, thanks; that makes sense. So, it's either time to start wrapping Dojo widgets with JSF components, or time to learn about Shale's remoting features ;-) L.
'Simulating' commandLink from Javascript
Hi, I need to do the equivalent of clicking a commandLink in Javascript; in other words, I need to write an onClick handler that does the same thing as clicking on a commandLink would. Is there a standard way to do that? I'm not sure if the JSF spec includes any specifics on client-side APIs. The reason I want this is to attach behaviours to dynamically rendered client-side 'widgets' from the Dojo toolkit -- for example, to allow buttons on a Dojo 'toolbar' widget to invoke server-side behaviour. L.
Re: 'Simulating' commandLink from Javascript
Ryan Wynn wrote: On 2/1/06, Laurie Harper [EMAIL PROTECTED] wrote: Hi, I need to do the equivalent of clicking a commandLink in Javascript; in other words, I need to write an onClick handler that does the same thing as clicking on a commandLink would. Is there a standard way to do that? I'm not sure if the JSF spec includes any specifics on client-side APIs. I have found that it is different for IE vs. Netscape/Firefox. I'm not a js expert but it works. This is how I invoke a hidden commandLink in a table row... [...] Thanks for the response, but that's not what I'm trying to do. I don't need to locate and invoke an existing command link; I don't have a command link to invoke. I need to achieve the same effect as clicking a command link would give. In other words, I need to write a Javascript function which, when invoked, does the same thing the onClick handler a commandLink generates would do. The best I can come up with so far is to create a custom component which extends HtmlCommandLink and overrides the encode/decode methods, but creating a whole new component just to be able to create Javascript onClick handlers seems rather excessive. L.
Re: Any way to disable/sidestep converters/validators while processing a ActionListener event?
Senior Consultants Inc. wrote: Hello: We would like to be able to handle the ActionListener event without converters and validators (associated with fields on the form) generating error messages. When the form is submitted, we do want the field converters and validators to generate appropriate error messages. Is there a way to disable/sidestep converters and validators while processing an ActionListener event? Further details are provided below. The situation: -- 1. Have a date input field 2. Have a link next to the input field that is used to set a default value in the date field. An ActionListener is associated with the link. 3. When the link is clicked, the form is posted and the ActionListener method is invoked. This method sets and default value in the date field and returns. 4. Since it is an ActionListener event, JSP redisplays the same page. Problem: 1. If an illegal date format has been entered into the date field before clicking the link, the converter on the date field detects an error. JSF redisplays the page with the error message. 2. Even if the date field is empty or has a legal value, other fields on the form can have bad values such that their converter or validator will detect an error. Again, JSP redisplays the page with the error message. UI Goal: Have the link set the default value and ignore any illegal fields on the form. --- At this point in time, the user in interested in defaulting the date field, not validating fields. The fields will be validated when the form is submitted. Current Solution: - 1. The link has: immediate=true set. 2. ActionListener associated with link runs early in the JSF lifecycle. This method accesses the component and sets the date value by calling component.setSubmittedValue() 3 ActionListener method then terminates JSF lifecyle 4. JSF redisplays page. Since the date component's submitted value has been modified, the default value now appears in the date field. Why We are Looking for a Better Solution: - We have other situations where the ActionListener method needs access to several fields on the form. These fields are currently not available to the ActionListener since it is invoked early in the JSF lifecycle. If the converters/validators could be disabled, the ActionListener method could run at the normal place in the JSF lifecycle. It is understood that JSF could not do the data binding for any fields where the converter fails. But all other fields would be properly bound and accessible to the AtionListener method. Thanks for your time. Jay One solution may be to use the PPR (Partial Page Refresh) features in ADF Faces. You could set your link to be a PPR trigger and identify each component you need to update/refer to during that processing. ADF Faces will then run the full JSF life-cycle but only for those components involved in the PPR event. Note that I haven't played with this much yet, but I believe that's the way it's meant to work :-) L.
Re: AW: How to use the HtmlTag component when programmatically building the UI?
If you're building the view programmatically, why can't you just use ResponseWriter directly? writer.startElement(h1); writer.writeText(header 1); writer.startElement(h2); writer.writeText(nested header 2); writer.endElement(h2); writer.endElement(h1); L. Matthias Kahlau wrote: Hi! Is there nobody else who had the requirement to programmatically render HTML elements like H1, H2 etc.? This is an important requirement when creating Web pages which have to follow accessibility guidelines... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Dienstag, 31. Januar 2006 23:10 An: Users MyFaces Betreff: How to use the HtmlTag component when programmatically building the UI? Hi! Is it possible to use the Tomahawk HtmlTag component when programmatically building the UI. I know I can use setValue() to set the HTML element name to render, e. g. h1. But can I programmatically set the body content? If this is not possible, do you know alternatives to render arbitrary HTML elements? Regards, Matthias
Re: Page Refresh Problem
Ali Raza wrote: Greetings, Is there any way to determine whether a page has been refresehed ? Is there some object in the request Map or something to indicate that the page has been refreshed from the client instead of actual postback from some submit button ? My problem is that when the page is refreshed the last submit button to be pressed remains in the request map and the corresponding action is performed when the decode method of my cutsom component is called when the page is refreshed... Any help would be much appreciated ... If you use Shale's ViewController feature [1] you get access to a number of life-cycle hooks, including an isPostBack() method you can use to answer this. You may also find useful the setPostBack() method and/or the preprocess() method, which is only called if the request is a postback. L. [1] http://struts.apache.org/struts-shale/features-view-controller.html Thanx A -- A sixteenth century inventor called Wan Hu designed a rocket-propelled chair on which he planned to ascend into heaven. He built an open cabin, to which he fitted 47 rockets underneath and above, and two kites to keep him aloft. Wan Hu disappeared in flame and smoke and was never seen again. A crater on the moon is now named after him, so in one sense he made it to the heavens after all. This is the first recorded design of something approximating to a manned space rocket. The Chinese Space Programme. From Conception to Future Capabilities. Brian Harvey
Re: Page Refresh Problem
Well, packages marked 'developing' *are* stable, reasonably. Any changes should just extend the existing functionality without breaking compatibility with what's there today. The shale.view package in particular, which provides the features I cited below, should be pretty solid at this point. L. Ali Raza wrote: hey Laurie, I browsed the shale package details etc and all the functionality was either devlopoing or evolving in terms of stability ratings. are there any stable alternatives ? Thanx ALI On 2/2/06, Laurie Harper [EMAIL PROTECTED] wrote: Ali Raza wrote: Greetings, Is there any way to determine whether a page has been refresehed ? Is there some object in the request Map or something to indicate that the page has been refreshed from the client instead of actual postback from some submit button ? My problem is that when the page is refreshed the last submit button to be pressed remains in the request map and the corresponding action is performed when the decode method of my cutsom component is called when the page is refreshed... Any help would be much appreciated ... If you use Shale's ViewController feature [1] you get access to a number of life-cycle hooks, including an isPostBack() method you can use to answer this. You may also find useful the setPostBack() method and/or the preprocess() method, which is only called if the request is a postback. L. [1] http://struts.apache.org/struts-shale/features-view-controller.html Thanx A -- A sixteenth century inventor called Wan Hu designed a rocket-propelled chair on which he planned to ascend into heaven. He built an open cabin, to which he fitted 47 rockets underneath and above, and two kites to keep him aloft. Wan Hu disappeared in flame and smoke and was never seen again. A crater on the moon is now named after him, so in one sense he made it to the heavens after all. This is the first recorded design of something approximating to a manned space rocket. The Chinese Space Programme. From Conception to Future Capabilities. Brian Harvey -- A sixteenth century inventor called Wan Hu designed a rocket-propelled chair on which he planned to ascend into heaven. He built an open cabin, to which he fitted 47 rockets underneath and above, and two kites to keep him aloft. Wan Hu disappeared in flame and smoke and was never seen again. A crater on the moon is now named after him, so in one sense he made it to the heavens after all. This is the first recorded design of something approximating to a manned space rocket. The Chinese Space Programme. From Conception to Future Capabilities. Brian Harvey
Re: Problems Upgrading to Nightly
Correct. myfaces-commons contains code common to myfaces and tomahawk, not copies of the commons-* packages. L. James Reynolds wrote: I tried it a few ways. I'm not sure what's all included in myfaces-commons-1.1.2-SNAPSHOT.jar so I tried it with and without all my other commons-files. I take it that it's not a replacement? -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 25, 2006 2:17 PM To: MyFaces Discussion Subject: Re: Problems Upgrading to Nightly On 1/25/06, James Reynolds [EMAIL PROTECTED] wrote: replaced all my commons-xxx.jars with myfaces-commons-1.1.2-SNAPSHOT.jar What jars did you replace? This sounds like you might have removed commons-beanutils, commons-digester, etc. -- Wendy
Re: Oracle Donation (Again)
Martin Marinschek wrote: It is a snapshot of the ADF-faces code, so in this sense, yes, it is ready for production integration. That's a bold statement, given that the code that's been made available doesn't correspond to a released product -- the closest thing to a release was the Early Access distribution of ADF Faces, and the released code is, AFAICT, a later version than contained in EA19. That said, though, I am using these components in a product that will be released well before the Oracle donation works its way through the incubator into MyFaces and reaches a release there. YMMV, but I haven't run into any show-stoppers as yet... L. There might be major changes as we go through the incubator, though... regards, Martin On 1/24/06, Fadil [EMAIL PROTECTED] wrote: Hi all, is it ready for production integration ? Thanks, Fadil On 1/24/06, Sean Schofield [EMAIL PROTECTED] wrote: The ADF stuff is in the very early stages of merging with MyFaces. Oracle has cleared the internal hurdles necessary to make the source publicly available so people are reviewing it. I haven't had time to review it myself yet so don't feel bad if you feel behind the curve on this one. Please explore as much as you can. Eventually the community will have to make some decisions on how to proceed so the more of our users that are familiar with the donation, the better. Regards, Sean On 1/23/06, Jonas Jacobi [EMAIL PROTECTED] wrote: Hi Mike, You can read more about this on Omar's blog Jonas Mike Duffy wrote: Is there a link that gives some information as to what this is all about? Thx. Mike --- Rafael Nami [EMAIL PROTECTED] wrote: THANKS SEAN!! :) 2006/1/23, Sean Schofield [EMAIL PROTECTED] : You can find it here. http://people.apache.org/~bdudney/apache-drop.zip On 1/23/06, Rafael Nami [EMAIL PROTECTED] wrote: Hi everyone I received today the Oracle newsletter about the donation. I checked the SVN repository, but couldn't find anything like Cherokee or something What is the status about the donation (sorry for being a pain in the ass :)) Best Regards Rafael Mauricio Nami __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- Jonas Jacobi Author: Pro JSF and Ajax: Building Rich Internet Components Blog: http://www.orablogs.com/jjacobi -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: How to override the MyFaces 1.1.1 taglib listener registration?
OK, so here's the approach in summary: First, you'll need some way of mapping the view ID derived from the request URL to an actual Facelets view (.xhtml file or whatever). I have an XML file that defines regular expressions to match against the URL and substitution patterns to build the view path, but you may be able to use something simpler. Given that, you can get Facelets to load the view while preserving the original view ID in the component tree. Create a sub-class of FaceletsViewHandler and override the buildView() method. Copy the implementation from the Facelets sources and look for the block that loads the Facelet. You need to change that to load the path you derived from the original view ID, like this: // grab our FaceletFactory and create a Facelet Facelet f = null; FaceletFactory.setInstance(this.localFaceletFactory); try { String viewPath = myMappingFunction( viewToRender.getViewId()); f = this.localFaceletFactory.getFacelet(viewPath); } finally { FaceletFactory.setInstance(null); } The rest of the buildView implementation stays the same as in the Facelets distribution. The only slight glitch is the reference above to localFaceletFactory; since faceletFactory is private in the base FaceletViewHandler class, you have to override createFaceletFactory() like this: protected FaceletFactory createFaceletFactory(com.sun.facelets.compiler.Compiler compiler) { localFaceletFactory = super.createFaceletFactory(compiler); return localFaceletFactory; } in order to get a reference to the facelet factory to use in buildView(). If you need more help getting this working, ping me off-list (since it's a bit off-topic to get into any further here). HTH, L. David G. Friedman wrote: I've been playing with Facelets so I'm all ears. Feel free to backchannel me or to move this to the facelets list if you prefer. Regards, David -Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of Laurie Harper Sent: Thursday, January 12, 2006 10:52 PM To: users@myfaces.apache.org Subject: Re: How to override the MyFaces 1.1.1 taglib listener registration? David, I have a solution for this based on subclassing FaceletsViewHandler; the trick is to map the view ID to a view, load the view to create the component tree, but retain the view ID. It's a little tricky -- and can't be done in a way that's portable, so if you're not using Facelets my solution wont work for you. But if you are using Facelets, and would like the details, let me know. L. David G. Friedman wrote: I don't have control over that option with my hosting provider. I just have JSF (MyFaces) to work with to make everything dynamic. I tried creating the new UIViewRoot with the /hostname/whatever path then resetting it back to /whatever before returning it with CreateViewRoot but that didn't work. It doesn't find the file now so at least I know ViewHandler.createView() isn't the correct place for my logic. *shrug* Regards, David -Original Message- From: Jesse Alexander (KBSA 21) [mailto:[EMAIL PROTECTED] Sent: Thursday, January 12, 2006 1:57 PM To: MyFaces Discussion Subject: RE: How to override the MyFaces 1.1.1 taglib listener registration? Why not use an apache webserver with its url-rewriting capabilities? hth Alexander -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Thursday, January 12, 2006 5:55 PM To: MyFaces Discussion Subject: RE: How to override the MyFaces 1.1.1 taglib listener registration? Ronald, I want to virtual host so the path /hello maps internally to /hostname/hello. I'm trying to do some sort of internal redirect WITHOUT having to put dummy/stub files in the main /WEBAPP folder which would then include the relevant virtual host file(s). So, this kind of cancels out Facelets or Shale/Clay for that very purpose. I've tried making another ViewHandler.createView(context, hostname + viewId) but that ALSO changes the submitted path to /hostname/whatever.jsf instead of retaining it as /whatever.jsf. Now, I'm thinking I can use the servletContextListener to put my own ExternalContext in there so when the JSP calls ExternalContext.dispatch(), I can override that method to invoke /localhost/filename since I won't have a generic /filename setup. I'm open to new ideas and suggestions. I wonder sometimes why I go for the complicated stuff when I program application services. *sigh* Regards, David -Original Message- From: R. Müller [mailto:[EMAIL PROTECTED] Sent: Thursday, January 12, 2006 5:14 AM To: MyFaces Discussion Subject: Re: How to override the MyFaces 1.1.1 taglib listener registration? Hi David, why you want to override - define your own in the web.xml ! listener listener-classmyServletContextListener/listener-class /listener You have to implement
Re: MyFaces + Shale + Facelets
Gary VanMatre wrote: From: Julián García [EMAIL PROTECTED] Hi, I am using Hibernate + Spring + Myfaces. It's been working but I think that I am writing a LOT of code in the view layer. I have a small custom validation framework of my own, and my own init mechanisms in my beans. I use tiles. I'd like to do more templating, and reuse some code out thereI was thinking of: Facelets: to do templating Shale: init mechanisms in beans, client-side validation, Spring integration Any experiencies you want to share combining or using separately this 2 frameworks with MyFaces 1.1.1 Do they have overlapping features? Would you use them both for production? Facelets and Shale Clay do have overlap. Both allow templating, and alternative to JSP. Clay's HTML full view templating allows you to use old school html. I believe that Facelets requires well formed XML. Clay is also unique in that it provides metadata inheritance and symbol replacement overlapping with tiles generic layout features. The Clay full XML veiws could compare to tiles. Clay is based on a component so it can be use within JSP too. Yup, Facelets requires well formed XML. I don't know how it compares to Clay's symbol replacement mechanism, but it does make it easy to define substitutions (e.g. ui:param name=foo value=#{something}/ in a view makes #{foo} an alias for #{something} in the template. {...] I'm a bit bias on the Clay versus Facelets comparison but Shale and Facelets would be a good technology stack too. Yeah, that's what I'm using currently (I started using Facelets before I started using Shale). It works very well. I think that JSF and Spring have some overlap. They both provide IoC. So, if you wanted to reduce the layers in your stack you might go with Shale+Myfaces/Hibernate or iBatis. Spring provides a much more capable IoC solution than Faces alone; I prefer to use it for everything I can, to get things like automatic dependency injection. I'd use it to manage all my beans, but it doesn't have support for scoping beans (i.e. request/session/application scope), so for things that need to be scoped I use Faces. For everything *else* I use Spring :-) L.
Re: How to override the MyFaces 1.1.1 taglib listener registration?
David, I have a solution for this based on subclassing FaceletsViewHandler; the trick is to map the view ID to a view, load the view to create the component tree, but retain the view ID. It's a little tricky -- and can't be done in a way that's portable, so if you're not using Facelets my solution wont work for you. But if you are using Facelets, and would like the details, let me know. L. David G. Friedman wrote: I don't have control over that option with my hosting provider. I just have JSF (MyFaces) to work with to make everything dynamic. I tried creating the new UIViewRoot with the /hostname/whatever path then resetting it back to /whatever before returning it with CreateViewRoot but that didn't work. It doesn't find the file now so at least I know ViewHandler.createView() isn't the correct place for my logic. *shrug* Regards, David -Original Message- From: Jesse Alexander (KBSA 21) [mailto:[EMAIL PROTECTED] Sent: Thursday, January 12, 2006 1:57 PM To: MyFaces Discussion Subject: RE: How to override the MyFaces 1.1.1 taglib listener registration? Why not use an apache webserver with its url-rewriting capabilities? hth Alexander -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Thursday, January 12, 2006 5:55 PM To: MyFaces Discussion Subject: RE: How to override the MyFaces 1.1.1 taglib listener registration? Ronald, I want to virtual host so the path /hello maps internally to /hostname/hello. I'm trying to do some sort of internal redirect WITHOUT having to put dummy/stub files in the main /WEBAPP folder which would then include the relevant virtual host file(s). So, this kind of cancels out Facelets or Shale/Clay for that very purpose. I've tried making another ViewHandler.createView(context, hostname + viewId) but that ALSO changes the submitted path to /hostname/whatever.jsf instead of retaining it as /whatever.jsf. Now, I'm thinking I can use the servletContextListener to put my own ExternalContext in there so when the JSP calls ExternalContext.dispatch(), I can override that method to invoke /localhost/filename since I won't have a generic /filename setup. I'm open to new ideas and suggestions. I wonder sometimes why I go for the complicated stuff when I program application services. *sigh* Regards, David -Original Message- From: R. Müller [mailto:[EMAIL PROTECTED] Sent: Thursday, January 12, 2006 5:14 AM To: MyFaces Discussion Subject: Re: How to override the MyFaces 1.1.1 taglib listener registration? Hi David, why you want to override - define your own in the web.xml ! listener listener-classmyServletContextListener/listener-class /listener You have to implement the 'javax.servlet.ServletContextListener' - Interface with the following two methods : public void contextInitialized(ServletContextEvent e); public void contextDestroyed(ServletContextEvent e); The same if want to listen for sessions. You have to additionally implement the 'javax.servlet.http.HttpSessionListener'-Interface with public void sessionCreated(HttpSessionEvent e); public void sessionDestroyed(HttpSessionEvent e); regards Ronald David G. Friedman wrote: In the MyFaces taglib, it has the listener declaration (which works in my Tomcat 5.0.28 : listener listener-classorg.apache.myfaces.webapp.StartupServletContextListener/listener-class /listener Is there any way to override this other than: a) Edit the taglib file to change it. b) make my own /WEB-INF/classes/org/apache/myfaces/webapp/StartupServletContextListener.java file? Regards, David
Re: NavigationHandler API faces.config
Dave wrote: Is there any way to access faces.config? I need to know the to-view-id(JSP page) given from-view-id and from-outcome. The NavigationHanlder has only one method handle(..), Thanks. Dave Unfortunately not, short of parsing faces-config yourself and re-implementing the algorithm the navigation handler uses. L.
Re: Something like forceId for regular components?
Martin, have you tried changing your selector to #formId\:namingContainerId\:myComponentId i.e. escaping the colons? Martin Marinschek wrote: There is one very, very valid reason for forceId I keep reiterating over and over (me not being a friend of forceId in the firstplace, but very happy to have it after doing some real world JSF-projects): when you style with CSS, you quite often style with respect to the id - the # selector is what is used for this. Now, the JSF generated ids are looking like this: formId:namingContainerId:myComponentId if you use this in your CSS, the selector will become the following: #formId:namingContainerId:myComponentId now, the colon is also the pseudo-class selector in CSS (e.g. a:hover), and I have unsucessfully tried to get this type of selection to run in any current browser - id styling just doesn't work anymore with the JSF approach of designing id's, obviously. Please, please, correct me if I am wrong (I'd be very happy to be corrected regarding this)! regards, Martin On 1/7/06, Volker Weber [EMAIL PROTECTED] wrote: Volker Weber wrote: I think i should read this tread. [1] http://www.mail-archive.com/users@myfaces.apache.org/msg00680.html After reading this, i think there is only one new aspect for me. The problem with porting existing applications to jsf. If those existing application uses javascript with *hardcoded* element ids, which can't be easyly changed to the new naming sheme. This scenario is the only one where i'm (for me) willing to accept the use of forceId. But i fear that the page structure is changing so mutch, when porting to jsf, it will break those scipts anyway. Regards Volker -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address by concatenating my forename to my senders domain. -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Managing List properties: MyFaces vs. RI
Thanks, I'll do that; I figured I'd start out here to see if I could determine what *should* be happening before going on to figure out where the problem actually was. L. Mike Kienenberger wrote: I'd recommend asking on the facelets users mailing list. You'll hit both ADF faces and facelets experts there, and those are the codebases involved. On 1/6/06, Dennis Byrne [EMAIL PROTECTED] wrote: Hmmm ... I'm not seeing anything like org.apache.myfaces.el.VariableResolverImpl or org.apache.myfaces.config.ManagedBeanBuilder in there. You may want to ask Sun and/or Oracle about this one. Sorry. -Original Message- From: Laurie Harper [mailto:[EMAIL PROTECTED] Sent: Friday, January 6, 2006 02:33 PM To: users@myfaces.apache.org Subject: Re: Managing List properties: MyFaces vs. RI Dennis Byrne wrote: Can you please post either of these stack traces? Sure; this is the MyFaces stack trace. I'll post the one from the RI in a separate message. javax.faces.el.PropertyNotFoundException: /templates/mainLayout.xhtml @65,104 value=#{menuModel.model}: Bean: com.foo.projility.web.faces.menu.TreeModelAdapter, property: listInstance at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:58) at oracle.adf.view.faces.bean.FacesBeanImpl.getProperty(FacesBeanImpl.java:55) at oracle.adf.view.faces.component.UIXComponentBase.getProperty(UIXComponentBase.java:1066) at oracle.adf.view.faces.component.UIXMenu.getValue(UIXMenu.java:99) at oracle.adf.view.faces.component.UIXCollection._flushCachedModel(UIXCollection.java:822) at oracle.adf.view.faces.component.UIXCollection.encodeBegin(UIXCollection.java:348) at oracle.adfinternal.view.faces.uinode.UIComponentUINode._renderComponent(UIComponentUINode.java:297) at oracle.adfinternal.view.faces.uinode.UIComponentUINode.render(UIComponentUINode.java:262) at oracle.adfinternal.view.faces.uinode.UIComponentUINode.render(UIComponentUINode.java:239) at oracle.adfinternal.view.faces.ui.BaseRenderer.renderChild(BaseRenderer.java:413) at oracle.adfinternal.view.faces.ui.BaseRenderer.renderNamedChild(BaseRenderer.java:385) at oracle.adfinternal.view.faces.ui.laf.base.desktop.PageHeaderLayoutRenderer._renderTabBar(PageHeaderLayoutRenderer.java:570) at oracle.adfinternal.view.faces.ui.laf.base.desktop.PageHeaderLayoutRenderer.renderContent(PageHeaderLayoutRenderer.java:429) at oracle.adfinternal.view.faces.ui.BaseRenderer.render(BaseRenderer.java:82) at oracle.adfinternal.view.faces.ui.laf.base.xhtml.XhtmlLafRenderer.render(XhtmlLafRenderer.java:67) at oracle.adfinternal.view.faces.uinode.UIXComponentUINode.renderInternal(UIXComponentUINode.java:177) at oracle.adfinternal.view.faces.uinode.UINodeRendererBase.encodeEnd(UINodeRendererBase.java:53) at oracle.adf.view.faces.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:624) at oracle.adfinternal.view.faces.uinode.UIComponentUINode._renderComponent(UIComponentUINode.java:317) at oracle.adfinternal.view.faces.uinode.UIComponentUINode._renderComponent(UIComponentUINode.java:312) at oracle.adfinternal.view.faces.uinode.UIComponentUINode.render(UIComponentUINode.java:262) at oracle.adfinternal.view.faces.uinode.UIComponentUINode.render(UIComponentUINode.java:239) at oracle.adfinternal.view.faces.ui.BaseRenderer.renderChild(BaseRenderer.java:413) at oracle.adfinternal.view.faces.ui.BaseRenderer.renderIndexedChild(BaseRenderer.java:331) at oracle.adfinternal.view.faces.ui.BaseRenderer.renderIndexedChild(BaseRenderer.java:223) at oracle.adfinternal.view.faces.ui.BaseRenderer.renderContent(BaseRenderer..java:130) at oracle.adfinternal.view.faces.ui.laf.base.xhtml.PartialRootRenderer.renderContent(PartialRootRenderer.java:112) at oracle.adfinternal.view.faces.ui.BaseRenderer.render(BaseRenderer.java:82) at oracle.adfinternal.view.faces.ui.laf.base.xhtml.XhtmlLafRenderer.render(XhtmlLafRenderer.java:67) at oracle.adfinternal.view.faces.uinode.UIXComponentUINode.renderInternal(UIXComponentUINode.java:177) at oracle.adfinternal.view.faces.uinode.UINodeRendererBase.encodeEnd(UINodeRendererBase.java:53) at oracle.adf.view.faces.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:624) at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:554) at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:551) at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:551) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:457) at com.foo.projility.web.faces.application.ProjectivaViewHandler.renderView(ProjectivaViewHandler.java:229) at oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:157) at org.apache.shale.clay.faces.ClayViewHandler.renderView
Re: Managing List properties: MyFaces vs. RI
Dennis Byrne wrote: Can you please post either of these stack traces? Sure; this is the MyFaces stack trace. I'll post the one from the RI in a separate message. javax.faces.el.PropertyNotFoundException: /templates/mainLayout.xhtml @65,104 value=#{menuModel.model}: Bean: com.foo.projility.web.faces.menu.TreeModelAdapter, property: listInstance at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:58) at oracle.adf.view.faces.bean.FacesBeanImpl.getProperty(FacesBeanImpl.java:55) at oracle.adf.view.faces.component.UIXComponentBase.getProperty(UIXComponentBase.java:1066) at oracle.adf.view.faces.component.UIXMenu.getValue(UIXMenu.java:99) at oracle.adf.view.faces.component.UIXCollection._flushCachedModel(UIXCollection.java:822) at oracle.adf.view.faces.component.UIXCollection.encodeBegin(UIXCollection.java:348) at oracle.adfinternal.view.faces.uinode.UIComponentUINode._renderComponent(UIComponentUINode.java:297) at oracle.adfinternal.view.faces.uinode.UIComponentUINode.render(UIComponentUINode.java:262) at oracle.adfinternal.view.faces.uinode.UIComponentUINode.render(UIComponentUINode.java:239) at oracle.adfinternal.view.faces.ui.BaseRenderer.renderChild(BaseRenderer.java:413) at oracle.adfinternal.view.faces.ui.BaseRenderer.renderNamedChild(BaseRenderer.java:385) at oracle.adfinternal.view.faces.ui.laf.base.desktop.PageHeaderLayoutRenderer._renderTabBar(PageHeaderLayoutRenderer.java:570) at oracle.adfinternal.view.faces.ui.laf.base.desktop.PageHeaderLayoutRenderer.renderContent(PageHeaderLayoutRenderer.java:429) at oracle.adfinternal.view.faces.ui.BaseRenderer.render(BaseRenderer.java:82) at oracle.adfinternal.view.faces.ui.laf.base.xhtml.XhtmlLafRenderer.render(XhtmlLafRenderer.java:67) at oracle.adfinternal.view.faces.uinode.UIXComponentUINode.renderInternal(UIXComponentUINode.java:177) at oracle.adfinternal.view.faces.uinode.UINodeRendererBase.encodeEnd(UINodeRendererBase.java:53) at oracle.adf.view.faces.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:624) at oracle.adfinternal.view.faces.uinode.UIComponentUINode._renderComponent(UIComponentUINode.java:317) at oracle.adfinternal.view.faces.uinode.UIComponentUINode._renderComponent(UIComponentUINode.java:312) at oracle.adfinternal.view.faces.uinode.UIComponentUINode.render(UIComponentUINode.java:262) at oracle.adfinternal.view.faces.uinode.UIComponentUINode.render(UIComponentUINode.java:239) at oracle.adfinternal.view.faces.ui.BaseRenderer.renderChild(BaseRenderer.java:413) at oracle.adfinternal.view.faces.ui.BaseRenderer.renderIndexedChild(BaseRenderer.java:331) at oracle.adfinternal.view.faces.ui.BaseRenderer.renderIndexedChild(BaseRenderer.java:223) at oracle.adfinternal.view.faces.ui.BaseRenderer.renderContent(BaseRenderer.java:130) at oracle.adfinternal.view.faces.ui.laf.base.xhtml.PartialRootRenderer.renderContent(PartialRootRenderer.java:112) at oracle.adfinternal.view.faces.ui.BaseRenderer.render(BaseRenderer.java:82) at oracle.adfinternal.view.faces.ui.laf.base.xhtml.XhtmlLafRenderer.render(XhtmlLafRenderer.java:67) at oracle.adfinternal.view.faces.uinode.UIXComponentUINode.renderInternal(UIXComponentUINode.java:177) at oracle.adfinternal.view.faces.uinode.UINodeRendererBase.encodeEnd(UINodeRendererBase.java:53) at oracle.adf.view.faces.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:624) at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:554) at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:551) at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:551) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:457) at com.foo.projility.web.faces.application.ProjectivaViewHandler.renderView(ProjectivaViewHandler.java:229) at oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:157) at org.apache.shale.clay.faces.ClayViewHandler.renderView(ClayViewHandler.java:383) at org.apache.shale.faces.ShaleViewHandler.renderView(ShaleViewHandler.java:143) at org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:175) at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:172) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at
Re: Managing List properties: MyFaces vs. RI
Dennis Byrne wrote: Can you please post either of these stack traces? And here's the one from the RI: ERROR [http-8080-Processor25] com.sun.faces.application.ApplicationImpl - Managedbean menuTreeModel could not be created Can't instantiate class: 'instance'. javax.faces.FacesException: Can't instantiate class: 'instance'. at com.sun.faces.config.ManagedBeanFactory.getArrayOrListToSetIntoBean(ManagedBeanFactory.java:661) at com.sun.faces.config.ManagedBeanFactory.setPropertiesIntoBean(ManagedBeanFactory.java:517) at com.sun.faces.config.ManagedBeanFactory.newInstance(ManagedBeanFactory.java:234) at com.sun.faces.application.ApplicationAssociate.createAndMaybeStoreManagedBeans(ApplicationAssociate.java:253) at com.sun.faces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:78) at org.springframework.web.jsf.DelegatingVariableResolver.resolveVariable(DelegatingVariableResolver.java:103) at org.apache.shale.spring.WebApplicationContextVariableResolver.resolveVariable(WebApplicationContextVariableResolver.java:87) at org.apache.shale.faces.ShaleVariableResolver.resolveVariable(ShaleVariableResolver.java:99) at oracle.adfinternal.view.faces.el.AdfFacesVariableResolver.resolveVariable(AdfFacesVariableResolver.java:40) at com.sun.faces.el.impl.NamedValue.evaluate(NamedValue.java:125) at com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:146) at com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:243) at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:173) at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:154) at com.sun.faces.config.ManagedBeanFactory.evaluateValueBindingGet(ManagedBeanFactory.java:903) at com.sun.faces.config.ManagedBeanFactory.setPropertiesIntoBean(ManagedBeanFactory.java:553) at com.sun.faces.config.ManagedBeanFactory.newInstance(ManagedBeanFactory.java:234) at com.sun.faces.application.ApplicationAssociate.createAndMaybeStoreManagedBeans(ApplicationAssociate.java:253) at com.sun.faces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:78) at org.springframework.web.jsf.DelegatingVariableResolver.resolveVariable(DelegatingVariableResolver.java:103) at org.apache.shale.spring.WebApplicationContextVariableResolver.resolveVariable(WebApplicationContextVariableResolver.java:87) at org.apache.shale.faces.ShaleVariableResolver.resolveVariable(ShaleVariableResolver.java:99) at oracle.adfinternal.view.faces.el.AdfFacesVariableResolver.resolveVariable(AdfFacesVariableResolver.java:40) at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:134) at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:44) at com.sun.el.parser.AstValue.getValue(AstValue.java:85) at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:183) at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71) at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56) at oracle.adf.view.faces.bean.FacesBeanImpl.getProperty(FacesBeanImpl.java:55) at oracle.adf.view.faces.component.UIXComponentBase.getProperty(UIXComponentBase.java:1066) at oracle.adf.view.faces.component.UIXMenu.getValue(UIXMenu.java:99) at oracle.adf.view.faces.component.UIXCollection._flushCachedModel(UIXCollection.java:822) at oracle.adf.view.faces.component.UIXCollection.encodeBegin(UIXCollection.java:348) at oracle.adfinternal.view.faces.uinode.UIComponentUINode._renderComponent(UIComponentUINode.java:297) at oracle.adfinternal.view.faces.uinode.UIComponentUINode.render(UIComponentUINode.java:262) at oracle.adfinternal.view.faces.uinode.UIComponentUINode.render(UIComponentUINode.java:239) at oracle.adfinternal.view.faces.ui.BaseRenderer.renderChild(BaseRenderer.java:413) at oracle.adfinternal.view.faces.ui.BaseRenderer.renderNamedChild(BaseRenderer.java:385) at oracle.adfinternal.view.faces.ui.laf.base.desktop.PageHeaderLayoutRenderer._renderTabBar(PageHeaderLayoutRenderer.java:570) at oracle.adfinternal.view.faces.ui.laf.base.desktop.PageHeaderLayoutRenderer.renderContent(PageHeaderLayoutRenderer.java:429) at oracle.adfinternal.view.faces.ui.BaseRenderer.render(BaseRenderer.java:82) at oracle.adfinternal.view.faces.ui.laf.base.xhtml.XhtmlLafRenderer.render(XhtmlLafRenderer.java:67) at oracle.adfinternal.view.faces.uinode.UIXComponentUINode.renderInternal(UIXComponentUINode.java:177) at oracle.adfinternal.view.faces.uinode.UINodeRendererBase.encodeEnd(UINodeRendererBase.java:53) at oracle.adf.view.faces.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:624) at oracle.adfinternal.view.faces.uinode.UIComponentUINode._renderComponent(UIComponentUINode.java:317) at oracle.adfinternal.view.faces.uinode.UIComponentUINode._renderComponent(UIComponentUINode.java:312) at
Re: [Studio Creator]How to use 3rd party taglib in jsf pages
Legolas Woodland wrote: Hi Thank you for reading my post. Can some one please help me to add a taglib to my jsf page ? Im using Creator 2 EA 2 , I add all jar files to its build path and also to web-inf/lib now when i add the taglib definition to a page it say : The markup in the document preceeding the root element must be well formed Here is how i add the taglib which IDE return the above error : *Image 1* now if i move the taglib definition after Root element it say : *Image2* Is it a problem regard to Chart Creator tag lib , or JSF has its own method of declaring taglib uri ? You're trying to mix JSP syntax and XML syntax. You should be declaring the taglib with the XML namespace (xmlns) syntax, the same way the other taglibs are already referenced: jsp:root ... xmlns:c=http://some/url; where 'http://some/url' is whatever URL is defined in the TLD file. L.
model update failing, I can't see why
I have this really weird problem I can't explain. I'm hoping someone can give me some insight. The problem is that my backing bean isn't being updated properly during the update model phase, *unless* I include a hidden input. With the source listed below it works fine, but if I remove the h:inputHidden I get a call to getDescription() instead of setDescription(). The action for the h:commandButton fires, but because the model hasn't been updated it has no effect. Here's the code: h:commandButton value=#{msgs['label.Save']} action=#{backing.save}/ h:inputText id=description value=#{backing.project.description} rendered=#{backing.renderMode eq 'edit'}/ h:inputHidden id=mode value=edit rendered=#{backing.renderMode eq 'edit'}/ h:outputText value=#{backing.project.description} rendered=#{not empty backing.project and backing.renderMode eq 'view'}/ As I say, as long as I have that hidden input everything's fine. I have an h:messages in my view and it's not showing any conversion or validation errors, with or without the hidden input. I don't understand :-( Any help would be appreciated! L.
Re: model update failing, I can't see why
Dennis Byrne wrote: During the render response phase of the first request, #{backing.project.description} will be rendered as the value of [EMAIL PROTECTED] if #{backing.renderMode eq 'edit'} . OK, this makes sense; I have an action method to initiate editting which sets renderMode to 'edit' then forwards to the view, satisfying this condition. However the value for [EMAIL PROTECTED] (coming back from the browser) will not be assigned back to #{backing.project.description} if #{backing.renderMode eq 'edit'} is false during the second request. This is probably the case if #{backing} is in request scope and the renderMode property is not initialized to 'edit' . In other words, it sounds as though you want backing.renderMode to be a conversation piece . Apparently the hidden input field is accomplishing this for you. You may want to look into t:saveState as an alternative. I'm not sure what you mean by 'conversation peice' but I think I understand what you're saying. The backing bean is in request scope and renderMode defaults to 'view' if there isn't a request parameter to set it to something else. So when the form is submitted and the component tree (re)built, the [EMAIL PROTECTED] will be excluded due to its rendered property evaluating to false. And that's the reason the model update doesn't happen? Also note that the call to getDescription() is going to happen whether #{backing.renderMode eq 'edit'} or #{not empty backing.project and backing.renderMode eq 'view'} evaluate to true during the render response phase of any request. This is because #{backing.project.description} is set for @value for both the inputText and the outputText. You may have to read this more than once ;) Er, a couple of times :-) Yes, it makes sense; either getDescription() will be called to render the outputText (view) or it will be called to render the inputText (edit). And because (without the hidden field) renderMode is effectively not preserved through the whole 'edit operation' (initial render and subsequent submit), the inputText gets replaced with an outputText at the wrong stage. Gak, I'm not sure I made much sense myself there :-) But I do think I understand what's going on now, thanks. I'll look into saveState and see if it provides a nicer solution than the hidden input -- or if I can avoid both by including the request parameter in the view ID, which is where I intend to end up to support bookmarking. L. -Original Message- From: Laurie Harper [mailto:[EMAIL PROTECTED] Sent: Thursday, January 5, 2006 04:01 PM To: users@myfaces.apache.org Subject: model update failing, I can't see why I have this really weird problem I can't explain. I'm hoping someone can give me some insight. The problem is that my backing bean isn't being updated properly during the update model phase, *unless* I include a hidden input. With the source listed below it works fine, but if I remove the h:inputHidden I get a call to getDescription() instead of setDescription(). The action for the h:commandButton fires, but because the model hasn't been updated it has no effect. Here's the code: h:commandButton value=#{msgs['label.Save']} action=#{backing.save}/ h:inputText id=description value=#{backing.project.description} rendered=#{backing.renderMode eq 'edit'}/ h:inputHidden id=mode value=edit rendered=#{backing.renderMode eq 'edit'}/ h:outputText value=#{backing.project.description} rendered=#{not empty backing.project and backing.renderMode eq 'view'}/ As I say, as long as I have that hidden input everything's fine. I have an h:messages in my view and it's not showing any conversion or validation errors, with or without the hidden input. I don't understand :-( Any help would be appreciated! L.
Re: model update failing, I can't see why
Dennis Byrne wrote: Er, a couple of times :-) Yes, it makes sense; either getDescription() will be called to render the outputText (view) or it will be called to render the inputText (edit). And because (without the hidden field) renderMode is effectively not preserved through the whole 'edit operation' (initial render and subsequent submit), the inputText gets replaced with an outputText at the wrong stage. BTW, I have a project that does the whole edit/insert/view mode trick also. Be careful with outputText where @value is set to a request scope EL value. Everything will work until you have a form where validation fails (model is not updated, so output for outputText is nothing.) This is another reason to check out t:saveState. saveState restores during the first phase of the request. Well the way things are setup now, the backing bean is request scoped but any output data generally gets loaded from the database at the start of the JSF life-cycle (using init() in a Shale ViewController). So, in cases where I need to output something, I know I'll have it there. Isn't what you're talking about only an issue if I go from a view with an input component to one that expects to display the input value, rather than validation returning to the same view that has the input component? Not sure I follow what the gotcha is... L.
Re: Something like forceId for regular components?
Marti, Adrian (Adrian) wrote: Hello all, First post, hopefully not too common a question. Working on a project with a lot of preexisting javascript functions where the id's of components need to be exactly what is expected. JSF seems to want to prefix all of my component id's with the form id. Such as h:form id=acctform h:inputText id=firstInput ... / ... /h:form Will show up in the html with an id=acctform:firstInput. This obviously breaks the javascript. I have found the forceId attribute for Tomahawk components but haven't seen anything for the regular components. Anyone have any advice? ADF Faces provides a form component that isn't a naming container, for exactly this reason. You might consider taking MyFaces' implementation of h:form as a starting point and creating your own equivalent. Not sure how involved that would be. L.
Custom NavigationHandler
I was just looking at implementing a custom navigation handler. I need to basically replace the standard implementation with my own to extend the semantics. I thought I'd start with the MyFaces implementation and just tweak it to do what I need. But NavigationHandlerImpl depends on a bunch of other MyFaces implementation classes, including ones that represent the individual navigation rules/cases. This leads me to suspect that there's no standard, portable way to implement a navigation handler that *replaces* the default one rather than just decorating it. Is that true, or are there portable equivalents to the implementation APIs that I can use to get at the application's navigation rules? L.
Managing List properties: MyFaces vs. RI
I seem to have stumbled into a mini-constellation of inter-related and conflicting bugs between MyFaces (1.1.1) and the RI (1.1_01) around configuring managed List properties. Perhaps someone can help me figure out what the correct behaviour(s) should be so I can identify which are bugs in each implementation :-) So, given a managed bean with the following declaration: managed-property property-namelistInstance/property-name !--property-nameinstance/property-name-- list-entries value-class.../value-class value#{bean1}/value value#{bean2}/value value#{bean3}/value /list-entries /managed-property where the bean has the following accessors/setters defined: public Object getInstance() { ... } public void setInstance(Object instance) { ... } public void setListInstance(List instance) { setInstance(instance); } I have to change the managed property name according to which impl. I deploy: with MyFaces, I have to set the 'instance' property. If I try and set 'listInstance' it behaves as though the setListInstance method weren't defined. With the RI, on the other hand, I have to set 'listInstance'. It throws an exception if I try to set 'instance'. (I'm assuming that's why the setListInstance setter alias was added in the first place). MyFaces has the additional behaviour that, after throwing the exception, it appears to instantiate and configure this bean a bunch more times, but without attempting to set the 'listInstance' property again -- as if it's marking the property invalid and ignoring it on subsequent requests for the bean? I'm really confused about that. The bean has scope 'none' but is only referenced by one other bean, as an injected dependency, and that bean has session scope. So, what is the correct method signature for a setter for a managed property that takes a List, and why do the two impls behave so differently? Which one is correct? (I'm fully willing to believe I'm doing something invalid, I just can't find a combination that works in both MyFaces and the RI). L.
Re: model update failing, I can't see why
Dennis Byrne wrote: So, in cases where I need to output something, I know I'll have it there. Isn't what you're talking about only an issue if I go from a view with an input component to one that expects to display the input value, rather than validation returning to the same view that has the input component? What I mean is, the inputHidden trick is good at recycling the value across requests. JSF ushers it back and forth between the model and the rendered output. But when a validation error occurs, during the process validation phase (3), the request goes straight to render response (6) - w/out the update model phase. Unfortunately there are things in your view that render based upon model values (input fields in 'edit' mode, plain text in 'view' mode). This affects other things, like your [EMAIL PROTECTED], which would probably be blank if you weren't using that crazy Shale stuff ;) Ah, right, got you. Well, once I get the navigation handler stuff I'm working on going it'll be even less of an issue; that renderMode flag will be driven by the view ID rather than request scoped data :-) But this is good stuff to keep in mind. Thanks for the patient explanations! L.
Re: Custom NavigationHandler
Craig McClanahan wrote: On 1/5/06, Laurie Harper [EMAIL PROTECTED] wrote: I was just looking at implementing a custom navigation handler. I need to basically replace the standard implementation with my own to extend the semantics. I thought I'd start with the MyFaces implementation and just tweak it to do what I need. But NavigationHandlerImpl depends on a bunch of other MyFaces implementation classes, including ones that represent the individual navigation rules/cases. This leads me to suspect that there's no standard, portable way to implement a navigation handler that *replaces* the default one rather than just decorating it. Is that true, or are there portable equivalents to the implementation APIs that I can use to get at the application's navigation rules? That's correct ... there is no standard API for getting to the navigation rules configuration information (or the managed beans configuration information for that matter). Mph, damn. I guess I can always re-parse the faces-config.xml (I only need to worry about my own navigation rules), though there's some overhead in having those rules processed a second time if I delegate to the parent nav handler when I don't find a match. I think for now I'll just tie myself to the MyFaces implementation and flag it as something I need to address if I ever need to switch back to the RI. Thanks for the tip, L.
Re: [Studio Creator] Re: Can we use several package of jsf components together ?
Craig McClanahan wrote: On 12/31/05, Matthias Wessendorf [EMAIL PROTECTED] wrote: Hi Legolas, I haven't used Studio Creator w/ MyFaces' tomahawk (or sandbox). But you should be able (as Alexandre pointed out) to *use* MyFaces stuff in Creator. Currently there is no *design time* support for Creator from our side. Craig mentioned by time, that one of his fellow-workers blogged (or just wrote a *normal* article) about howto write that Creator specific design time support. On that topic, I'm interested in working on the design time support for the MyFaces components, so that they run nicely in Creator, and contributing it back to the MyFaces project. We get this request (MyFaces components with Creator) from time to time on the Creator forums, and I've seen it increasingly here as well. Would that be of interest to people here? It'd be interesting to me :-) I thought about doing this myself but got side tracked looking at ADF Faces, then switched to jDeveloper as it already has this design time support for ADF Faces... I'm probably going to switch back to Tomahawk instead of ADF Faces as ADF apparently can't cope with a user agent with no Javascript support :-( If I do, I'll reevaluate jDeveloper vs. Creator and may well be willing to help out with this. L.
Re: Good JSF Books
Greg Reddin wrote: Hi, I'm looking for some good JSF books. However, I want more than just This is how it works. I'd really like to find books that talk about Here are some good patterns and here are some antipatterns. I've looked at Core JSF and it looks pretty good, but seems to contain more of the This is how it works content at first glance. Can anyone share your experiences with this and other JSF books? Personally, I'm looking forward to Pro JSF and Ajax: Building Rich Internet Components [1]. Don't have any 'currently available' suggestions for you though. L. [1] http://www.apress.com/book/bookDisplay.html?bID=10044
Re: JSF support East Asian characters ?
Does the browser(IE) or inputText do the encoding of characters? If the inputText component has an initial value, it will be encoded server-side using the view's output encoding. When you submit the form, the browser will encode the current value of the inputText using whatever encoding it chooses to submit with -- usually the same as the encoding of the page containing the form. I set the browser(IE) encoding to Unicode before typing the East Asia characters, after submit, the browser encoding changed to Western Europe(ISO). So it looks like you're sending the browser a page that's encoded as ISO-8859-something, not UTF-8. That wont work for Asian characters, of course. From browser view/source, CONTENT=text/html;charset=UTF-8 it says UTF-8. That's in your 'meta' tag in the HTML 'head'? What do you have in your JSP to specify the page encoding, other than the meta tag? Are you using a page directive? The meta tag is not enough by itself to tell the JSP engine to use UTF-8 encoding. The JSP engine needs to know the correct output encoding to use. If it's using one encoding (ISO-8859-?), but your meta tag specifies the page uses a different encoding (UTF-8), things are going to get messed up; the data is sent in IS0-8859-? but the browser is trying to decode it using UTF-8. L. Dave wrote: In my configuration I have only English. The locale config is for resource bundle. But the problem I have is the East Asia input and display, not locale support. I can type East Aisa characters such as Chinese into the inputText without problems, but when they display back after submit, the characters becomes something like: 3435;3489;3988;8987; They seemed to be encoded somehow. Does the browser(IE) or inputText do the encoding of characters? Thanks. -- application locale-config default-localede/default-locale supported-localede/supported-locale supported-localeen/supported-locale /application Thomas Spiegl [EMAIL PROTECTED] wrote: Did you add a locale-config to your faces-config.xml ? de de en Thomas On 12/23/05, Dave wrote: I have a [input] . when I type some East Asia characters into it, they are displaying correctly. But after clicking submit button, they did not show back correctly. One thing I noticed. I set the browser(IE) encoding to Unicode before typing the East Asia characters, after submit, the browser encoding changed to Western Europe(ISO). From browser view/source, CONTENT=text/html;charset=UTF-8 it says UTF-8. Note: submit did not store data in database, everything is in memory. Browser does character conversion ? or JSF does some conversion? Confused !! What needs to be done for JSF web application to support characters other than English? Thanks in advance for advice. Dave Yahoo! DSL Something to write home about. Just $16.99/mo. or less -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces - Yahoo! for Good - Make a difference this year.
Re: jsf analogy to struts action
But what about if you need to do this for the initial page? (i.e. you don't have a page to put a command link on...) I want this to be able to have bookmarkable URLs in my app, where different URLs may map to the same view (JSP) -- for example, URLs /app/users/tom and /app/users/jim would both be served by /pages/user.jsp, and 'tom' or 'jim' would be passed into the JSP as a request attribute/parameter. The only way I've figured out so far to do this sort of thing is to write a front-controller servlet that does the mapping from logical URLs to physical JSPs and uses requestDispatcher.forward() to pass control off to the Faces servlet. It's been suggested that writing a custom navigation handler might be another route to go; I haven't had a chance to explore that yet. L. Mike Kienenberger wrote: UICommand action=#{bean.process} // On bean public String process() { // process if (result1) return processResult1; if (result2) return processResult2; if (result3) return processResult3; if (result4) return processResult4; return processResultDefault; } On 12/20/05, tony kerz [EMAIL PROTECTED] wrote: at the risk of asking a stupid question: if i wanted to have a user hit a url and have some processing take place which then results in one of several available pages being displayed, in struts i could easily accomplish that with an action class. what would be the appropriate way to accomplish that functionality in a JSF application? something like dropping into an action method on a backing bean, but without the initial page...
Re: jsf analogy to struts action
Oops, spoke too soon... the trouble with the servlet approach is that to-view-id in faces-config isn't a context relative path, it's relative to the Faces servlet... So I guess it's time to dig into custom nav handlers. L. Laurie Harper wrote: But what about if you need to do this for the initial page? (i.e. you don't have a page to put a command link on...) I want this to be able to have bookmarkable URLs in my app, where different URLs may map to the same view (JSP) -- for example, URLs /app/users/tom and /app/users/jim would both be served by /pages/user.jsp, and 'tom' or 'jim' would be passed into the JSP as a request attribute/parameter. The only way I've figured out so far to do this sort of thing is to write a front-controller servlet that does the mapping from logical URLs to physical JSPs and uses requestDispatcher.forward() to pass control off to the Faces servlet. It's been suggested that writing a custom navigation handler might be another route to go; I haven't had a chance to explore that yet. L. Mike Kienenberger wrote: UICommand action=#{bean.process} // On bean public String process() { // process if (result1) return processResult1; if (result2) return processResult2; if (result3) return processResult3; if (result4) return processResult4; return processResultDefault; } On 12/20/05, tony kerz [EMAIL PROTECTED] wrote: at the risk of asking a stupid question: if i wanted to have a user hit a url and have some processing take place which then results in one of several available pages being displayed, in struts i could easily accomplish that with an action class. what would be the appropriate way to accomplish that functionality in a JSF application? something like dropping into an action method on a backing bean, but without the initial page...