Re: Problem with Link from JSP to JSF Form
Sounds like your managed beans might not have proper scope - but it is hard to tell from your description. In any case, there should not be a difference between the two use-cases. regards, Martin On 7/17/08, Mark Lange [EMAIL PROTECTED] wrote: Hi, I have a JSF form, that forwards to an JSP. In the JSP is a normal html link that points back to the jsf form. When an user submits the jsf form with all the required fields, the user is forwarded to the jsp, when the user now clicks on the link the user comes back to the jsf form and all filled in values are correct recovered. But when the user submits the form without filling all required fields and then correct the errors and resubmit the form, the user is forwarded to the jsp. But when the user now clicks on the link the jsf form is empty. When I change the JSP to JSF and the backlink to an commandLink, the formvalues are recovered correct in both cases, but this is not an alternative for me. How can I fix this? Thanks mark -- View this message in context: http://www.nabble.com/Problem-with-Link-from-JSP-to-JSF-Form-tp18506987p18506987.html Sent from the MyFaces - Users mailing list archive at Nabble.com. -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Problem with multiple commandLinks and IE
Hi Roland, sounds like a known bug that has been fixed. Which version of MyFaces are you using? regards, Martin On 7/18/08, Roland Hammerle [EMAIL PROTECTED] wrote: Hi there, I have a page that contains two commandLinks: h:commandLink value=#{msgs.button_export} action=#{reportTemplateMgmt.exportReportTemplate} styleClass=button f:param name=objectId value=#{reportTemplate.id}/ /h:commandLink h:commandLink value=#{msgs.button_generate} onclick=openPopup() styleClass=button/ The first link generates a file on the server that the user can then save with the usual save/open dialog box of IE. The page does not get refreshed. The second link opens a popup window and also causes the parent window to reload because the onclick is extended with oamSubmitForm. There is an interesting problem with this on IE 7 (works fine in FireFox): When the user clicks on the first link the file is offered for saving/opening. When he then clicks on the second link the popup window is openend. However, the first link is also executed. I think the reason for this is because the first link sets the hidden element formName + : + _clid as found in oamSubmitForm. When the user clicks on the second link this hidden element is set again. However, for some reason IE cannot find the element in the form and adds another hidden input field for this element. I put a few debug statements in a copy of oamSetupForm to check what's going on. The function oamSetupForm uses the following line to check whether the hidden element is already in the form: if(typeof form.elements[name]=='undefined') This, in fact, returns undefined. When I manually walk through all elements in the form using var els = form.elements; for (var i = 0; i els.length; i++) { } then the element is found. I could not reproduce this behaviour in a simple test file. It would always find the hidden element after it had been added. Since the linkId of the first link is sent together with the linkId of the second link both get executed. Did anyone else encounter this problem? What's the best way to solve this? Thanks, Roland -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Session timeout results in javax.faces.application.ViewExpiredException
Hi, yes, I would dare to say this is expected behaviour, if you do a post-back (if you execute a get-link, then this shouldn't happen). In your web-application, you will need to cover the case of a timed-out session appropriately. regards, Martin On 7/18/08, bansi [EMAIL PROTECTED] wrote: I am using Myfaces 1.2.2 ( JSF 1.2) and PhaseListener approach as suggested by Cagatay Civici in one of his articles i.e. http://cagataycivici.wordpress.com/2005/12/30/jsf_with_ajax_phase_listener/ If the session times out, JSF throws a ViewExpiredException during the RESTORE_VIEW phase. Here is the snippet from my LoginPhaseListener. The exception is thrown from afterPhase method /** * After phase. * * @param pe *the pe * @see javax.faces.event.PhaseListener#afterPhase(javax.faces.event.PhaseEvent) */ public void afterPhase(final PhaseEvent pe) { final FacesContext facesContext = pe.getFacesContext(); final String viewId = pe.getFacesContext().getViewRoot().getViewId();// Throws Exception if (viewId.endsWith(login.xhtml)) { final String managedBeanName = getManagedBeanNameFromView(viewId); final Object object = facesContext.getApplication().createValueBinding(#{ + managedBeanName + }) .getValue(facesContext); if (object == null) { logger.error(OnPageLoad cannot be executed, no such managed bean: + managedBeanName); } else { final Login loginBean = (Login) object; loginBean.onPageLoad(); } } else { final String managedBeanName = getManagedBeanNameFromView(viewId); final String BackingBeanName = managedBeanName.substring(0, 1).toUpperCase() + managedBeanName.substring(1, managedBeanName.length()); } } /** * Gets the managed bean name from view. * * @param viewId *the view id * @return the managed bean name from view */ public String getManagedBeanNameFromView(final String viewId) { String pageName; if (viewId.endsWith(login.xhtml)) { pageName = viewId.substring(1, viewId.length() - 6); } else { pageName = viewId.substring(1, viewId.length() - 10); } return pageName + Bean; } Here is the stack trace 2008-07-15 10:31:12,192 ERROR [org.apache.myfaces.lifecycle.PhaseListenerManager] - Exception in PhaseListener RESTORE_VIEW(1) afterPhase java.lang.NullPointerException at com.boeing.nmt.nams.view.util.LoginPhaseListener.afterPhase(LoginPhaseListener.java:47) at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:92) at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:107) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:148) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:147) at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:256) at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:362) at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:488) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.boeing.nmt.nams.view.util.SecurityFilter.doFilter(SecurityFilter.java:59) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at
Re: Session timeout results in javax.faces.application.ViewExpiredException
Hi, you should probably write a filter or a phase-listener to deal with session-timeouts appropriately. regards, Martin On Fri, Jul 18, 2008 at 7:01 PM, bansi [EMAIL PROTECTED] wrote: Hi Martin Thanks for sharing your thoughts. My web.xml doesnt have any configuration related to session timeout so i guess its uses default timeout. A code snippet on how to do a post-back will be greatly appreciated Martin Marinschek wrote: Hi, yes, I would dare to say this is expected behaviour, if you do a post-back (if you execute a get-link, then this shouldn't happen). In your web-application, you will need to cover the case of a timed-out session appropriately. regards, Martin On 7/18/08, bansi [EMAIL PROTECTED] wrote: I am using Myfaces 1.2.2 ( JSF 1.2) and PhaseListener approach as suggested by Cagatay Civici in one of his articles i.e. http://cagataycivici.wordpress.com/2005/12/30/jsf_with_ajax_phase_listener/ If the session times out, JSF throws a ViewExpiredException during the RESTORE_VIEW phase. Here is the snippet from my LoginPhaseListener. The exception is thrown from afterPhase method /** * After phase. * * @param pe *the pe * @see javax.faces.event.PhaseListener#afterPhase(javax.faces.event.PhaseEvent) */ public void afterPhase(final PhaseEvent pe) { final FacesContext facesContext = pe.getFacesContext(); final String viewId = pe.getFacesContext().getViewRoot().getViewId();// Throws Exception if (viewId.endsWith(login.xhtml)) { final String managedBeanName = getManagedBeanNameFromView(viewId); final Object object = facesContext.getApplication().createValueBinding(#{ + managedBeanName + }) .getValue(facesContext); if (object == null) { logger.error(OnPageLoad cannot be executed, no such managed bean: + managedBeanName); } else { final Login loginBean = (Login) object; loginBean.onPageLoad(); } } else { final String managedBeanName = getManagedBeanNameFromView(viewId); final String BackingBeanName = managedBeanName.substring(0, 1).toUpperCase() + managedBeanName.substring(1, managedBeanName.length()); } } /** * Gets the managed bean name from view. * * @param viewId *the view id * @return the managed bean name from view */ public String getManagedBeanNameFromView(final String viewId) { String pageName; if (viewId.endsWith(login.xhtml)) { pageName = viewId.substring(1, viewId.length() - 6); } else { pageName = viewId.substring(1, viewId.length() - 10); } return pageName + Bean; } Here is the stack trace 2008-07-15 10:31:12,192 ERROR [org.apache.myfaces.lifecycle.PhaseListenerManager] - Exception in PhaseListener RESTORE_VIEW(1) afterPhase java.lang.NullPointerException at com.boeing.nmt.nams.view.util.LoginPhaseListener.afterPhase(LoginPhaseListener.java:47) at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:92) at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:107) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:148) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:147) at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:256) at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:362) at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:488) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198
Re: SaveState and getViewRoot errors
Hi Marcello, you are getting at the view-root in your m-bean constructor like this FacesContext.getCurrentInstance().getViewRoot(); ? This will return null in the cases where the view has not been created/set yet. The question is now when your constructor is called - you can easily debug your code to find out, put a break-point in the constructor. I would imagine you are in the restore-view-phase, and the view has not yet been created or set into the FacesContext. Generally, I don't see why you do this in the constructor - you should not initialize anything in your constructor really. regards, Martin
Re: Using t:dataList with Ajax4JSF
Hi Matt, attention - your fix will not always work as expected. What you effectively do is you evaluate the value-binding once, and then set the retrieved value locally. So the value-binding will only be evaluated on the _first_ request. You should also override the getters and setters, and do the normal JSF stuff in them. regards, Martin On 4/10/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Fix if anyone's interested : public class HtmlDataList extends org.apache.myfaces.custom.datalist.HtmlDataList { public Object saveState(FacesContext context) { Object [] values = new Object[2]; values[0] = super.saveState(context); values[1] = getItemStyleClass(); return values; } public void restoreState(FacesContext context, Object state) { Object [] values = (Object[])state; super.restoreState(context, values[0]); setItemStyleClass((String)values[1]); } } Then just override it in your config file : component component-typeorg.apache.myfaces.HtmlDataList/component-type component-classcom.sag.ibee.web.gui.component.datalist.HtmlDataList/component-class /component Just tested and it works fine for me. De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Envoyé : jeudi 10 avril 2008 15:35 À : users@myfaces.apache.org Objet : RE: Using t:dataList with Ajax4JSF Ok I found the problem already, this would appear to be a bug with Tomahawk (as I have the source attached here). Looks like itemStyleClass was omitted from the saveState method. When I was debugging this I noticed the value for it was null. Listing from HtmlDataList.java public Object saveState(FacesContext context) { Object values[] = new Object[17]; values[0] = super.saveState(context); values[1] = _layout; values[2] = _rowIndexVar; values[3] = _rowCountVar; values[4] = _onclick; values[5] = _ondblclick; values[6] = _onkeydown; values[7] = _onkeypress; values[8] = _onkeyup; values[9] = _onmousedown; values[10] = _onmousemove; values[11] = _onmouseout; values[12] = _onmouseover; values[13] = _onmouseup; values[14] = _style; values[15] = _styleClass; values[16] = _title; return values; } As you can see itemStyleClass is not there. I'm using MyFaces 1.1.5, not sure if this problem exists in 1.2 but we're not upgrading at this point. I guess for now I'll just override this component to make it work. I'll see about opening a proper bug maybe? I haven't done so before so I'm not sure what the process is for that. De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Envoyé : jeudi 10 avril 2008 15:23 À : users@myfaces.apache.org Objet : Using t:dataList with Ajax4JSF Hi, I have a small problem with t:dataList and Ajax4JSF. I'm going to step through this in the debugger soon but maybe someone's already encountered this. I have a t:dataList like so: t:dataList id=dataList var=element value=#{mbDataList.folderList} layout=unorderedList styleClass=DataList itemStyleClass=DataList Elsewhere I'm doing some Ajax4JSF action and I pass dataList to be rerendered. For the most part it rerenders correctly except it seems to omit the 'itemStyleClass=DataList' attribute. The data gets updated, but the formatting gets broken since the lis don't have their class attribute anymore. Thanks, Matt -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Can a JSF page be in database?
... or component-binding! regards, Martin On 4/11/08, Rafa Pérez [EMAIL PROTECTED] wrote: I don't know what you want to achieve by reading the jsp from a database. If you need dinamically added pieces maybe you could use jsp:include, iframes or facelets ui:composition. On Fri, Apr 11, 2008 at 1:29 PM, Anton Gavazuk [EMAIL PROTECTED] wrote: What I like to achieve is layout design that can be dynamically added Maybe its better to write custom component/filter for adding dynamic option Using DB for storing UI components - as for me its very ugly. 2008/4/11, [EMAIL PROTECTED] [EMAIL PROTECTED]: Hi A JSF page is a JSP page which again gets compiled into a .java class - So: No, you can't do that unless you start messing with the jsp compiler. A possible (but not recommended soulution) is to have a filter that loads the file from database and writes it to disc. Then some of the jsp compilers will see that a change has been made and then recompile it. You would be better off looking at (Shale) Clay or Facelets. Hermod -Original Message- From: Dave [mailto:[EMAIL PROTECTED] Sent: Friday, April 11, 2008 7:26 AM To: users@myfaces.apache.org Subject: Can a JSF page be in database? Hi, Normally JSF pages are package in a war file. Is it possbile to put a JSF page in database, and loaded dynamically and rendered? What I like to achieve is layout design that can be dynamically added. Thanks for any idea. Dave __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: ErrorPageWriter causes Facelets/MyFaces confusion
Open a jira-issue. regards, Martin On 4/9/08, Michael Heß [EMAIL PROTECTED] wrote: Hi list, I just stumbled upon some weired problem. I have a rather basic myfaces 1.2.2 + facelets 1.1.3 setup. What I tried to achieve, is to NOT have either Facelets nor MyFaces handle any of the error 500 scenarios. Right now, in case of error 500 I have a facelets error page. An Error Occured, and collapsable trees for the components etc. You know the drill. So I decided to disable debugging in facelets, by switching context-parameter facelets.DEVELOPMENT to false. This was the first moment I got confused, because devmode was already disabled. BUT: The error page definetly states Generated by Facelets in the lower right corner. I spent the last hour tracking this down. So far I have confirmed that the FaceletsViewHandler does not trigger the generation of said errorpage. So I searched some more, and found javax.faces.webapp._ErrorPageWriter to be the culprit. The problem is, that it seems to be a copy of the Facelets DevTools class. And furthermore the filename of the error-template has been copied as well. It's META-INF/rsc/facelet-dev-error.xml on both myfaces as well as facelets. I have checked the template included with myfaces and it is clearly different from the one included with facelets. So my best guess right now (I have not confirmed this any further) is, that MyFaces loads the template from facelets.jar due to some unlucky webapp classloader situation. Although the solution to my current problem is most likely to just disable debugging in myfaces as well, I would like to strongly advise to change the filename of the MyFaces error-template. This really confused me a lot. :-) Is this a known issue? Otherwise I will open a bug for this on jira, to document it properly. bye, Michael -- Michael Heß Senior Consultant ORDIX AG Westernmauer 12-16 33098 Paderborn http://www.ordix.de Tel.: 05251 / 10 63 0 Fax : 05251 / 10 63 99 Mob : 0163 /673 49 43 ORDIX AG - Aktiengesellschaft für Softwareentwicklung, Schulung, Beratung und Systemintegration Vorsitzender des Aufsichtsrates: Prof. Dr. Hermann Johannes Vorstand: Wolfgang Kögler (Vorsitzender), Benedikt Georgi, Christoph Lafeld, Axel Röber Firmensitz: Westernmauer 12 - 16, 33098 Paderborn, Tel: 05251 / 1063-0, Fax: 0180 / 1 67 34 90 Amtsgericht Paderborn, HRB 2941, Ust-IdNr.DE 126333767, Steuernummer: 339/5866/0142 -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: commandButton action not executed
Hi Scott, you need the rendered property to remain constant over requests. What you could do: - use t:saveState - use a conversation scope regards, Martin On Wed, Apr 2, 2008 at 7:15 PM, Scott Belnap [EMAIL PROTECTED] wrote: todoListBean is request scoped not session scoped. Is there anyway to use a request scoped bean in this case? Thanks. On Wed, 2008-04-02 at 11:10 -0600, Andrew Robinson wrote: Is todoListBean session scoped? If your todoList is not available during decode, the rendered will fail and non-rendered components are not decoded. On Wed, Apr 2, 2008 at 10:54 AM, Scott Belnap [EMAIL PROTECTED] wrote: I have a page that has the following commandButton. h:commandButton value=Update List action=#{todoListBean.update} rendered=#{todoListBean.todoList.listId ne 0} / When I click on the button it doesn't execute the action it just refreshes the page. But if I remove the rendered property so the commanButton tag looks like: h:commandButton value=Update List action=#{todoListBean.update} / jsf will execute the action #{todoListBean.update}. Does anyone know why when I have the rendered property in the jsf tag the action doesn't get executed? -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: orchestra conversation closed by stylesheet
To sum it up: Orchestra is certainly not to blame here, this is a RichFaces bug. @Mario: your comment makes sense, we all should certainly try to work around bugs in other libraries! regards, Martin On Tue, Apr 1, 2008 at 12:38 AM, Scott O'Bryan [EMAIL PROTECTED] wrote: Configurators work off of a custom FacesContext. It works very well. Mario Ivankovits wrote: Hi! Weblets for instance allows a zeroconf resource loading via phase listeners which trigger, usually this triggering is done before phase1, but there are portlet cases where it happens later. What are the JSF phases executed by weblets then? Probably we find a pattern which allows us to decide if it was a resource serving. Ciao, Mario -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: orchestra conversation closed by stylesheet
@Mario: your comment makes sense, we all should certainly try to work around bugs in other libraries! cause else, our users will have to do it, and this we will want to prevent. regards, Martin
Re: Is it possible to have a renderer do its rendering at the end of the document?
Short answer: no, not really. What I would do in your case is I would create a new component, and put it before the closing of your /body (or even create a new component which renders the body for you). Then the renderer can register the stuff it wants to render with this new component... regards, Martin On Fri, Mar 28, 2008 at 12:14 PM, [EMAIL PROTECTED] wrote: Hi, The subject is vague so here's a more detailed description. I have a context menu component that I've written. The way it works is by rendering a div with the context menu items, anything that's in the javax.output.Command family is an item. The div is initially set to hidden. In the renderer I'm also creating a value binding of this context menu component using its ID. To use the context menu I have a sub class/components of commandLink which has the added attribute of contextMenu. The command link then can reference the context menu with an expression like contextMenu=#{myContextMenu}. This all works great. The problem is accessibility is very important for this particular site. Currently the context menu has to be defined before using the context menu command link. With this the div is generated somewhere higher up on the page. For accessibility purposes we want the div to be at the end of page. When you disable CSS which is what the accessibility screen readers essentially do, the hidden div is no longer hidden. I've done a lot of things with the AddResource interface, I have a whole resource component which works very well. I've looked through the extension filter code and I understand how that works with the positioned info. I'm wondering if there is a similar way to do this with a renderer. You know with AddResource you can do something like addJavascriptAtPostion(AddResource.HEADER_BEGIN ….) and I think there is also BODY_END. I want to do the rendering where it is in the page, but write all the HTML at BODY_END. Is this possible? Thanks, Matt -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: OGNL with MyFaces - how to?
MyFaces uses the unified EL - to my knowledge, nobody has ever tried to use it with the OGNL. It would certainly be worthwile trying to get it up and running, however, but there are quite a few locations in MyFaces where we refer to the unified EL API, so I am not sure if this is possible at all :( regards, Martin On Wed, Mar 19, 2008 at 3:23 PM, Sidhik, Rosmon [EMAIL PROTECTED] wrote: Hi, Has anybody used OGNL with MyFaces? I would like to use OGNL with MyFaces and would like to get any help available to setup my application to use it. I have tried googling but haven't found any resources on this topic. Any help is appreciated. Thanks Rosmon -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Trinidad FileUpload failing with Tomahawk Extension Filter
No other features of Tomahawk will fail due to this... this is really a singular problem with the file-upload! regards, Martin On 3/18/08, Samba [EMAIL PROTECTED] wrote: Thanks for the advise... At least in my situation it did not break anything we currently have. And we do not use Tomahawk file upload, so I guess I can go with this approach, even though it may not be an ideal solution. I'll let you know if I observe any other tomahawk features failing because of this configuration. Samba On Mon, Mar 17, 2008 at 10:30 PM, Scott O'Bryan [EMAIL PROTECTED] wrote: Simon, you are exactly correct on your comments. Putting Trinidad's filter first means that *IT* takes priority. This would certainly break Tomahawk's file uploads and maybe even some other stuff. We definitely need to handle this and although I wouldn't say it's necessary to unite the file-upload components in all the various render kits, I'm certainly advocating consistent Multi-part for handling so that all the various components are compatible with one another. Samba: Looking at it again, the Trinidad filter does force execution of the Configurators earlier in the request. So yes, switching the order will work because the Trinidad bits will get processed first. Scott [EMAIL PROTECTED] wrote: I think it's important to track this, so I've created an issue (severity=minor): TOMAHAWK-1213 Putting trinidad's filter first has probably now broken any tomahawk fileUpload components. If you don't have any in your app then that is not a problem of course, but it is something that the library does need to fix sometime, whether via Scott's configurator module or otherwise. Samba: code duplication is a problem everyone is aware of. But tomahawk and trinidad cannot just be merged together. Some people want one but not the other. And anyway, people also combine these projects with other component libs created outside apache so all the apache libs need to be compatible with others as best they can. Regards, Simon Samba schrieb: hey, It worked now... The trick is to put Tomahawk Extension Filter below Trinidad Filter Thanks for your help.. Samba P.S. One more thing.. Is ther any planned date for the release of the Unified approach for file uploading in myfaces ? Actually I feel a lot duplicate effort is being put on JSF ... it would be better if , at least in MyFaces Project combine all the work into one stream so that these kind of incompatibilites won't arise, and also the users need not have to bother about configuring different and diverse pieces . On Mon, Mar 17, 2008 at 12:02 PM, Samba [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hey.. Scott, I did not notice.. You are referring to *Tobago Filter ---* where as I am using Tomahawk's extension Filter... I know that tobago filter is incompatible with trinidad But is Tomahawk Filter also incompatibile with Trinidad? thanks once again, On Sat, Mar 15, 2008 at 12:43 AM, Scott O'Bryan [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Samba, this will not work because Tobago's filter is doing the multi-part form handling. The two mechanisms are incompatible with each other and will be until we have uniform handling of the multi-part form request. (I know Matthias, yes the configurator commons is comming... :) ). Adding the TrinidadFilter mapping BEFORE the Tobago Filter will probably fix the issue. Scott On Fri, Mar 14, 2008 at 5:37 AM, Samba [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi! Mathew, Below I pasted the code of the method referrred; * public *String doUpload(){ *try* { BufferedInputStream bis = *new* BufferedInputStream(((UploadedFile)fileOne).getInputStream()); OutputStream os = *null*; System. /out/.println(ContentType : +fileOne.getContentType()+$$ + fileOne.getFilename() ); os = *new* FileOutputStream(C:\\temp\\+fileOne.getFilename()); *int* element; *while*((element=bis.read())!=-1){ os.write(element); } } *catch* (IOException e) { // *TODO* Auto-generated catch block e.printStackTrace(); } *return* *null*; } It is working fine even if I have Tomahawk jars and commons-fileupload jar in my lib, but the
Re: announcement: Orchestra Core 1.1 released
Hi Simon, great! I hope to be able to use it soon... regards, Martin On Wed, Mar 12, 2008 at 8:00 AM, simon [EMAIL PROTECTED] wrote: The Apache MyFaces Orchestra team is pleased to announce the release of Apache MyFaces Orchestra Core 1.1. Apache MyFaces Orchestra is a library which provides a new scope called conversation scope to your web based applications. Plain conversation scopes are useful, but in addition conversation scopes can have an associated ORM persistence-context; this simplifies building applications that interact with databases, and helps to solve the LazyInitializationException problem. Get a full overview at Orchestra's homepage [1]. The distribution is available at * http://myfaces.apache.org/orchestra/download.html Apache MyFaces Orchestra is available in the central Maven repository under Group ID org.apache.myfaces.orchestra. Have fun! Regards, Simon [1] http://myfaces.apache.org/orchestra -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Ajax + Inmediate=true Problem
Hi Daniel, putting immediate=true to your input component will not be sufficient. The problem is that immediate=true will trigger the validation for your input-component, but nothing more than that. So what happens is your value is converted and validated, but not put into your managed bean. What you will need to do is register a value-change-listener for the comp, and then move over the value to your backing-bean yourself. regards, Martin On Fri, Mar 14, 2008 at 12:02 AM, Andrew Robinson [EMAIL PROTECTED] wrote: Have a look at a4j:region it may be what you are looking for On Thu, Mar 13, 2008 at 3:14 PM, daniel ccss [EMAIL PROTECTED] wrote: I attach a graphical image of what is happening -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Converter-For-Class : getAsObject does not get called
Hi Michael, no, this is not a known problem. Can you please re-test carefully, and if you keep seeing this problem, file an issue? regards, Martin On Thu, Mar 13, 2008 at 3:40 PM, Michael Heß [EMAIL PROTECTED] wrote: Hi List, I'm having some strange issues with a custom converter I just created. The converter works as expected, if it is mapped by converter-id in faces-config and is used with a corresponding converter attribute in the inputText. Now, I changed the converter declaration in faces-config to converter-for-class and removed the converter attribute on the inputText. What I observe is, that when the view is rendered for the first time, getAsString does get called. But when the postback is sent, getAsObject does not get called, leaving me with a String. MyFaces Version is 1.2.2. Is this a known problem? bye, Michael -- Michael Heß Senior Consultant ORDIX AG Westernmauer 12-16 33098 Paderborn http://www.ordix.de Tel.: 05251 / 10 63 0 Fax : 05251 / 10 63 99 Mob : 0163 /673 49 43 ORDIX AG - Aktiengesellschaft für Softwareentwicklung, Schulung, Beratung und Systemintegration Vorsitzender des Aufsichtsrates: Prof. Dr. Hermann Johannes Vorstand: Wolfgang Kögler (Vorsitzender), Benedikt Georgi, Christoph Lafeld, Axel Röber Firmensitz: Westernmauer 12 - 16, 33098 Paderborn, Tel: 05251 / 1063-0, Fax: 0180 / 1 67 34 90 Amtsgericht Paderborn, HRB 2941, Ust-IdNr.DE 126333767, Steuernummer: 339/5866/0142 -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: iframe and saveState
Hi Piotr, if you do not want session scope, how about some dialog/conversation-scope, like Orchestra? regards, Martin On Thu, Mar 13, 2008 at 5:59 PM, Piotr [EMAIL PROTECTED] wrote: any ideas please. Piotr wrote: Hi users, I'm trying to do file upload functionality kind of similar to gmail one. I thought that it could be done using iframe and saveState from tomahawk but I'm facing some problems. In my page main page I have nested iframe component: ... h:form .. some input fields etc. div id=attachments iframe src=attachments.html frameborder=0 scrolling=no width=90% height=60 /iframe /div h:commandLink action=#{someMBean.save} value=save / /h:form ... page nested in the iframe: ... t:saveState id=uploadedFiles value=#{someBean.uploadedAttachements}/ ...some data table to display uploaded files h:form enctype=multipart/form-data h:panelGrid columns=2 t:inputFileUpload value=#{someMBean.attachment} storage=file accept=*/* required=true size=30/ h:commandButton value=upload action=#{ someMBean.uploadAttachement}/ /h:panelGrid /h:form Now the issue is that when I upload the files, with the iframe nested page, they are stored between request with saveState tag as they should, I can see them listed in the data table. The problem is that when I try to save the whole item (some input fields and uploaded attachment files), with previously uploaded attachments, using the form in my main page (the one in which iframe is nested) the uploaded attachments collection is empty. Placing t:saveState id=uploadedFiles value=#{ someBean.uploadedAttachements}/ in the main page doesn't change situation. Is there a way to keep state of some variable between requests generated from iframe and my main page? Maybe I'm following wrong way to do this upload, do you have any other proposals? Please note that I don't want to store anything in session scope. Thanks in advance. Piotr -- View this message in context: http://www.nabble.com/iframe-and-saveState-tp15981711p16031374.html Sent from the MyFaces - Users mailing list archive at Nabble.com. -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: inputFileUpload issue when file does not exists
Hi jorge, the HTML file-upload behaviour in IE is severely flawed. What you could do is what Gmail is doing: just not display the file-entry-field at all, display a link which allows the user to choose the file, internally connect the link with the hidden file-input field via JavaScript, then the interaction becomes a lot better... regards, Martin On Wed, Mar 12, 2008 at 2:08 PM, jorge08 [EMAIL PROTECTED] wrote: Actually, the behavior is different when I use FireFox. Silly me, I've only been using IE to trace this issue. When I use FireFox and have an invalid path or file name, the inputFileUpload field is bank out then I get This field is required error since I require that field. Which is a much better behavior that what I get using IE. I did install the Live HTTP headers module in FireFox and I can see that the filename field is indeed clear out before it is sent to the server. Is there anything I can do for the IE users about this issue? thanks, Jorge [EMAIL PROTECTED] wrote: On Tue, 2008-03-11 at 12:01 -0700, jorge08 wrote: Yes, but the problem is that my uploadAction method in my backing bean does NOT get executed when the file name is invalid or the file does not exist. Nothing happens when I click on the command button. Does the browser actually send anything back to the server in that case? If not, then there is nothing that can be done about that on the server end... For firefox, you can check this by installing the excellent live-headers addon, and seeing what data (if any) the browser sends to the server. Tracking that info down for other browser types is a little more difficult.. Regards, Simon -- View this message in context: http://www.nabble.com/inputFileUpload-issue-when-file-does-not-exists-tp15892132p16002290.html Sent from the MyFaces - Users mailing list archive at Nabble.com. -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: [Trinidad] subform defaultCommand
Hi Matthias, it would certainly make sense, but the way the defaultCommand currently works, it exchanges the onkeypress-handler of the form. In the case of subforms, there is no HTML-element for which the default-command can be registered. regards, Martin On 3/3/08, Mathias Walter [EMAIL PROTECTED] wrote: Hi, does it make sense to have a defaultCommand attribute on a tr:subform? For the subforms, I'm using PPR only. -- Kind regards, Mathias -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Doubt about ADF Faces Trinidad
Yeah, it took a while to get Trinidad out of incubation, but I think that good stuff needs time to mature. The Apache folks take good care that no rubbish appears on their website and that all projects are with a healthy community driving them. Frankly - I am quite thankful for this. * Oracle employees still do most of the work but you have seen a flow of commits/patches coming in from other people as well, if not, we should not have moved Trinidad out of the incubator. [...]I recently spent so much time debugging and trying to beat skinning into form, work around incompatibilities between Trinidad and Seam, etc. I ended up writing a couple of custom components for the core functionality.All in all the effort would have been smaller if I just went with JSP from the start[...] my personal experience is that you can get very far with Trinidad in a very short time-frame - this is also what RAD-contests show, where very often, Oracle with JDeveloper is one of the winning teams. It doesn't help to add a host of different technologies to the stack, however. regards, Martin
Re: Checkbox and required=true
Hi Michael, you are on the right track - the required==true flag will not help in the case of the checkbox, as for checkboxes, JSF will _always_ set a value (either true or false, due to the problems you mentioned above - there is no way to distinguish between false and value not set at all...). what you can do instead is set the validator=#{myBb.validator} attribute and validate in this method accordingly (or, as you said, write a new validator). regards, Martin On 2/27/08, Michael Heß [EMAIL PROTECTED] wrote: Hi List, now that I have spent several hours trying to figure it out on my own, I'm giving this list a try. What I want to do is rather basic: I want to have a mandatory checkbox in my view. So if the user wants to continue working with the application he must first tick the box. So what I came up with was to use the required=true on the h:selectBooleanCheckbox . Unfortunately this does not work. As I tried to find out what goes wrong I gave h:inputText a try, and it worked as expected, i.e. the form was considered invalid as long as the textbox was empty. So something is fishy about the checkbox... OK, so I remember back from the struts days, that checkboxes are tricky because they do not submit any value at all (not even an empty one) when unchecked. Searching some more, I found a rather interesting discussion in http://issues.apache.org/jira/browse/MYFACES-1467. Although the main problem is about validators not running, the issue that required=true gets ignored in case the component does not create a http parameter at all, is discussed at well. To the end of that issue it first seemed like a patch was supplied, but then again several problems popped up, and someone suspects that it's a spec issue frankly - i`m at a loss here. :-) So, what is the right approach for this behaviour? Create a MandatoryCheckboxValidator and attach it to the checkboxes? Maybe someone else had the problem already and can give me a hint how to proceed? Thanks and bye, Michael -- Michael Heß Senior Consultant ORDIX AG Westernmauer 12-16 33098 Paderborn http://www.ordix.de Tel.: 05251 / 10 63 0 Fax : 05251 / 10 63 99 Mob : 0163 /673 49 43 ORDIX AG - Aktiengesellschaft für Softwareentwicklung, Schulung, Beratung und Systemintegration Vorsitzender des Aufsichtsrates: Prof. Dr. Hermann Johannes Vorstand: Wolfgang Kögler (Vorsitzender), Benedikt Georgi, Christoph Lafeld, Axel Röber Firmensitz: Westernmauer 12 - 16, 33098 Paderborn, Tel: 05251 / 1063-0, Fax: 0180 / 1 67 34 90 Amtsgericht Paderborn, HRB 2941, Ust-IdNr.DE 126333767, Steuernummer: 339/5866/0142 -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: tiles vs facelets
Hi, there are no additional features in Facelets for templating - Facelets also offers dynamic, template-based components, however. regards, Martin On 2/25/08, aaa java [EMAIL PROTECTED] wrote: Hi I developed a sample application using JSF and tiles. Now I want to implement the same using facelts(for templating). What are the added advantages using facelets instead of tiles for templating. Are there any additional features that Facelets offer for templating. -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: MyFaces @PostConstruct and DI issue
Hi Curtiss, I don't think Bernhard ever got around to commit something which works based on the discussion he had with Paul. Do you have a patch which takes this into consideration? @Bernhard: please, if you can spare a few hours, it would be great if you could close this out... regards, Martin On 2/25/08, Curtiss Howard [EMAIL PROTECTED] wrote: Hi Stas, I'm not a MyFaces developer, but I believe this is a legitimate, major issue. I was able to reproduce this problem and what's happening is MyFaces is creating the bean, doing resource injection, calling the @PostConstruct method, and _then_ injecting managed properties. The article you linked makes it very clear that MyFaces needs to create the bean, perform resource AND managed property injection, and then call the @PostConstruct method: But the flow within the JSF 1.2 RI for instantiating managed beans is as follows: 1. New the bean declared using the default constructor 2. Inject any |@Resource| declarations 3. Assign any managed-properties declared, cascading this process if new beans are referenced 4. Call |@PostConstruct| on the bean if declared 5. Store the bean in the correct scope and return I have a working patch for this problem if one of the devs would like to weigh in with their opinion about opening a JIRA issue for this problem I'd be happy to provide it. Curtiss Howard -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: SERIALIZE_IN_SESSION with Sun Mojarra?
Hi Simon, I think I remember from discussions before (haven't checked the source) that no, it doesn't serialize. regards, Martin On 2/22/08, Simon Kitching [EMAIL PROTECTED] wrote: Hi, Myfaces Core property SERIALIZE_IN_SESSION is true by default, meaning that when using server-side state saving the http session contains a byte-array representation of the viewtree as serialized by JSF itself. In particular, this means that the StateHolder methods are used to serialize data into the session in preference to java.io.Serializable. Does anyone know how Sun Mojarra (formerly called the RI) behaves? Thanks, Simon -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: FacesContext.getCurrentInstance() provoking StackTraceException on initialization
The comment is a bit wrong - the method is present in JSF1.2, not in JSF 1.1 ;) regards, Martin 2008/2/28 Bruno Aranda [EMAIL PROTECTED]: The problem seems to be that the orchestra FacesContextWrapper does not implement/override the getELContext(), the code was commented out. (seems to cause problems, MYFACES-1820?) // This method is present in JSF1.1, but not JSF1.2 so must not // exist in this JSF1.1-compatible wrapper class. The default // implementation provided by the base FacesContext class in // JSF1.2 should be adequate as long as this class does NOT // use install=true in the constructor. See MYFACES-1820. //public final ELContext getELContext() //{ //return _facesContext.getELContext(); //} If I uncomment this code, orchestra + trinidad 1.2 works fine. The reason is, that the default FacesContext.getELContext delegates to the FacesContext current instance getELContext() method. In Trinidad's CacheRenderKit implementation of the FacesContext (the current instance at the moment of the exception), the getElContext() method just delegates to the wrapped FacesContext.getElContext() provoking the infinite loop. Any ideas? Bruno On 27/02/2008, Bruno Aranda [EMAIL PROTECTED] wrote: Good, will try to see what I find. Thanks guys! :) Bruno On 27/02/2008, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Sochor Zdeněk schrieb: Hi, comments inline [EMAIL PROTECTED] napsal(a): Hi Bruno, Bruno Aranda schrieb: Hi, I have a webapp with the combination myfaces core 1.2.3-SNAPSHOT trinidad 1.2.7-SNAPSHOT orchestra-core 1.1-SNAPSHOT and others (Facelets, Spring...) This used to work a weeks ago, but today I was trying to start it again and on initialization this exception happens: 2008-02-27 13:23:37,991 [btpool0-1] DEBUG (JsfFrameworkAdapter,57) - Beginning request 2008-02-27 13:23:37,992 [btpool0-1] DEBUG (OrchestraFacesContextFactory$1,114) - Running inithandler of type java.util.LinkedList$ListItr 2008-02-27 13:23:37,997 [btpool0-1] DEBUG (OrchestraFacesContextFactory$1,114) - Running inithandler of type java.util.LinkedList$ListItr 2008-02-27 13:23:38,365 [btpool0-1] DEBUG (OrchestraFacesContextFactory$1,129) - Running release 2008-02-27 13:23:38,368 [btpool0-1] DEBUG (JsfFrameworkAdapter,69) - Ending request timed :38,368 2008-02-27 13:23:38.260::WARN: Error for /intact/intact-search-webapp/search.xhtml timed :38.260 - sooner than previous logged message (by 108 ms) (It also use other format than DEBUG leveled messages) Well spotted, Zdenek! Time shows issue raised IN Orchestra (it's before releasing work of Orchestra) Well, it shows that the problem did occur between orchestra running initHandler and running release. That does explain a few things. When a FacesContext is created for a new request, Orchestra tries to run a sequence of initHandlers. If an exception happens in one of the initHandlers then it immediately runs the release methods of the initHandlers that successfully initialised, so that they can release any resources they acquired. One of these initHandlers must be triggering this infinite loop somehow. This *is* code that changed recently, and is almost certainly the root of the problem. It's some kind of unexpected interaction with Trinidad though, as this process works fine without Trinidad in the mix. I suspect that Trinidad is also wrapping the FacesContext, and then does not like its wrapper being called so early in the jsf lifecycle. Unfortunately I'm off on holiday for 4 days so can't help with debugging right now. Anyway, I don't use trinidad so would not be able to duplicate the problem locally. To debug this issue, you probably need to put a breakpoint at OrchestraFacesContextFactory.getFacesContext then trace from there. Regards, Simon -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Re: [core] MyFaces 1.2.2 and t:saveState problem
Could you guys open an issue with a small sample app reproducing the issue? regards, Martin On Thu, Feb 21, 2008 at 9:50 PM, Zheng, Xiahong [EMAIL PROTECTED] wrote: Was there any resolution on this problem? I start seeing problem as well with MyFaces 1.2.2 and t:saveState. If I switch to RI 1.2, everything works fine. -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Werner Punz Sent: Tuesday, February 12, 2008 6:02 AM To: users@myfaces.apache.org Subject: Re: [core] MyFaces 1.2.2 and t:saveState problem context-param descriptionDefine partial state saving as true/false./description param-namejavax.faces.PARTIAL_STATE_SAVING_METHOD/param-name param-valuefalse/param-value /context-param context-param descriptionOnly applicable if state saving method is server (= default) and if org.apache.myfaces.SERIALIZE_STATE_IN_SESSION is true (= default) If true (default) the serialized state will be compressed before it is written to the session. If false the state will not be compressed./description param-nameorg.apache.myfaces.COMPRESS_STATE_IN_SESSION/param-name param-valuetrue/param-value /context-param Ognjen Blagojevic schrieb: Hi Werner, I didn't change anything in the webapp configuration. I just replaced MyFaces 1.2.0 jars (and dependencies) with 1.2.2. Where are savestate optimizations configured, and how do I turn them off? Regards, Ognjen Werner Punz wrote: Werner Punz schrieb: Ognjen Blagojevic schrieb: Hi all, I have MyFaces 1.2.0 + Tomahawk 1.1.6 webapp that works fine. I use mostly request scoped beans, in order to keep the server memory free. I'm also using t:saveState tag, when there is the need to preserve the data for h:dataTable (as described on [1]). Parameters are passed using f:attribute name=isSomething value=#{row.idSomething}/ However, when I try to switch to MyFaces 1.2.2, t:saveState shows unexpected behaviour. It seems that when MyFaces evaluates expression row.idSomething, it doesn't consult the data that is saved for the last time with the t:saveState, but the one that is older, and therfore invalid. Any ideas on this one? Sounds like a bug to me, do you have the savestating optimizations turned on? To clarify things, to my knowledge some savestate optimizations went in 1.2.2, maybe there still is a bug there, you might try to turn them off if you have turned it on. Werner -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
[OFFTOPIC] Reminder: JSFDays Vienna
Hi all, we'd like to invite you to a JSF conference in Vienna, Austria from 12-14th of March. Anyone who wants to register as an attendee? Here is the link: http://conference.irian.at - click on preregister. Attendees will pay a very small conference fee - 100€. Speaker slots are pretty much filled already - except you have a topic which just rocks ;) There will be a supporting programm alongside the conference - so you will (additionally to learning about JSF and improving your JSF knowledge) have a good chance of getting to know Vienna and its surroundings. So far, there have been close to a hundred registrations - so this conference is definitely going to be a meeting point for everyone interested in JSF! regards, Martin
Re: [core] MyFaces 1.2.2 and t:saveState problem
Hi Werner, nothing has been enabled by default. regards, Martin On Feb 12, 2008 12:02 PM, Werner Punz [EMAIL PROTECTED] wrote: context-param descriptionDefine partial state saving as true/false./description param-namejavax.faces.PARTIAL_STATE_SAVING_METHOD/param-name param-valuefalse/param-value /context-param context-param descriptionOnly applicable if state saving method is server (= default) and if org.apache.myfaces.SERIALIZE_STATE_IN_SESSION is true (= default) If true (default) the serialized state will be compressed before it is written to the session. If false the state will not be compressed./description param-nameorg.apache.myfaces.COMPRESS_STATE_IN_SESSION/param-name param-valuetrue/param-value /context-param Ognjen Blagojevic schrieb: Hi Werner, I didn't change anything in the webapp configuration. I just replaced MyFaces 1.2.0 jars (and dependencies) with 1.2.2. Where are savestate optimizations configured, and how do I turn them off? Regards, Ognjen Werner Punz wrote: Werner Punz schrieb: Ognjen Blagojevic schrieb: Hi all, I have MyFaces 1.2.0 + Tomahawk 1.1.6 webapp that works fine. I use mostly request scoped beans, in order to keep the server memory free. I'm also using t:saveState tag, when there is the need to preserve the data for h:dataTable (as described on [1]). Parameters are passed using f:attribute name=isSomething value=#{row.idSomething}/ However, when I try to switch to MyFaces 1.2.2, t:saveState shows unexpected behaviour. It seems that when MyFaces evaluates expression row.idSomething, it doesn't consult the data that is saved for the last time with the t:saveState, but the one that is older, and therfore invalid. Any ideas on this one? Sounds like a bug to me, do you have the savestating optimizations turned on? To clarify things, to my knowledge some savestate optimizations went in 1.2.2, maybe there still is a bug there, you might try to turn them off if you have turned it on. Werner -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: MyFaces and templates
Hi Ognjen, use Facelets, Shale-Clay or JSF-Templating. regards, Martin On 2/8/08, Ognjen Blagojevic [EMAIL PROTECTED] wrote: Hi all, Is there an integrated templating solution for MyFaces? Or one should use independant framework like Facelets? Regards, Ognjen -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: License Question: web-facesconfig.dtd for MyFaces Impl 1.2 Jar
Ah right, we retyped them - so notice.txt should not refer to this anymore at all. regards, Martin On 2/7/08, Matthias Wessendorf [EMAIL PROTECTED] wrote: Hey, However, these files have been licensed to the ASF using an ASL-license by Sun, kudos to one of the Apache Committers who also works at Sun (as far as I remember - can anybody throw in a mail?). So the notice.txt file needs to be adapted, @Leonardo, can you please check: perhaps that was Craig Russell: http://www.mail-archive.com/[EMAIL PROTECTED]/msg01447.html that is a long email thread, it was mainly discussed on legal-discuss I haven't re-read it, but I think that Grant Smith worked on the DTDs (he basically re-typed them)... not sure if that helps. 1) if the files are in the jar (they should be, else our users will have problems using MyFaces offline) 2) that the notice.txt is adapted accordingly. regards, Martin On Feb 5, 2008 3:09 PM, Barb Cochrane [EMAIL PROTECTED] wrote: Hi, I have a licensing question re web-facesconfig.dtd file that is included with MyFaces Impl 1.2.jar. According to the source code, that file is licensed under what looks to be modified BSD license *with* one clause added as follows: You acknowledge that this software is not designed, licensed or intended for use in the design, construction, operation or maintenance of any nuclear facility. Yet, when I check on http://java.sun.com/dtd/ (as is suggested in the NOTICE file), the license referenced for web-facesconfig.dtd doesn't appear to resemble the modified BSD license with the added clause at all, rather it appears to be dual GPL / CDDL license. Can any MyFaces project members out there confirm whether the modified BSD is actually the prevailing license for this implementation? Thanks in advance! Cheers, Barb Cochrane -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- Matthias Wessendorf further stuff: blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf mail: matzew-at-apache-dot-org -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Portlet Environment and Orchestra
If you wrap the FacesContext, then maybe when FacesContext.release is called? regards, Martin On 2/7/08, Mario Ivankovits [EMAIL PROTECTED] wrote: Hi! The short answer to your question is no, the bridge won't help you here. Portlet 1.0 didn't define support for filters or wrapping request/response objects. Hence initialization done in filters in the servlet environment should be rewritten/migrated to FacesContextFactory. This document does not talk about when to release the configured resources again, does it? Is there something in the spec which talks about when to release a ThreadLocal again? Ciao, Mario -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Custom DataScroller (t:dataScroller)
Hi Tathagat, you could bind the h:dataTable/ with the binding attribute to a backing-bean - or you could set the value to a data-model, then you have access to the full data-model. regards, Martin On 2/7/08, Tathagat [EMAIL PROTECTED] wrote: Hi Martin. Let me re-word my question. I need all the data associated with a dataTable in my java code to do some stuff with it. If you somehow get hold of this dataTable object - it's not possible to get data out of it as all such methods are protected. BUT a dataScroller has a method - getUIData() - which gives the data on the active page. So if I associate a dummy scroller with our dataTable (also dummy - copy of original with rows=all data) (but hide it) having just 1 page, I have access to all data in dataTable (indirectly using dataScroller). This is the hack I was talking about. Is it clearer? I wanna know if there is a better way to get all data associated with the table on java level? Why I wanna do this - or where am I headed - to get a custom scroller. Current data scroller gives a paginator in the following format: 1-100, 101-200, 201-300.. and so on. What I would like is value of a column (along which the table is sorted), for example: AAA-CAT, CAU-FAX, FBC-MPC... and so on. The advantage is that user sees immediately where the value lies in the paginator (and does not have to guess). To do this.. I need all the data in the dataTable on java level. Hope I was clearer Thanks for your time. Tathagat On 2/6/08, Martin Marinschek [EMAIL PROTECTED] wrote: Hi Tathagat, I am very sorry, but I do not understand where you are heading. Why should the second scroller have all data then? I really don't get your explanation. regards, Martin On Feb 1, 2008 4:18 PM, Tathagat [EMAIL PROTECTED] wrote: Hi All. Current data scroller gives a paginator in the following format: 1-100, 101-200, 201-300.. and so on. What I would like is value of a column (along which the table is sorted), for example: AAA-CAT, CAU-FAX, FBC-MPC... and so on. The advantage is that user sees immediately where the value lies in the paginator (and does not have to guess). I implemented my own solution for it. Extended t:dataScroller classes with my own (regsitering faces-config, new taglib, entry in web.xml). I had to override the following method in org.apache.myfaces.custom.datascroller.HtmlDataScrollerRenderer protected HtmlCommandLink getLink(FacesContext facesContext, HtmlDataScroller scroller, String text, int pageIndex) Now the problem here was to get the data of the table mentioned in for property of datascroller. By default dataScroller has only rows (property of t:dataTable) amount of data (which is currently visible to user). --scroller.getUIData() So I used the following hack. Define the same scroller and table with different IDs with rows=total number of rows and style=display:none; Causing it not to show on the page but having the second sroller all the data in it. Thus I could build a paginator as mentioned above. My questions is: Is there a better way to get all the data in the table? All methods which provide data are protected. Thanks for your time. Tathagat -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: MyFaces 1.1.5 Strange validation behaviour
Hi Adam, ok, I see - I had never seen this behaviour before. regards, Martin On 2/7/08, Adam Perlik [EMAIL PROTECTED] wrote: The problem is caused by richfaces libraries which were in serwer classpath (jboss). It's very strange because my app didn't use any of richfaces classes and didn't declare richfaces filter in it's web.xml. After removing richfaces libs everything seems to be ok. Unfortuneatly it's not so good news afterall because I have to deploy another app on that server which i heavyli dependant on richfaces :( Thanks for help Adam 2008/2/7, Adam Perlik [EMAIL PROTECTED]: Sorry for not being explicit by enter I ment navigating there by actions. When I'm on the page clicking refresh in browser causes the same behaviour - sometimes the correct value is shown, and sometimes the rejected one. Regards Adam 2008/2/7, Martin Marinschek [EMAIL PROTECTED]: I do not understand this part of your question: Although I entered correct value, when I enter the same page I get the wrong value in some sort of cycles (sometimes it's once per five reloadas, sometimes it's 3/3). what means enter? You click refresh? back-button? You navigate there with an action? regards, Martin On 2/7/08, Adam Perlik [EMAIL PROTECTED] wrote: Hi, and there's also behavior like this: 1. I enter wrong value 2. Validator rejects the value and a message is shown 3. I enter correct value and save Although I entered correct value, when I enter the same page I get the wrong value in some sort of cycles (sometimes it's once per five reloadas, sometimes it's 3/3). The input is declared in jsp like this: h:inputText id=element_volume value=#{element.editElement.volume} required=true f:validateLongRange minimum=0 maximum=99/ /h:inputText the #{element} backing bean is request scoped and managed by spring. Are validators in JSF statefull ? I wonder what makes the wrong data to show up. 2008/2/7, Adam Perlik [EMAIL PROTECTED]: Hi, no, there are no binding attributes for input elements. I'm preatty sure it's because the use of cancel command button with immediete=true set on. I just can't figure out why is myfaces showing those two values in some sort of cycles - it would be normal if it showed the wrong value, as the one which gets set when I bypas validation by immediete=true. regards Adam 2008/2/6, Martin Marinschek [EMAIL PROTECTED]: Hi Adam, do you use component-binding with a session-scoped bean? regards, Martin On Feb 5, 2008 8:04 PM, Adam Perlik [EMAIL PROTECTED] wrote: Hi, I have a jsp page with text input on it and a long range validator (0 to 99) connected with that field. Now I run the following scenario: 1. enter invalid value (-123) 2. submit by command button 3. Proper validator message is displayed and everything seems to work fine 4. I cancel the page by hitting another command button with immediete='true' set, and it takes me to another page After those actions whenever I enter the page I see the good value of the input field or the invalid one that was rejected by the validator. The order seems totaly random, sometimes it's in cycles of 3 (3 times good value, 3 times bad). Maybe somebody has seen something like this or has some Ideas what to debug. The model i backing beans is ok and has proper values. Thanks in advance -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: License Question: web-facesconfig.dtd for MyFaces Impl 1.2 Jar
Hi Barb, they will not reflect the CDDL - there has been a long discussion on this on legal, and the outcome was that all dtd-files have been manually retyped by an Apache committer, and are now under ASL-license. So the notice.txt will not be amended to reflect the CDDL, but no reference at all for these dtds. Expect the change in the next release. regards, Martin On Feb 7, 2008 9:15 PM, Barb Cochrane [EMAIL PROTECTED] wrote: Martin, I should have asked this morning...when (timing) how (version) will the notice.txt and license.txt files be amended to reflect the CDDL? Thanks. Barb -Original Message- From: Martin Marinschek [mailto:[EMAIL PROTECTED] Sent: Thursday, February 07, 2008 3:41 AM To: MyFaces Discussion Subject: Re: License Question: web-facesconfig.dtd for MyFaces Impl 1.2 Jar Ah right, we retyped them - so notice.txt should not refer to this anymore at all. regards, Martin On 2/7/08, Matthias Wessendorf [EMAIL PROTECTED] wrote: Hey, However, these files have been licensed to the ASF using an ASL-license by Sun, kudos to one of the Apache Committers who also works at Sun (as far as I remember - can anybody throw in a mail?). So the notice.txt file needs to be adapted, @Leonardo, can you please check: perhaps that was Craig Russell: http://www.mail-archive.com/[EMAIL PROTECTED]/msg01447.html that is a long email thread, it was mainly discussed on legal-discuss I haven't re-read it, but I think that Grant Smith worked on the DTDs (he basically re-typed them)... not sure if that helps. 1) if the files are in the jar (they should be, else our users will have problems using MyFaces offline) 2) that the notice.txt is adapted accordingly. regards, Martin On Feb 5, 2008 3:09 PM, Barb Cochrane [EMAIL PROTECTED] wrote: Hi, I have a licensing question re web-facesconfig.dtd file that is included with MyFaces Impl 1.2.jar. According to the source code, that file is licensed under what looks to be modified BSD license *with* one clause added as follows: You acknowledge that this software is not designed, licensed or intended for use in the design, construction, operation or maintenance of any nuclear facility. Yet, when I check on http://java.sun.com/dtd/ (as is suggested in the NOTICE file), the license referenced for web-facesconfig.dtd doesn't appear to resemble the modified BSD license with the added clause at all, rather it appears to be dual GPL / CDDL license. Can any MyFaces project members out there confirm whether the modified BSD is actually the prevailing license for this implementation? Thanks in advance! Cheers, Barb Cochrane -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- Matthias Wessendorf further stuff: blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf mail: matzew-at-apache-dot-org -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: what is this thing?
Hi Lukasz, you should try it with MyFaces 1.2.2 for JSP 2.1. regards, Martin On Mon, Feb 4, 2008 at 8:57 PM, Łukasz Budnik [EMAIL PROTECTED] wrote: Hi All! What a strange error occurred to me when I tried to run a simple web app (MyFaces version 1.1.5 - available at http://myfaces.apache.org/download.html) on Apache Tomcat 6.0.14: Unable to convert string JavaServer Faces to class javax.el.ValueExpression The web page that triggered this error is generated automatically by Netbeans and looks like this: f:view h1h:outputText value=JavaServer Faces //h1 /f:view that's strange... the very simple example of outputText... any ideas what is going on? best regards Łukasz -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: MyFaces and Tiles
There is a sample app which shows the interaction - myfaces-tiles in the myfaces-source-tree. Did you check this out? regards, Martin On Sat, Feb 2, 2008 at 5:36 PM, Jonathan Fullam [EMAIL PROTECTED] wrote: Hello, I've been unsuccessfully trying to integrate tiles 2.0.5 with MyFaces 1.2. I'm using Tomahawk-1.1.7. It appears that the JspTilesTwoViewHandlerImpl is being invoked but that the faces servlet is still just using the .jsp page rather than looking for the associated .tiles page for the request. My faces config contains the following: application view-handler org.apache.myfaces.tomahawk.application.jsp.JspTilesTwoViewHandlerImpl /view-handler /application My tiles-defs.xml contains the following: definition name=/profiler.tiles extends=main.layout put-attribute name=body value=/profiler.jsp/ /definition Yet, when I try to access /profiler.faces the faces servlet tries to create the faces view using profiler.jsp and not profiler.tiles Has anybody been able to successfully use MyFaces 1.2 with tiles 2.0.5?? Any help is appreciated. -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Upgrading from myfaces 1.6 to 2.2?
that make any sense? BTJ On Sat, 2 Feb 2008 13:19:41 +0100 Bjørn T Johansen [EMAIL PROTECTED] wrote: Ok, have enabled some more logging and tried to switch but it just show a blank page and the logs say nothing... The last entry in the log are..: 02.02.2008 13:09:09,465 INFO MyfacesConfig [] - Starting up Tomahawk on the MyFaces-JSF-Implementation 02.02.2008 13:09:09,467 DEBUG JspTilesViewHandlerImpl [] - JspTilesViewHandlerImpl init 02.02.2008 13:09:09,472 DEBUG JspTilesViewHandlerImpl [] - Reading tiles definitions 02.02.2008 13:09:11,550 DEBUG HtmlResponseWriterImpl [] - No content type given, using default content type text/html 02.02.2008 13:09:11,550 DEBUG HtmlResponseWriterImpl [] - No character encoding given, using default character encoding ISO-8859-1 I have also switched from variable-resolver to el-resolver but still the same... What am I missing? BTJ On Sat, 2 Feb 2008 10:21:32 + Bruno Aranda [EMAIL PROTECTED] wrote: Yes, I do use the same combination, it even works in Tomcat 5.5 if you are using facelets. On 01/02/2008, Martin Marinschek [EMAIL PROTECTED] wrote: Hi BTJ, for me, tomahawk 1.1.5 works with impl 1.2.2 - that is all I can say right now. regards, Martin On 2/1/08, Bjørn T Johansen [EMAIL PROTECTED] wrote: Does that mean I can't upgrade to 2.2 before Tomahawk is released or? And yes, I am using Tomcat 6... BTJ On Fri, 1 Feb 2008 18:37:20 +0100 Martin Marinschek [EMAIL PROTECTED] wrote: Hi Matthias, right - sorry, Tomahawk hasn't been released so far. regards, Martin On 2/1/08, Matthias Wessendorf [EMAIL PROTECTED] wrote: Also, we are using Tiles2 now - you would need to upgrade this as well. that is in tomahawk, right ? regards, Martin On 2/1/08, Bjørn T Johansen [EMAIL PROTECTED] wrote: Is there something I need to do to upgrade? I am using Spring, Tiles, and myfaces and when I just switch myfaces jar files, I just get a blank page after login.. Haven't digged into this yet, just wonder if there were some specific steps that needed to be followed when upgrading? Regards, BTJ -- --- Bjørn T Johansen [EMAIL PROTECTED] --- Someone wrote: I understand that if you play a Windows CD backwards you hear strange Satanic messages To which someone replied: It's even worse than that; play it forwards and it installs Windows --- -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- Matthias Wessendorf further stuff: blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf mail: matzew-at-apache-dot-org -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: MyFaces-Orchestra-ViewController : NullpointerException
Hi Mario, just shooting into the dark: do you have a phase-listener registered before restore-view for Orchestra? This phase-listener will not be called in the portlet-case if only rendering is executed. regards, Martin On 2/6/08, Matthias Wessendorf [EMAIL PROTECTED] wrote: Hi Mario, Looks like I have to setup a protlet environment to debug things. It would be so helpful if you could provide a simple webapp to not have to setup all this by myself. Any chance? Else it might take some time as next week are holidays here and I am not sure if I manage to get enough free time and a good enough internet connection to being able to work on this. I know that the portlet-bridge folks were talking about a simple demo app. Not sure if there is already something like that. -M Ciao, Mario -- Matthias Wessendorf further stuff: blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf mail: matzew-at-apache-dot-org -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: MyFaces 1.1.5 Strange validation behaviour
Hi Adam, do you use component-binding with a session-scoped bean? regards, Martin On Feb 5, 2008 8:04 PM, Adam Perlik [EMAIL PROTECTED] wrote: Hi, I have a jsp page with text input on it and a long range validator (0 to 99) connected with that field. Now I run the following scenario: 1. enter invalid value (-123) 2. submit by command button 3. Proper validator message is displayed and everything seems to work fine 4. I cancel the page by hitting another command button with immediete='true' set, and it takes me to another page After those actions whenever I enter the page I see the good value of the input field or the invalid one that was rejected by the validator. The order seems totaly random, sometimes it's in cycles of 3 (3 times good value, 3 times bad). Maybe somebody has seen something like this or has some Ideas what to debug. The model i backing beans is ok and has proper values. Thanks in advance -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Custom DataScroller (t:dataScroller)
Hi Tathagat, I am very sorry, but I do not understand where you are heading. Why should the second scroller have all data then? I really don't get your explanation. regards, Martin On Feb 1, 2008 4:18 PM, Tathagat [EMAIL PROTECTED] wrote: Hi All. Current data scroller gives a paginator in the following format: 1-100, 101-200, 201-300.. and so on. What I would like is value of a column (along which the table is sorted), for example: AAA-CAT, CAU-FAX, FBC-MPC... and so on. The advantage is that user sees immediately where the value lies in the paginator (and does not have to guess). I implemented my own solution for it. Extended t:dataScroller classes with my own (regsitering faces-config, new taglib, entry in web.xml). I had to override the following method in org.apache.myfaces.custom.datascroller.HtmlDataScrollerRenderer protected HtmlCommandLink getLink(FacesContext facesContext, HtmlDataScroller scroller, String text, int pageIndex) Now the problem here was to get the data of the table mentioned in for property of datascroller. By default dataScroller has only rows (property of t:dataTable) amount of data (which is currently visible to user). --scroller.getUIData() So I used the following hack. Define the same scroller and table with different IDs with rows=total number of rows and style=display:none; Causing it not to show on the page but having the second sroller all the data in it. Thus I could build a paginator as mentioned above. My questions is: Is there a better way to get all the data in the table? All methods which provide data are protected. Thanks for your time. Tathagat -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: inputHtml
I have a fix for this problem - please open an issue, I will commit it. regards, Martin On Feb 5, 2008 4:54 AM, Ken McArthur [EMAIL PROTECTED] wrote: Attempting to upgrade from myfaces 1.1.5 to 1.2.2 and all works great except for inputHtml. Using myfaces 1.2.2, tomahawk 1.1.6, facelets 1.1.13. Get the following exception in the rendering facelets phases: Caused by: java.lang.ClassCastException: java.lang.Class at org.apache.myfaces.util.AbstractAttributeMap.put(AbstractAttributeMap.java:35) at org.apache.myfaces.custom.inputHtml.InputHtmlRenderer.setThisPageAlreadyRenderedAnInputHtml(InputHtmlRenderer.java:107) at org.apache.myfaces.custom.inputHtml.InputHtmlRenderer.encodeEnd(InputHtmlRenderer.java:93) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:556) Any ideas? Thanks, Ken -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: submitOnEvent callback
Bug is resolved - please try with the nightly snapshot. In any case, rendered should have worked before. regards, Martin On Feb 2, 2008 2:29 AM, Dave [EMAIL PROTECTED] wrote: Hi Martin, I have filed a bug in MyFaces jira. http://issues.apache.org/jira/browse/TOMAHAWK-1187 I also suggest adding a onsubmit=javascript code that can return true/false. Thanks. dave *Martin Marinschek [EMAIL PROTECTED]* wrote: I have prepared a fix and will commit it, if someone (Dave?) provides me with an issue-number ;) regards, Martin On 2/1/08, Martin Marinschek wrote: Hi guys, the clue is that restoreState/saveState was implemented wrongly in submitOnEvent - another reason to get the component-generator up and running. This is the erronous code - it uses the getter to access the component-attributes (and will therefore store the return-value of the method as local value...) public Object saveState(FacesContext context) { return new Object[] { super.saveState(context), getFor(), getEvent(), getCallback() }; } public void restoreState(FacesContext context, Object state) { Object[] states = (Object[]) state; super.restoreState(context, states[0]); forComponent = (String) states[1]; event = (String) states[2]; callback = (String) states[3]; } On 2/1/08, Gerald Müllan wrote: Hi Dave, don`t know why the method is not called, maybe Mario knows it. It`s not that nice, but you may also write: callback=mySpecialUserCallback .. function mySpecialUserCallback(event, srcComponentId, clickComponentId) { return #{bean.submitOnChange}; } This should work without any problems; cheers, Gerald On Feb 1, 2008 11:53 AM, Dave wrote: the bean method return a string that is a javascript function name. Mario Ivankovits wrote: Hi! callback=#{bean.callbackFunction} The callback should point to a javascript function name instead of a bean method. callback is meant to be executed on the client. This javascript method then should allow you to return true/false, on false the click should not happen. Ciao, Mario Looking for last minute shopping deals? Find them fast with Yahoo! Search. -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- Looking for last minute shopping deals? Find them fast with Yahoo! Search.http://us.rd.yahoo.com/evt=51734/*http://tools.search.yahoo.com/newsearch/category.php?category=shopping -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: inputHtml
http://myfaces.apache.org/issue-tracking.html regards, Martin On Feb 7, 2008 1:08 AM, Ken McArthur [EMAIL PROTECTED] wrote: Martin, That's very cool you found the problem. I could not find myfaces project on jira.codehaus.org. Where do I need to go to open an issue? Thanks, Ken On Feb 6, 2008 1:14 PM, Martin Marinschek [EMAIL PROTECTED] wrote: I have a fix for this problem - please open an issue, I will commit it. regards, Martin On Feb 5, 2008 4:54 AM, Ken McArthur [EMAIL PROTECTED] wrote: Attempting to upgrade from myfaces 1.1.5 to 1.2.2 and all works great except for inputHtml. Using myfaces 1.2.2, tomahawk 1.1.6, facelets 1.1.13. Get the following exception in the rendering facelets phases: Caused by: java.lang.ClassCastException: java.lang.Class at org.apache.myfaces.util.AbstractAttributeMap.put(AbstractAttributeMap.java:35) at org.apache.myfaces.custom.inputHtml.InputHtmlRenderer.setThisPageAlreadyRenderedAnInputHtml(InputHtmlRenderer.java:107) at org.apache.myfaces.custom.inputHtml.InputHtmlRenderer.encodeEnd(InputHtmlRenderer.java:93) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:556) Any ideas? Thanks, Ken -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- 303-619-6607 http://adsea.com -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: [Trinidad] Tags aren't getting rendered (but I can see them when I go to view-source)
The Faces-Servlet might not be triggered properly, and you might end up viewing the pages directly. In facelets, the tag-libs might not be found. regards, Martin On Feb 7, 2008 6:15 AM, Richard Yee [EMAIL PROTECTED] wrote: Hi, I am using Trinidad 1.0.5 and MyFaces 1.1.5 with JDeveloper 10.1.3.1. My application works fine in the embedded server but when I deploy the ear file to the oc4j external container, my pages end up blank - The browser window is empty and if I view the source, I can see all of the tr: tags. I have seen this problem before if the default-render-kit-id element is not defined for trinidad (org.apache.myfaces.trinidad.core) . Does anyone know what else might cause this problem? Thanks, Richard -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: inputHtml
Hi Ken, as far as I can tell, you have been reporting a bug for Tomahawk - so it should have a TOMAHAWK- issue key. I deleted the issue - please use the tomahawk issue tracker. regards, Martin On Feb 7, 2008 1:54 AM, Ken McArthur [EMAIL PROTECTED] wrote: Martin, Issue key = myfaces-1813 Thanks again and have a great day, Ken On Feb 6, 2008 5:21 PM, Martin Marinschek [EMAIL PROTECTED] wrote: http://myfaces.apache.org/issue-tracking.html regards, Martin On Feb 7, 2008 1:08 AM, Ken McArthur [EMAIL PROTECTED] wrote: Martin, That's very cool you found the problem. I could not find myfaces project on jira.codehaus.org. Where do I need to go to open an issue? Thanks, Ken On Feb 6, 2008 1:14 PM, Martin Marinschek [EMAIL PROTECTED] wrote: I have a fix for this problem - please open an issue, I will commit it. regards, Martin On Feb 5, 2008 4:54 AM, Ken McArthur [EMAIL PROTECTED] wrote: Attempting to upgrade from myfaces 1.1.5 to 1.2.2 and all works great except for inputHtml. Using myfaces 1.2.2, tomahawk 1.1.6, facelets 1.1.13. Get the following exception in the rendering facelets phases: Caused by: java.lang.ClassCastException: java.lang.Class at org.apache.myfaces.util.AbstractAttributeMap.put(AbstractAttributeMap.java:35) at org.apache.myfaces.custom.inputHtml.InputHtmlRenderer.setThisPageAlreadyRenderedAnInputHtml(InputHtmlRenderer.java:107) at org.apache.myfaces.custom.inputHtml.InputHtmlRenderer.encodeEnd(InputHtmlRenderer.java:93) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:556) Any ideas? Thanks, Ken -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- 303-619-6607 http://adsea.com -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- 303-619-6607 http://adsea.com -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: inputHtml
P.S.: it als helps if you send me a mail with the link to the issue. regards, Martin On Feb 7, 2008 7:57 AM, Martin Marinschek [EMAIL PROTECTED] wrote: Hi Ken, as far as I can tell, you have been reporting a bug for Tomahawk - so it should have a TOMAHAWK- issue key. I deleted the issue - please use the tomahawk issue tracker. regards, Martin On Feb 7, 2008 1:54 AM, Ken McArthur [EMAIL PROTECTED] wrote: Martin, Issue key = myfaces-1813 Thanks again and have a great day, Ken On Feb 6, 2008 5:21 PM, Martin Marinschek [EMAIL PROTECTED] wrote: http://myfaces.apache.org/issue-tracking.html regards, Martin On Feb 7, 2008 1:08 AM, Ken McArthur [EMAIL PROTECTED] wrote: Martin, That's very cool you found the problem. I could not find myfaces project on jira.codehaus.org. Where do I need to go to open an issue? Thanks, Ken On Feb 6, 2008 1:14 PM, Martin Marinschek [EMAIL PROTECTED] wrote: I have a fix for this problem - please open an issue, I will commit it. regards, Martin On Feb 5, 2008 4:54 AM, Ken McArthur [EMAIL PROTECTED] wrote: Attempting to upgrade from myfaces 1.1.5 to 1.2.2 and all works great except for inputHtml. Using myfaces 1.2.2, tomahawk 1.1.6, facelets 1.1.13. Get the following exception in the rendering facelets phases: Caused by: java.lang.ClassCastException: java.lang.Class at org.apache.myfaces.util.AbstractAttributeMap.put(AbstractAttributeMap.java:35) at org.apache.myfaces.custom.inputHtml.InputHtmlRenderer.setThisPageAlreadyRenderedAnInputHtml(InputHtmlRenderer.java:107) at org.apache.myfaces.custom.inputHtml.InputHtmlRenderer.encodeEnd(InputHtmlRenderer.java:93) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:556) Any ideas? Thanks, Ken -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- 303-619-6607 http://adsea.com -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- 303-619-6607 http://adsea.com -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: License Question: web-facesconfig.dtd for MyFaces Impl 1.2 Jar
They should be included - I see: web-facesconfig_1_0.dtd web-facesconfig_1_1.dtd and web-facesconfig_1_2.xsd in the source under impl/src/main/resources However, these files have been licensed to the ASF using an ASL-license by Sun, kudos to one of the Apache Committers who also works at Sun (as far as I remember - can anybody throw in a mail?). So the notice.txt file needs to be adapted, @Leonardo, can you please check: 1) if the files are in the jar (they should be, else our users will have problems using MyFaces offline) 2) that the notice.txt is adapted accordingly. regards, Martin On Feb 5, 2008 3:09 PM, Barb Cochrane [EMAIL PROTECTED] wrote: Hi, I have a licensing question re web-facesconfig.dtd file that is included with MyFaces Impl 1.2.jar. According to the source code, that file is licensed under what looks to be modified BSD license *with* one clause added as follows: You acknowledge that this software is not designed, licensed or intended for use in the design, construction, operation or maintenance of any nuclear facility. Yet, when I check on http://java.sun.com/dtd/ (as is suggested in the NOTICE file), the license referenced for web-facesconfig.dtd doesn't appear to resemble the modified BSD license with the added clause at all, rather it appears to be dual GPL / CDDL license. Can any MyFaces project members out there confirm whether the modified BSD is actually the prevailing license for this implementation? Thanks in advance! Cheers, Barb Cochrane -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Serialization issue with app scoped beans referenced by session scoped beans
Hi Simon, Spring's aop:scoped-proxy/ might help - if it is serializable, and retrieves the beanFactory on deserialization. However, it doesn't do it right now; I think - but we discussed with Jürgen once, and maybe it will be supported in the future. I doubt the JSF managed-bean facility is sophisticated enough so that an addition like this makes sense. regards, Martin On Feb 7, 2008 8:13 AM, simon [EMAIL PROTECTED] wrote: On Wed, 2008-02-06 at 19:20 -0800, Kent Tong wrote: Simon Kitching-4 wrote: And java's serialization has *always* discarded transient objects on serialization and marked them as null on deserialization. That's perfectly normal. There are a number of options here for you, including transient Bean2 appBean = new Bean2(); or accessing it only via a getBean2() method that checks whether it is null and restores it, or implementing custom serialization for Bean1. Thanks for the reply. My point is that JSF allows injecting an application scoped bean into a session scoped bean. As this is the only way to give the latter access to the former without code pollution, this should be the recommended way suggested by JSF. However, due to the problem raised above, in fact the recommended way is not really working. That's a fair point. When a property of a session-scoped bean has been set to an app-scope bean via dependency-injection, it is difficult to restore it on deserialize. As you say, it really should be transient because you don't want to store a copy of the app-scope bean during serialization of an http session, and probably don't want a private copy to be created on deserialize (but instead be relinked back to the shared app-scope instance). It's particularly a problem for distributed sessions. But there is no way AFAIK to cause the dependency to be reinjected on deserialize. The bean can be looked up, but (a) that is ugly code, and (b) breaks the whole point of dependency injection. Perhaps injection via annotations will work here; the injection process could be run against beans after the session is deserialized. Of course this does only apply to the fairly rare case of injecting an app-scope reference into a session-scoped bean. I cannot see any similar problems when injecting session-scope into session-scope, or anything into a request-scoped bean. As a hack, I suppose you could write your own HttpSessionActivationListener that reinjects stuff based on annotations in classes. I'm not sure what the JSF spec has to say about this issue... Regards, Simon -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Question about filling page objects
Are you using JSF1.2? Check out f:setPropertyActionListener for changing from a list-page to a detail-page. regards, Martin On 2/1/08, Martyn Hiemstra [EMAIL PROTECTED] wrote: Hi All My company has chosen to use jsf in a new project. I myself am used to SpringMVC which works perfectly for my needs but I figured, why not try jsf since I have to use. I am running into a problem which is a pretty huge problem in jsf. Maybe someone can explain it to me how to solve my problem. It's also possible that I dont understand the concept correctly. I want to redrect a user to a page where they can edit their address. In Spring MVC I would redirect the user to /editAddress.do?id=persons_id. As you can see I would pass the id of the logged in person to the url and the controller will verify that the passed id is the same as the currently logged in user and then the controller will load the users address and display it on the screen. I want to do the same in jsf. I have a user profile page and on that page, users can edit their address by pressing a button. I have attached an action to the button and created the method in the Page object. This method is editAddress. In jsf if I want to redirect to the edit address page but it turns out that I cant supply parameters in the navigation xml file. I read on the Internet that I have to load the edit address page using it's bean name and then fill in the information in the edit address bean and then return the flow id. That I must return the flow id is great because that way no url's are defioned in page objects but that I must load the page bean with the following code is really and I mean really hard to understand: FacesContext facesContext = FacesContext.getCurrentInstance( ); ExpressionFactory factory = facesContext.getApplication( ).getExpressionFactory( ); EditAddressPage page = factory.createValueExpression( facesContext.getELContext( ), PAGE_NAME, Object.class ).getValue(FacesContext.getCurrentInstance().getELContext()); I then need to fill the edit address page with the address data. I thought jsf was supposed to be easy to use but this is ridiculous. Can someone please tell me if there is a much easier way to pass information onto a page either via a parameter or some other way, preferably via parameters and as a redirect instead of an internal forward. Thanks in advance, Martyn -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Upgrading from myfaces 1.6 to 2.2?
Are you using Tomcat 6? You need a JSP 1.2.1 compatible container. Also, we are using Tiles2 now - you would need to upgrade this as well. regards, Martin On 2/1/08, Bjørn T Johansen [EMAIL PROTECTED] wrote: Is there something I need to do to upgrade? I am using Spring, Tiles, and myfaces and when I just switch myfaces jar files, I just get a blank page after login.. Haven't digged into this yet, just wonder if there were some specific steps that needed to be followed when upgrading? Regards, BTJ -- --- Bjørn T Johansen [EMAIL PROTECTED] --- Someone wrote: I understand that if you play a Windows CD backwards you hear strange Satanic messages To which someone replied: It's even worse than that; play it forwards and it installs Windows --- -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: submitOnEvent callback
I have prepared a fix and will commit it, if someone (Dave?) provides me with an issue-number ;) regards, Martin On 2/1/08, Martin Marinschek [EMAIL PROTECTED] wrote: Hi guys, the clue is that restoreState/saveState was implemented wrongly in submitOnEvent - another reason to get the component-generator up and running. This is the erronous code - it uses the getter to access the component-attributes (and will therefore store the return-value of the method as local value...) public Object saveState(FacesContext context) { return new Object[] { super.saveState(context), getFor(), getEvent(), getCallback() }; } public void restoreState(FacesContext context, Object state) { Object[] states = (Object[]) state; super.restoreState(context, states[0]); forComponent = (String) states[1]; event = (String) states[2]; callback = (String) states[3]; } On 2/1/08, Gerald Müllan [EMAIL PROTECTED] wrote: Hi Dave, don`t know why the method is not called, maybe Mario knows it. It`s not that nice, but you may also write: callback=mySpecialUserCallback .. function mySpecialUserCallback(event, srcComponentId, clickComponentId) { return #{bean.submitOnChange}; } This should work without any problems; cheers, Gerald On Feb 1, 2008 11:53 AM, Dave [EMAIL PROTECTED] wrote: the bean method return a string that is a javascript function name. Mario Ivankovits [EMAIL PROTECTED] wrote: Hi! callback=#{bean.callbackFunction} The callback should point to a javascript function name instead of a bean method. callback is meant to be executed on the client. This javascript method then should allow you to return true/false, on false the click should not happen. Ciao, Mario Looking for last minute shopping deals? Find them fast with Yahoo! Search. -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: submitOnEvent callback
Hi guys, the clue is that restoreState/saveState was implemented wrongly in submitOnEvent - another reason to get the component-generator up and running. This is the erronous code - it uses the getter to access the component-attributes (and will therefore store the return-value of the method as local value...) public Object saveState(FacesContext context) { return new Object[] { super.saveState(context), getFor(), getEvent(), getCallback() }; } public void restoreState(FacesContext context, Object state) { Object[] states = (Object[]) state; super.restoreState(context, states[0]); forComponent = (String) states[1]; event = (String) states[2]; callback = (String) states[3]; } On 2/1/08, Gerald Müllan [EMAIL PROTECTED] wrote: Hi Dave, don`t know why the method is not called, maybe Mario knows it. It`s not that nice, but you may also write: callback=mySpecialUserCallback .. function mySpecialUserCallback(event, srcComponentId, clickComponentId) { return #{bean.submitOnChange}; } This should work without any problems; cheers, Gerald On Feb 1, 2008 11:53 AM, Dave [EMAIL PROTECTED] wrote: the bean method return a string that is a javascript function name. Mario Ivankovits [EMAIL PROTECTED] wrote: Hi! callback=#{bean.callbackFunction} The callback should point to a javascript function name instead of a bean method. callback is meant to be executed on the client. This javascript method then should allow you to return true/false, on false the click should not happen. Ciao, Mario Looking for last minute shopping deals? Find them fast with Yahoo! Search. -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Upgrading from myfaces 1.6 to 2.2?
Hi Matthias, right - sorry, Tomahawk hasn't been released so far. regards, Martin On 2/1/08, Matthias Wessendorf [EMAIL PROTECTED] wrote: Also, we are using Tiles2 now - you would need to upgrade this as well. that is in tomahawk, right ? regards, Martin On 2/1/08, Bjørn T Johansen [EMAIL PROTECTED] wrote: Is there something I need to do to upgrade? I am using Spring, Tiles, and myfaces and when I just switch myfaces jar files, I just get a blank page after login.. Haven't digged into this yet, just wonder if there were some specific steps that needed to be followed when upgrading? Regards, BTJ -- --- Bjørn T Johansen [EMAIL PROTECTED] --- Someone wrote: I understand that if you play a Windows CD backwards you hear strange Satanic messages To which someone replied: It's even worse than that; play it forwards and it installs Windows --- -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- Matthias Wessendorf further stuff: blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf mail: matzew-at-apache-dot-org -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Upgrading from myfaces 1.6 to 2.2?
Hi BTJ, for me, tomahawk 1.1.5 works with impl 1.2.2 - that is all I can say right now. regards, Martin On 2/1/08, Bjørn T Johansen [EMAIL PROTECTED] wrote: Does that mean I can't upgrade to 2.2 before Tomahawk is released or? And yes, I am using Tomcat 6... BTJ On Fri, 1 Feb 2008 18:37:20 +0100 Martin Marinschek [EMAIL PROTECTED] wrote: Hi Matthias, right - sorry, Tomahawk hasn't been released so far. regards, Martin On 2/1/08, Matthias Wessendorf [EMAIL PROTECTED] wrote: Also, we are using Tiles2 now - you would need to upgrade this as well. that is in tomahawk, right ? regards, Martin On 2/1/08, Bjørn T Johansen [EMAIL PROTECTED] wrote: Is there something I need to do to upgrade? I am using Spring, Tiles, and myfaces and when I just switch myfaces jar files, I just get a blank page after login.. Haven't digged into this yet, just wonder if there were some specific steps that needed to be followed when upgrading? Regards, BTJ -- --- Bjørn T Johansen [EMAIL PROTECTED] --- Someone wrote: I understand that if you play a Windows CD backwards you hear strange Satanic messages To which someone replied: It's even worse than that; play it forwards and it installs Windows --- -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- Matthias Wessendorf further stuff: blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf mail: matzew-at-apache-dot-org -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: [tomahawk] oamSubmitForm causes parse error
No ideas, no patches. Is it the which is not liked by the parser? regards, Martin On Thu, Jan 31, 2008 at 6:33 PM, Michael Heinen [EMAIL PROTECTED] wrote: I am using myFaces in combination with ajax4jsf (or richfaces) and tried to use the Nekko Parser (or Neko?) in the richfaces filter to achieve better performance. Some tomahawk javascript code makes now trouble: The parser says: error[18:11:35,796]: Parse Error: XML Parsing Error: A name was started with an invalid character.Location: Line Number 82, Column 36: if((typeof target!='undefined') target != null) ^ This line is part of the function oamSubmitForm. Any ideas or patches available? My environment: myFaces 1.1.5 tomahawk snapshot 1.1.5 richfaces 3.1.4 Michael -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Can I use MyFaces Tomahawk 1.1.6 with MyFaces Core 1.1.5?
Yes, it should work. regards, Martin On Thu, Jan 31, 2008 at 10:41 PM, merkas [EMAIL PROTECTED] wrote: Hello, can I use MyFaces Tomahawk 1.1.6 with MyFaces Core 1.1.5? Because in the in the http://wiki.apache.org/myfaces/CompatibilityMatrix compatibility matrix ther is no entry. Regards, merkas -- View this message in context: http://www.nabble.com/Can-I-use-MyFaces-Tomahawk-1.1.6-with-MyFaces-Core-1.1.5--tp15215250p15215250.html Sent from the MyFaces - Users mailing list archive at Nabble.com. -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Checking Event Queue inside Value Change Listener
Hi Mihajlo, you would need to override the UIViewRoot component and its method queueEvent - in this method, you could keep a list of events, and then check if there is more to come in your value-change-listener. There is no public API to do this in the standard UIViewRoot, so no chance otherwise. regards, Martin On Tue, Jan 22, 2008 at 6:47 PM, mjovanov [EMAIL PROTECTED] wrote: Does anyone know of a way to check in the body of a value change listener if there are any more ValueChangeEvents queued , prior to issuing a request to render response? FacesContext.getCurrentInstance().renderResponse(); Help is greatly appreciated! -- View this message in context: http://www.nabble.com/Checking-Event-Queue-inside-Value-Change-Listener-tp15024206p15024206.html Sent from the MyFaces - Users mailing list archive at Nabble.com. -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: [Trinidad] Configuring debug-output in trinidad-config.xml with EL-expression
Hi Harald, well, the FacesContext is only created in the FacesServlet, and obviously, in the filter, you are before this creation. It might be possible to patch the Trinidad-Filter to create a FacesContext and release it to properly evaluate these properties. Maybe the Trinidad-Filter could also be prompted to create the RequestContext later on in the lifecycle. regards, Martin On 1/28/08, Kuhn, Harald [EMAIL PROTECTED] wrote: Hi to all, in order to have all debug-relevant settings in one place (web.xml) I tried to set debug-output via EL. Unfortunately this doesn't work. I always get a NPE on the 1 request (login page) to my webapp. Should this scenario be possible? Or, am I doing something wrong? Thanks for your help. Harald web.xml: context-param param-nameTRINIDAD_DEBUG_OUTPUT/param-name param-valuetrue/param-value /context-param trinidad-config.xml: debug-output#{initParam.TRINIDAD_DEBUG_OUTPUT}/debug-output Stack-Trace: 2008-01-28 11:43:16,687 ERROR org.apache.catalina.core.ContainerBase.[Catalina].[xp-lmazf9p.lasg].[/aim].[faces]: Servlet.service() for servlet faces threw exception java.lang.NullPointerException at org.apache.myfaces.trinidad.bean.FacesBeanImpl.getProperty(FacesBeanImpl.java:68) at org.apache.myfaces.trinidadinternal.config.ConfigParser.parseConfigFile(ConfigParser.java:138) at org.apache.myfaces.trinidadinternal.context.RequestContextFactoryImpl._getBean(RequestContextFactoryImpl.java:71) at org.apache.myfaces.trinidadinternal.context.RequestContextFactoryImpl.createContext(RequestContextFactoryImpl.java:56) at org.apache.myfaces.trinidadinternal.config.GlobalConfiguratorImpl._attachRequestContext(GlobalConfiguratorImpl.java:422) at org.apache.myfaces.trinidadinternal.config.GlobalConfiguratorImpl.beginRequest(GlobalConfiguratorImpl.java:202) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:126) at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.airplus.aim.webapp.filter.AIMFilter.doFilter(AIMFilter.java:135) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:209) at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:347) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Unknown Source) 2008-01-28 11:43:17,187 INFO org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl: Apache Trinidad is running with time-stamp checking enabled. This should not be used in a production environment. See the org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION property in WEB-INF/web.xml 2008-01-28 11:43:17,609 ERROR javax.faces.webapp._ErrorPageWriter: An exception occurred java.lang.NullPointerException at org.apache.myfaces.trinidadinternal.renderkit.core.CoreRenderingContext.init(CoreRenderingContext.java:77) at org.apache.myfaces.trinidadinternal.renderkit.core.CoreRenderKit.encodeBegin(CoreRenderKit.java:479) at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:166) at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41) at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at
Re: JSF pages rendering 4 times more slowly in IE7 than Firefox
Are you using any javascript libraries? Dojo? regards, Martin On 1/30/08, Simon Kitching [EMAIL PROTECTED] wrote: caped crusader [EMAIL PROTECTED] schrieb: Hi I have a JSF application with some quite unusual performance problems. Loading pages in IE7 takes 4 times as long as in Firefox (v2.0.0.11). When I test the application locally, response times are good, and pretty similar for IE and FF. When I test our actual deployment, pages take on average 6 seconds to load in Firefox, and about 23 seconds in IE7. The pages that are being rendered are very simple, with perhaps 10-12 links and a handful of form fields. Much as I'd love to tell our users to just use FF, most of them use IE and making them switch is not an option. I've already looked at the performance page on the MyFaces wiki, and implemented the server-side tips there. I'm using MyFaces 1.1.4 Tomahawk 1.1.3 Firefox 2.0.0.11 Internet Explorer 7.0.5730.11 Are there any other obvious areas anyone can think of to target? One thing that comes to mind is that Firefox might be caching some resources while IE is not caching them, and so repeatedly fetching something. This difference might not show up when the server is local, but be much more significant when the server is remote and more heavily loaded. I suggest you enable logging of all requests on your server and then compare the list of URLs fetched by firefox with the list of URLs fetched by IE for the same page. This can be done on your local server, not the remote one. I would also enable the live headers plugin in firefox and have a look at the http headers for pages, making sure that they have the appropriate caching headers set. Regards, Simon -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: performance comparison between 1.1.5 and 1.2.2?
Hi Simon (and Mario) Yes, definitely. This is just a block of verbatim text, which is written out very efficiently. Using a component to write the same text is much slower and gains nothing. well - not quite. in JSF1.2, every static text in your app will be converted to a JSF-component. So you will gain not much in processing time by using static text. However, you will save memory due to less state needing to be saved. regards, Martin
Re: [Trinidad] Configuring debug-output in trinidad-config.xml with EL-expression
What can I say - you are absolutely right. However, maybe you could ask Cristi to take a look at this when he is with you, and then it might as well work again, so let's not change it too fast ;) regards, Martin On 1/30/08, Kuhn, Harald [EMAIL PROTECTED] wrote: Hi Martin, ok, if I understand you right it is not possible for property debug-output as this property is evaluated before FacesContext is instanciated. But then, at least the documentation (Developer Guide / Configuring Apache Trinidad) should be updated. quote Apache Trinidad is configured with an trinidad-config.xml file. If you need an trinidad-config.xml file then it must be placed in the WEB-INF directory of your web application. This file has a very simple XML structure that relies on the JSF expression language (EL) for flexibility. Each configurable property can be defined either inline with a static, constant value, or with a JSF EL expression that is re-evaluated on each request. /quote As you could see (marked with ) each property should accept EL-expressions. Also the code implies that EL-binding is supported: if (key.getSupportsBinding()) { ... // EL-Evaluation, only if binding is supported. } Thanks for your reply. Kind regards Harald ** Harald Kuhn AirPlus International Business Information Services Phone: +49 (0) 61 02 204-821 Fax: +49 (0) 61 02 204-139 E-Mail: [EMAIL PROTECTED] Internet: www.airplus.com ** Lufthansa AirPlus Servicekarten GmbH · Hans-Böckler-Straße 7 · 63263 Neu-Isenburg · Deutschland · Geschäftsführer: Patrick W. Diemer (Vorsitz), Klaus Busch · Vorsitzender des Aufsichtsrates: Stephan Gemkow · Handelsregister: Amtsgericht Offenbach/Main, HRB 8119 -Original Message- From: Martin Marinschek [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 30, 2008 11:58 AM To: MyFaces Discussion Subject: Re: [Trinidad] Configuring debug-output in trinidad-config.xml with EL-expression Hi Harald, well, the FacesContext is only created in the FacesServlet, and obviously, in the filter, you are before this creation. It might be possible to patch the Trinidad-Filter to create a FacesContext and release it to properly evaluate these properties. Maybe the Trinidad-Filter could also be prompted to create the RequestContext later on in the lifecycle. regards, Martin On 1/28/08, Kuhn, Harald [EMAIL PROTECTED] wrote: Hi to all, in order to have all debug-relevant settings in one place (web.xml) I tried to set debug-output via EL. Unfortunately this doesn't work. I always get a NPE on the 1 request (login page) to my webapp. Should this scenario be possible? Or, am I doing something wrong? Thanks for your help. Harald web.xml: context-param param-nameTRINIDAD_DEBUG_OUTPUT/param-name param-valuetrue/param-value /context-param trinidad-config.xml: debug-output#{initParam.TRINIDAD_DEBUG_OUTPUT}/debug-output Stack-Trace: 2008-01-28 11:43:16,687 ERROR org.apache.catalina.core.ContainerBase.[Catalina].[xp-lmazf9p.lasg].[/aim].[faces]: Servlet.service() for servlet faces threw exception java.lang.NullPointerException at org.apache.myfaces.trinidad.bean.FacesBeanImpl.getProperty(FacesBeanImpl.java:68) at org.apache.myfaces.trinidadinternal.config.ConfigParser.parseConfigFile(ConfigParser.java:138) at org.apache.myfaces.trinidadinternal.context.RequestContextFactoryImpl._getBean(RequestContextFactoryImpl.java:71) at org.apache.myfaces.trinidadinternal.context.RequestContextFactoryImpl.createContext(RequestContextFactoryImpl.java:56) at org.apache.myfaces.trinidadinternal.config.GlobalConfiguratorImpl._attachRequestContext(GlobalConfiguratorImpl.java:422) at org.apache.myfaces.trinidadinternal.config.GlobalConfiguratorImpl.beginRequest(GlobalConfiguratorImpl.java:202) at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:126) at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.airplus.aim.webapp.filter.AIMFilter.doFilter(AIMFilter.java:135) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke
Re: JBoss Portal and encodeNamespace
Hi Luca, it would be great if you could open an issue - and maybe you could solve this generally by doing some encoding of the problematic characters - whatever this encoding might be. If you attach a patch to the issue, it might as well be committed ;) regards, Martin On 1/30/08, Luca Castelluzzo [EMAIL PROTECTED] wrote: Hi, I've had a problem with the automatically generated id attributes while using JSF in a JBoss Portal portlet. This JSF tag: h:form Becomes: form id=jbpns_2fores_2fUtilit#224;_2f...[too long] name=jbpns_2fores_2fUtilit#224;_2f...[too long] method=post action=[omitted] enctype=application/x-www-form-urlencoded Unfortunately, my portlet's namespace contains an accented character à which is perfectly legal for the JSR 168, but is illegal for an id attribute in html. Actually, this character is converted to #224; into the rendered page, but this is illegal too. I've done a search in MyFaces code and found the reason: these id attributes are built by calling the encodeNamespace of PortletExternalContextImpl. This method relies upon the JBoss Portal namespace: return name + ((RenderResponse) _portletResponse).getNamespace(); I think I'll solve the problem by manipulating the portlet's namespace in the encodeNamespace method. I just want to make you aware of this issue. Thank you for your great job with MyFaces. Luca -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: [Trinidad] Configuring debug-output in trinidad-config.xml with EL-expression
Hi Matthias, did you see Harald's quote from the Trinidad docs? I'm including it here again: quote Apache Trinidad is configured with an trinidad-config.xml file. If you need an trinidad-config.xml file then it must be placed in the WEB-INF directory of your web application. This file has a very simple XML structure that relies on the JSF expression language (EL) for flexibility. Each configurable property can be defined either inline with a static, constant value, or with a JSF EL expression that is re-evaluated on each request. /quote regards, Martin
Re: [Trinidad] Configuring debug-output in trinidad-config.xml with EL-expression
Hey Andy, I believe you are correct - ie. the doc is not accurate. Looking at RequestContextBean.java, it seems that the following properties cannot be EL-bound: ... I think we should mark this as not-bindable and update the doc accordingly. However, I do not buy Matthias argument that this is due to security reasons - if some intruder gets access to managed-beans, we are hosed anyways. I think, from a perspective servicing the user, it would be a good thing if the admin could enable debug-output on the fly for an application/user-session. regards, Martin
Re: [Trinidad] Configuring debug-output in trinidad-config.xml with EL-expression
Oh, well - this fix sounds really simple then. regards, Martin On Thu, Jan 31, 2008 at 12:38 AM, Andy Schwartz [EMAIL PROTECTED] wrote: On Jan 30, 2008 5:45 PM, Martin Marinschek [EMAIL PROTECTED] wrote: However, I do not buy Matthias argument that this is due to security reasons - if some intruder gets access to managed-beans, we are hosed anyways. I think, from a perspective servicing the user, it would be a good thing if the admin could enable debug-output on the fly for an application/user-session. Actually, looking at the code which is triggering the early evaluation of the debug-output expression, from the very end of ConfigParser.parseConfigFile(): if (_LOG.isInfo()) { Object debug = bean.getProperty(RequestContextBean.DEBUG_OUTPUT_KEY); if (Boolean.TRUE.equals(debug)) _LOG.info(RUNNING_IN_DEBUG_MODE,_CONFIG_FILE); } Perhaps the answer is to delay logging this message until a bit later in the lifecycle (ie. until after the FacesContext is known to be available). Andy -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: JBoss Portal and encodeNamespace
Perfect - than this should be an issue for JBoss Portal. regards, Martin
Re: Get pixel size from left: attribute via getter
IntelliJ doesn't realize this is allowed syntax - just ignore the error message of IntelliJ in this case! It should work anyways. regards, Martin On Jan 23, 2008 9:19 AM, Wolfgang [EMAIL PROTECTED] wrote: Hi Andrew, if I try to access my int variable from the backing bean, which has getter/setter, in the way as youe have described but then my editor (IntelliJ) says: invalid css property style; a term excepted; Cheers Andrew Robinson schrieb: Why not? It should. Have you set a breakpoint in the backing bean getter, or used a system.out to ensure that your value is correct? What do you see in the generated HTML? -Andrew On Jan 22, 2008 9:15 AM, Wolfgang [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi, yes this is exactly what I want to achieve...but it is not working.. Andrew Robinson schrieb: Is this what you want to do? h:panelGroup style=float:right; position:relative; top:2px; left:#{bean.left}px; On Jan 22, 2008 5:05 AM, Wolfgang [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi, I have a h:panelGroup with style attributes and I want to get the pixel size for the left: attribute via getter from the Bean. But since the left: attribute uses a colon instead of a =... like a simple value attrbiute the =#{bean.getter} does not work. I tried various combinations but no success.. h:panelGroup style=float:right; position:relative; top:2px; left:5px; Anny suggestions? Cheers, Wolfgang -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Re: Re: [Trinidad] tr:form/subform issue: form fields not passed
very strange - both fields are trinidad-fields? regards, Martin On 1/17/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: FYI ..the problem was a side effect of an input component actually consisting of two input media, one being an input field and the other a select field, and both pointing at the same property, which leads to a deactivation of the entire submit with no hints whatsoever :( [EMAIL PROTECTED] schrieb: - An: MyFaces Discussion users@myfaces.apache.org Von: [EMAIL PROTECTED] Datum: 17.01.2008 09:48AM Thema: Re: Re: [Trinidad] tr:form/subform issue: form fields not passed Hi, it is evaluated as false: ui:param name=readOnlyTest value=false / I updated it now to 1.2.5 but no change, the problem prevails. But it seems to me there must be something simple responsible for the problem.. In the mean time I eliminated showDetailItem and facelets for testing (except for the single input components made a facelets). So the possibilities for the problem are reduced to either the To sum it up: I have a form/subform structure as follows: tr:form tr:subform /tr:subform str:ubform /tr:subform tr:subform /tr:subform tr:commandButton id=myButton action=#{orderController.saveData} /tr:form When I am in the saveData method I check thru logging that the new form field values that have been entered. have not been set. If I apply tr:form commandButton=myButton tr:subform default=true /tr:subform tr:subform default=true /tr:subform tr:subform default=true /tr:subform tr:commandButton id=myButton action=#{orderController.saveData} /tr:form But then the button itself is dead and nothing happens. So which approach is the correct one? But maybe there is another problem with the page itself, which I have yet to come across. Thanks Wolfgang. PTA Programmier-Technische Arbeiten GmbH Seckenheimer Str. 65-67, 68165 Mannheim Amtsgericht Mannheim, HRB 1139 USt-IdNr.: DE 143 839 368 Geschäftsführer: Dipl.-Ing. Peter Fischer Dr. Harald W. Busch Dipl.-Kfm. Knut Fischer ** http://www.pta.de Mit 1539 Erfahrungsberichten aus 39 Jahren erfolgreicher Projektarbeit! ** PTA Programmier-Technische Arbeiten GmbH Seckenheimer Str. 65-67, 68165 Mannheim Amtsgericht Mannheim, HRB 1139 USt-IdNr.: DE 143 839 368 Geschäftsführer: Dipl.-Ing. Peter Fischer Dr. Harald W. Busch Dipl.-Kfm. Knut Fischer ** http://www.pta.de Mit 1539 Erfahrungsberichten aus 39 Jahren erfolgreicher Projektarbeit! ** -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Is it possible to use AddResource with my own components?
Thanks a lot! regards, Martin On 1/16/08, David Delbecq [EMAIL PROTECTED] wrote: http://wiki.apache.org/myfaces/External_Resources :) En l'instant précis du 15/01/08 21:33, Martin Marinschek s'exprimait en ces termes: Hi David, would you be willing - if time permits - to post a short outline of your solution on our Wiki? Thanks very much in advance! regards, Martin On Jan 12, 2008 2:33 PM, David Delbecq [EMAIL PROTECTED] wrote: Did here, nothing difficult or fancy about it. Just use the addResourcesFactory.getInstance(...) to get an instance of AddResource. Then use on it, methods with signature addXXX(, ResourceHandler resourceHandler); You just have to code your own resourceHandler class. Main job of this class is to split and check the ressources requested. It then returns a class of type org.apache.myfaces.renderkit.html.util.ResourceLoader which serve the requested content. Overall here, we had just a few lines of code. Another more stupid solution is to indeed put your resources in a subpackage of org.apache.myfaces.custom :) [EMAIL PROTECTED] a écrit : Hi, I've written a custom component that requires some Javascript. I have the js in an external file but I was hoping to have it included in the tag, kind of like the myfaces tags do. I tried using the AddResource class, basically looked at the myfaces source and tried to do the same thing, but it fails on the component validation. It checks if the package starts with org.apache.myfaces.custom… or something like that -- http://www.devlog.be (a belgian developer's logs) -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Is it possible to use AddResource with my own components?
Hi David, would you be willing - if time permits - to post a short outline of your solution on our Wiki? Thanks very much in advance! regards, Martin On Jan 12, 2008 2:33 PM, David Delbecq [EMAIL PROTECTED] wrote: Did here, nothing difficult or fancy about it. Just use the addResourcesFactory.getInstance(...) to get an instance of AddResource. Then use on it, methods with signature addXXX(, ResourceHandler resourceHandler); You just have to code your own resourceHandler class. Main job of this class is to split and check the ressources requested. It then returns a class of type org.apache.myfaces.renderkit.html.util.ResourceLoader which serve the requested content. Overall here, we had just a few lines of code. Another more stupid solution is to indeed put your resources in a subpackage of org.apache.myfaces.custom :) [EMAIL PROTECTED] a écrit : Hi, I've written a custom component that requires some Javascript. I have the js in an external file but I was hoping to have it included in the tag, kind of like the myfaces tags do. I tried using the AddResource class, basically looked at the myfaces source and tried to do the same thing, but it fails on the component validation. It checks if the package starts with org.apache.myfaces.custom… or something like that. I can't really get past that unless if I want to rebuild myfaces. Is there a way to get this to work externally? Or is there a way to do this I don't know about. For now I have to just manually include the script in the JSP pages. This will work, but it can lead to complication if someone else is using the tag and neglects to add the javascript. Thanks Matt -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
[OFFTOPIC] JSF Days Vienna
Hi *, I'd like to repeat my invitation to come to the JSF Days Vienna - the program promises to be very interesting, and we have a lot of attendees already - we are sure it will be an exciting conference for everyone. The 3-day conference costs 100€, and you will meet a lot of people working with JSF and technologies around JSF there. More info under: http://conference.irian.at/ regards, Martin -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: h:outputText converters and null objects
The converter does not get activated when the value is null? If this doesn't work in the RI, it is clearly a bug in the RI... regards, Martin On 1/4/08, MC PHERSON Sandy [EMAIL PROTECTED] wrote: Hi I have switched to using the Sun-RI because of a bug in the Weblogic Portal 10 JSF portlet bridge. However now it would appear that I get a side effect when feeding a null value to an output text, we have a lot of data structures where null is used to indicate optional fields. E.g a regulation with no end date is identified by a null date. h:outputText value=#{e.endDate} converter=DateTimeConverter/ When I explicitly specify the time converter like this with myfaces the converter gets activated, but with the RI this doesn't work. Any ideas why there is a difference in behaviour and which behaviour is correct? Both MyFaces and Sun-RI are the 1.1.1 versions bundled with WeblogicPortal 10. The application which I am porting to portlets was written using myfaces, so if I have to use the RI because of the weblogic bug, this could mean a lot of work to fix this... This message and any files transmitted with it are legally privileged and intended for the sole use of the individual(s) or entity to whom they are addressed. If you are not the intended recipient, please notify the sender by reply and delete the message and any attachments from your system. Any unauthorised use or disclosure of the content of this message is strictly prohibited and may be unlawful. Nothing in this e-mail message amounts to a contractual or legal commitment on the part of EUROCONTROL, unless it is confirmed by appropriately signed hard copy. Any views expressed in this message are those of the sender. -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: [Trinidad] Are compatibles Trinidad and Tobago?
Hi Rafa, Tomahawk should be compatible, Tobago is not. regards, Martin On 12/18/07, Rafa Pérez [EMAIL PROTECTED] wrote: Hello all, I am developing an application based on MyFaces 1.1.5, Trinidad 1.1.4 and JBoss Seam. I have been browsing MyFaces' project stack and have found some interesting components whose features are not present yet in Trinidad. The question is, are all of this component libraries compatible? If not, any of them? With Trinidad? Thank you in advance, - - Rafa -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: problems with t:commandLink
what version did you upgrade to? what servlet container version are you using? (if MyFaces 1.2, you'll need Tomcat 6) regards, Martin On 12/20/07, Jörg Niepenberg [EMAIL PROTECTED] wrote: Hello all, i recently updated my MyFaces libs. Now all the h:blabla wont work anymore and i get this error: |javax.servlet.ServletException: Unable to convert string Sign Up to *class* javax.el.ValueExpression *for* attribute value: Property Editor not registered with the PropertyEditorManager If i change the tags to t:blabla it is working. Why is that? The next more important problem is that my t:commandLink tags dont do anything. I click on the Link and there is just a # appended in the adressbar and nothing else happens. When i just change the tag to t:commandButton everythings working as it should, but i want to use Links for design reasons. Can anybody help me? Thanks. | -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: How to Hack the HtmlFormRenderer?
Hi ole, what form are you using? h:form or s:form? If you are using h:form, then you'll be working against: org/apache/myfaces/shared_impl/renderkit/html/HtmlFormRendererBase.java In any case, you are right, they stem from the same source in: org.apache.myfaces.shared.renderkit.html - you should only need to change this, do a full maven build, and this should take on your changes. The problem might however be that the pom.xml of MyFaces impl is referring to an old version of shared, so you might need to upgrade this to the snapshot version so that you actually see your changes when you do the build. regards, Martin On 12/17/07, Ole Ersoy [EMAIL PROTECTED] wrote: Hi, I've been trying to hack the HtmlFormRenderer. It's contained in org.apache.myfaces.shared.renderkit.html...but appears to be moved to org.apache.myfaces.shared_impl.renderkit.html during the build. I tried commenting out all of encodeBegin. Then I deleted the myfaces directory in my maven repository. Then rebuilt. Then redeployed the testing application, and maven only downloaded non-shared resources, so I'm certain that I'm changing the right dependency. The forms are still rendering though. When I do a find on HtmlFormRendererBase the following shows up: [EMAIL PROTECTED] myfaces-shared-core-3_0_0]$ find . -name HtmlFormRendererBase.java ./shared-impl/target/refactored-shared-sources/main/java/org/apache/myfaces/shared_impl/renderkit/html/HtmlFormRendererBase.java ./core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java ./shared-tomahawk/target/refactored-shared-sources/main/java/org/apache/myfaces/shared_tomahawk/renderkit/html/HtmlFormRendererBase.java So it seems like there is only one HtmlFormRenderBase to be changed, since the second one is the first one, and the Tomahawk one is not being used by the HtmlFormRenderer. Ideas? TIA, - Ole -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: t:saveState
Hi Simon, serialization should not be necessary - it should work without (if restoreState/saveState get called at least, and that should happen for any recent version of the RI). @shyamprasad: in the very first versions of the RI the stateSaving/Restoring was not processed - which version of the RI are you using? regards, Martin On Dec 13, 2007 9:18 AM, Simon Kitching [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] schrieb: Hi, I have used t:saveState in a JSP. I am using JSF RI configured the STATE_SAVING = server in web.xml When Submit a Form, The View is not getting restored with the updated ManagedBean which is early stored in t:saveState. How to synchronise the Updated Managed Bean with the latest view ?The View always displays the old existing values from the managed bean The Situation is similar to http://issues.apache.org/jira/browse/TOMAHAWK-134 Can someone pls help me how to solve the problem. As noted in this email from Ryan Lubke, Sun RI v 1.2_05 now has a serialize state in session option. I presume that turning this on will cause tomahawk t:saveState to start working with (RI + server-side-state): http://mail-archives.apache.org/mod_mbox/myfaces-users/200712.mbox/[EMAIL PROTECTED] I've updated the referenced issue to include this info too. Shyamprasad, please send an email to this list to let us know whether this solves the issue or not. Regards, Simon -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Getting all currently loaded managed beans in a phase listener
Hi Todd, yes, but if you are using Spring for your service beans, you can easily use it also for your JSF managed beans. The suggestion of Gerald and Simon was - don't use the JSF managed bean facility at all, use only spring beans (since spring 2.0, you can scope them with request/session-scope). regards, Martin On Nov 30, 2007 1:55 AM, Todd Nine [EMAIL PROTECTED] wrote: Thanks guys. I'll probably just go with the managed property method and add my inits to the last setter. I wasn't aware that it is part of the spec that they're loaded in defined order. Knowing that makes it much easier to fix the issue. As far as using Spring beans for business objects, I use the Spring JSF variable resolver http://static.springframework.org/spring/docs/2.0.x/reference/webintegration.html#jsf to inject my spring beans into my JSF beans with managed properties. This allows me to wire everything together without the need to add a lot of spring context lookups into my code. On Nov 29, 2007 3:33 PM, simon [EMAIL PROTECTED] wrote: Hi Todd, Yes, I agree with Gerald. Have a look at catagay's more recent post: http://cagataycivici.wordpress.com/2007/09/10/using-spring-to-manage-jsf-beans/ Since Spring 2.0 it has been possible to declare a scope in spring bean configuration, so there is absolutely no point in using JSF managed beans at all any more. And then with spring you have proper facilities to solve this, including (in order of preference for me): * injection via constructor params * an @PostConstruct annotation within the bean (Spring 2.5) * an init-method attribute in the bean config If you absolutely cannot move to Spring 2.x then Volker's reply is also an option: use the last property in the props list for the managed bean to trigger the init. I'm not sure what you mean by get currently loaded beans. When beans are created they go into the standard request,session or app scopes like all other variables. You could write a custom VariableResolver that delegates all calls down to the real implementation; this will see every request to get a bean. However the problem is that there is no way to know whether the object returned by the underlying variable resolver has just been created or it already existed. You could register a listener on a Session which would get informed of every variable that gets added to the http session. However AFAIK there is no equivalent for request scope. Maybe you could override the HttpRequest object and use a custom map for the properties that supported a listener like session does. All rather tricky though. Regards, Simon On Thu, 2007-11-29 at 20:58 +0100, Gerald Müllan wrote: Hi, why do you define the managed-beans via the jsf-managed-bean facility? Would be a lot easier if you also define them with the help of spring. You can use the init-method property in Spring in order to initialize your Spring bean. cheers, Gerald On Nov 29, 2007 7:56 PM, Todd Nine [EMAIL PROTECTED] wrote: Hi all, I'm using a combination of Spring and MyFaces for my project. Since I use the managed bean properties to inject my Spring beans into my managed beans, I'm unable to do initialization in the constructor, and I really need to implement a callback in my managed beans to initialize values from the Spring business objects. I have created something similar to the example on the following site. http://cagataycivici.wordpress.com/2006/06/06/managed_beans_aware_of_the/ However, I'm dealing with a legacy application, and I can't depend on a standard naming convention as the example does, there is far too much code to refactor everything. Is there any way I can get all currently loaded beans in the current thread instead of using something like the following to explicitly return it? event.getFacesContext().getApplication().createValueBinding(beanName).getValue(ctx); Thanks, Todd -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
[OFFTOPIC] JSFDays Vienna
Hi all, we'd like to invite you to a JSF conference in Vienna, Austria from 12-14th of March. Anyone who wants to present a session or (pre-)register as an attendee? Here is the link: http://conference.irian.at - click on preregister. Attendees will pay a very small conference fee - 100€ (speakers will not have to pay this fee). There will be a supporting programm alongside the conference - so you will (additionally to learning about JSF and improving your JSF knowledge) have a good chance of getting to know Vienna and its surroundings. regards, Martin -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: optional validator - missing rendered attribute
Hi Mike, Michael, you should not use component-bindings with session-scoped beans - if you take a look at Orchestra, you can however find a way how to embed a request-scoped bean into a session-scoped bean, and put your component-bindings there. Looking forward to JSF 2.0, I would not use component bindings if you can help it. In JSF 2.0, much of the state will be stored in the template, not in the component-tree - so you will have better performance if you keep to the template as much as possible. regards, Martin On 10/22/07, Mike Kienenberger [EMAIL PROTECTED] wrote: Not really. I have always avoided both session scoped beans and component building via java code (except years ago before I discovered facelets). I know others have done it. The only possibly-helpful tips I can remember are 1) do the component creation in the getter not the setter, and always manually set an id. The more I think about it, the more I think I'll try the c:forEach and c:if technique (with facelets) first. On 10/22/07, Michael Heinen [EMAIL PROTECTED] wrote: Regarding your approach with the component bindings: I have not used them at all and I am a little bit afraid of them. In this list I read multiple times that they are some kind of evil ;-) specially in combination with session scoped beans. Btw I don't like my approach with the rendered flags but this allows the html designers to do easy modifications which they can't do if I set everything programmatically in components. But the component binding approach should be more performant of course. Do you have any good tips regarding component bindings in combination with session scoped beans ? Michael -Original Message- From: Mike Kienenberger [mailto:[EMAIL PROTECTED] Sent: Montag, 22. Oktober 2007 17:47 To: MyFaces Discussion Subject: Re: optional validator - missing rendered attribute For what it's worth, the optional validation discussions of the past dealt with wrapping each validator in an optional validator component, and then globally traversing the component tree. This approach works very poorly, so I abandoned it in favor of s:subForm. That will not help your situation, however. All of the tomahawk validators inherit from ValidatorBase. You could add an optional attribute to that class, but you'd still have to change each validator to evaluate it. This also won't help for the non-ValidatorBase validators. I will probably be in a similar situation down the road. I suspect that the easiest solution will be to bind a component (like a panelGroup) to a backing bean and dynamically construct the dynamic component tree from java code rather than trying to do it from page code with rendered (and active) attributes. Although with facelets, using c:forEach and c:if might work too. On 10/22/07, Michael Heinen [EMAIL PROTECTED] wrote: Hi Simon, maybe I did not express myself or the problem well. I didn't want to go on confrontation course, sorry if you got that impression. Quite the contrary I am happy about feedback, workarounds and suggestions. That's the reason for my postings. I just was astonished that all components have the rendered attribute but validators not. Now I know that there is not any existing feature that I missed and use various input components with their own validators. But a disadvantage of this is from my point of view that I have also to use multiple label tags (or EL expressions for the for-attribute because I have then various input fields with other client ids used in the for-attribute of the label tag). And ajax updates will be a little bit more complex because I have to update a container tag rather than directly a field. Michael -Original Message- From: Simon Kitching [mailto:[EMAIL PROTECTED] Sent: Montag, 22. Oktober 2007 16:08 To: MyFaces Discussion Cc: Michael Heinen Subject: RE: optional validator - missing rendered attribute Hi Michael, Michael Heinen [EMAIL PROTECTED] schrieb: Here is a sample: t:dataList id=myFields value=#{FieldConfigurationController.myFields} var=entry t:div rendered=#{entry.type=='inputText'} t:inputText id=s_inputText value=#{MyController.search.attributes[entry.name]} ... my:validateCompareTo active=#{entry.contentType=='range' entry.name='to'} for=rangeFrom operator== .../ my:validateEmail active=#{entry.contentType=='email'} ... /t:inputText ... /t:div t:div rendered=#{entry.type=='selectOne'} ... /t:div t:dataList I loop over a list which contains the fields that should be rendered. These fields are not known at compile time. The fields are
Re: MyFaces for production? Not even conformance with HTML 4.01?
Hi Stefan, if you want to use 1.2, you should currently use 1.2.1-SNAPSHOT. There are several major bugs in 1.2 which have been fixed in the meantime. The problem with the value-expressions I cannot reproduce - are you talking about Tomahawk there? @warnings in the produced HTML: I can't follow you there - both the RI and MyFaces produce ids of the form _id42, so I don't see how this would be different between the implementations? regards, Martin On 10/21/07, Stefan [EMAIL PROTECTED] wrote: Hello, I am evaluating JSF as an option for our next web project. I did some basic evaluation with Suns implementation. It works fine and was easy to get started. We would like to use more elaborated components and I took a quick look at MyFaces and Tomahawk. Unfortunately not with the same success and hopefully all my beginners fault. First of all, I did still not manage to run MyFaces 1.2 successfully. Even in a most basic hello user example, I get a lot of complains about value expressions, which are not permitted as attribute values (Java 6, Tomcat 6. Could this be the problem?). Next I looked at the latest Tomahawk examples. They use MyFaces 1.1 but the resulting HTML is full of errors and warnings. Even with my most basic hello user example (only one button and one input field), I get complains about invalid name and id attributes. The values start with underscores, which is not allowed in HTML4. So I wonder if it makes sense to continue with the MyFaces Implementation. Did I miss something? Don't You think, Spec and HTML4 conformance is important? Do You know other implementations, which are adhere to the Specs? I appreciate any hint or comment. Thank You all Stefan -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: optional validator - missing rendered attribute
Hi Matze, for 1 - look at this: http://myfaces.apache.org/orchestra/myfaces-orchestra-core/component-bindings.html for 2 - there is nothing definitive there (JSF 2.0 has not yet been released), but that's my opinion which will probably proof to be true ;) regards, Martin On 10/24/07, Matthias Wessendorf [EMAIL PROTECTED] wrote: are some docs on that out there ? On 10/24/07, Martin Marinschek [EMAIL PROTECTED] wrote: Hi Mike, Michael, you should not use component-bindings with session-scoped beans - if you take a look at Orchestra, you can however find a way how to embed a request-scoped bean into a session-scoped bean, and put your component-bindings there. Looking forward to JSF 2.0, I would not use component bindings if you can help it. In JSF 2.0, much of the state will be stored in the template, not in the component-tree - so you will have better performance if you keep to the template as much as possible. regards, Martin On 10/22/07, Mike Kienenberger [EMAIL PROTECTED] wrote: Not really. I have always avoided both session scoped beans and component building via java code (except years ago before I discovered facelets). I know others have done it. The only possibly-helpful tips I can remember are 1) do the component creation in the getter not the setter, and always manually set an id. The more I think about it, the more I think I'll try the c:forEach and c:if technique (with facelets) first. On 10/22/07, Michael Heinen [EMAIL PROTECTED] wrote: Regarding your approach with the component bindings: I have not used them at all and I am a little bit afraid of them. In this list I read multiple times that they are some kind of evil ;-) specially in combination with session scoped beans. Btw I don't like my approach with the rendered flags but this allows the html designers to do easy modifications which they can't do if I set everything programmatically in components. But the component binding approach should be more performant of course. Do you have any good tips regarding component bindings in combination with session scoped beans ? Michael -Original Message- From: Mike Kienenberger [mailto:[EMAIL PROTECTED] Sent: Montag, 22. Oktober 2007 17:47 To: MyFaces Discussion Subject: Re: optional validator - missing rendered attribute For what it's worth, the optional validation discussions of the past dealt with wrapping each validator in an optional validator component, and then globally traversing the component tree. This approach works very poorly, so I abandoned it in favor of s:subForm. That will not help your situation, however. All of the tomahawk validators inherit from ValidatorBase. You could add an optional attribute to that class, but you'd still have to change each validator to evaluate it. This also won't help for the non-ValidatorBase validators. I will probably be in a similar situation down the road. I suspect that the easiest solution will be to bind a component (like a panelGroup) to a backing bean and dynamically construct the dynamic component tree from java code rather than trying to do it from page code with rendered (and active) attributes. Although with facelets, using c:forEach and c:if might work too. On 10/22/07, Michael Heinen [EMAIL PROTECTED] wrote: Hi Simon, maybe I did not express myself or the problem well. I didn't want to go on confrontation course, sorry if you got that impression. Quite the contrary I am happy about feedback, workarounds and suggestions. That's the reason for my postings. I just was astonished that all components have the rendered attribute but validators not. Now I know that there is not any existing feature that I missed and use various input components with their own validators. But a disadvantage of this is from my point of view that I have also to use multiple label tags (or EL expressions for the for-attribute because I have then various input fields with other client ids used in the for-attribute of the label tag). And ajax updates will be a little bit more complex because I have to update a container tag rather than directly a field. Michael -Original Message- From: Simon Kitching [mailto:[EMAIL PROTECTED] Sent: Montag, 22. Oktober 2007 16:08 To: MyFaces Discussion Cc: Michael Heinen Subject: RE: optional validator - missing rendered attribute Hi Michael, Michael Heinen [EMAIL PROTECTED] schrieb: Here is a sample: t:dataList id=myFields value=#{FieldConfigurationController.myFields} var=entry t:div rendered=#{entry.type=='inputText'} t:inputText
Re: Conformance with HTML 4.01?
Hi Simon, the RI is definitely rendering _id. I have been questioning this before, answer was there are versions of the HTML spec where the _ is a valid starting character. I don't remember which versions this were - XHTML? regards, Martin On 10/24/07, Simon Kitching [EMAIL PROTECTED] wrote: Martin Marinschek [EMAIL PROTECTED] schrieb: @warnings in the produced HTML: I can't follow you there - both the RI and MyFaces produce ids of the form _id42, so I don't see how this would be different between the implementations? This is an interesting point. The HTML401 spec does say that an ID attribute must start with ([A-Za-z]) http://www.w3.org/TR/html4/types.html#type-name However UIViewRoot.UNIQUE_ID_PREFIX is specified as _id in the official Sun javadocs (ie the spec). I guess the html renderkit should be transforming this component id into a valid html value, and transforming it back before the decode step. Does the renderkit get invoked before decode? Martin, I presume you're saying that sun are really writing _id into the html output, like MyFaces does? If so there any reason why MyFaces would need to stay compatible with Sun here? I can't think of one.. Regards, Simon -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Exception from MyFaces JSF 1.2 and Weblogic Portal 10 whilst using SUN RI 1.2
Bear in mind that running MyFaces 1.2.0 offline is not possible - this is a bug. it is possible however to run MyFaces 1.2.1-SNAPSHOT offline. You cannot download the snapshot, however, as the MyFaces snapshots are not available. You can only checkout the head-version and build it yourself (this is fairly easy with Maven, checkout source of MyFaces, download and unzip maven, set MAVEN_HOME, change into MyFaces source directory, execute mvn clean install). regards, Martin On 10/15/07, MC PHERSON Sandy [EMAIL PROTECTED] wrote: Scott O'Bryan wrote: No the Sun R.I. is a different codebase then MyFaces. You can log bugs against the R.I. at java.net That said, the stacktrace you've posted is not from the RI code base, so you're still dealing with MyFaces. It was a Weblogic issue. I had to re-create the Weblogic domain from scratch and then myfaces wasn't picked up any longer, simply undeploying myfaces did not seem to have any effect. I will now switch over to the Weblogic forums to find out why their bundled version of the RI still refuses to work! This message and any files transmitted with it are legally privileged and intended for the sole use of the individual(s) or entity to whom they are addressed. If you are not the intended recipient, please notify the sender by reply and delete the message and any attachments from your system. Any unauthorised use or disclosure of the content of this message is strictly prohibited and may be unlawful. Nothing in this e-mail message amounts to a contractual or legal commitment on the part of EUROCONTROL, unless it is confirmed by appropriately signed hard copy. Any views expressed in this message are those of the sender. -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: [Announce] Release of Apache MyFaces Orchestra 1.0
Yeah!! regards, Martin On 10/12/07, Mario Ivankovits [EMAIL PROTECTED] wrote: The Apache MyFaces Orchestra team is pleased to announce the release of Apache MyFaces Orchestra Core 1.0. Apache MyFaces Orchestra is a library which introduce a new scope called conversation scope to your web based application which will help you alot building applications using ORM by avoiding exceptions like LazyInitializationException. Get a full overview at Orchestras homepage [1]. The distribution is available at * http://myfaces.apache.org/orchestra/download.html Apache MyFaces Orchestra is available in the central Maven repository under Group ID org.apache.myfaces.orchestra. Have fun! Ciao, Mario [1] http://myfaces.apache.org/orchestra -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Daily Builds
Hi Timm, there has been a recent mail to the dev-list about this. Also the maven snapshot builds are missing. I'm forwarding to dev as well. regards, Martin On 10/9/07, Timm Helbig [EMAIL PROTECTED] wrote: Hi, the link to the Nightly Builds from the Trinidad Download page is leading to old files only. The newest is from 28.06.07. I searched the list, but did not found any relevant announcement on this. Where can I find the newer builds? Thanks, Timm -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: inputTextHelp value if no change
Hi Dave, yes, this is a bug - the field should automatically remove the help text and set it to null (at least this is how I intended it). regards, Martin On 10/10/07, Dave [EMAIL PROTECTED] wrote: t:inputTextHelp value=#{bean.value} helpText=Please input a name/ if user does not input anything and leave the help text unchanged, the binding value should be null. But currently it is the help text. Is this a bug? Dave - Need a vacation? Get great deals to amazing places on Yahoo! Travel. -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: curious decode problem
Very interesting - wouldn't see what would cause this. Can you debug through the first phase of JSF (restore-view) to see what happens? In the end, the state will be restored if you do have a javax.faces.ViewState parameter send along, and this parameter can properly be decrypted into an object-tree. Exception: you might have a phase-listener configured which does something else? regards, Martin On 10/10/07, David Delbecq [EMAIL PROTECTED] wrote: Hello community, I have a curious decode problem with myfaces: First, i submit a form, with custom component. One form entry is invalid. Custom component decode() gets called, then it's getConvertedValue(), whcih throws a ConvertException. JSF properly redisplay form, with submitted values, and the conversion error message At second step: I fix my value (remove letters in a decimal type field) and submit. At that point, for reasons i couldn't explain, the JSF threat this like a request for a new view instead of a restore view. As such, decode() is not called, and all the values are taken back from my backing bean, invalidation everything user submitted. I added a classical h:inputText field linked to a backing bean String value, this one shows same behaviour (reset to backing bean instead of applying user submitted value). Can someone explain me whyn after throwin a ConverterException from getConvertedValue() the view gets invalidaed by JSF? Thanks a lot, am out of ideas to locate problem... For information: extract of jsf form: h:form id=parameterTestForm enctype=multipart/form-data s:parameter popupDocument=/select.jsp value=#{parameterTestBean.parameters[0]} id=myArray/ (Parameter 0 value is #{parameterTestBean.parameters[0].value}, name is #{parameterTestBean.parameters[0].name}) br/ . h:inputText id=marker value=#{parameterTestBean.parameters[8].name}/ #{parameterTestBean.parameters[8].name} br/ h:commandButton value=test action=test id=test/ /h:form -- http://www.devlog.be (a belgian developer's logs) -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Behaviour of JSF related to renderer instances
Hi Simon, David, it's of course 2 ;) regards, Martin On 10/1/07, Simon Kitching [EMAIL PROTECTED] wrote: David Delbecq [EMAIL PROTECTED] schrieb: Hello, I have a quite technical question related to Renderers in JSF. When several components references the same Renderers, what's the expected behaviour? 1) One and only one renderer is instanciated and used for the whole life of application, his methods being called concurrently 2) One and only one renderer is instanciated for each component type, his methods being called concurrently 3) For each component in tree, a renderer in instanciated called during lifecycle and freed when respnse is send 4) Behaviour is not explicited by JSF specs and application should consider Renderers could shared, but are not forced to be. From the Sun javadoc for the renderer class: http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/api/javax/faces/render/Renderer.html quote Individual Renderer instances will be instantiated as requested during the rendering process, and will remain in existence for the remainder of the lifetime of a web application. Because each instance may be invoked from more than one request processing thread simultaneously, they MUST be programmed in a thread-safe manner. /quote So it seems that (1) is what is required by the spec. Regards, Simon -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Behaviour of JSF related to renderer instances
Well, not quite: it is one renderer-instance per application, per renderer-type and component-family. regards, Martin On 10/4/07, Martin Marinschek [EMAIL PROTECTED] wrote: Hi Simon, David, it's of course 2 ;) regards, Martin On 10/1/07, Simon Kitching [EMAIL PROTECTED] wrote: David Delbecq [EMAIL PROTECTED] schrieb: Hello, I have a quite technical question related to Renderers in JSF. When several components references the same Renderers, what's the expected behaviour? 1) One and only one renderer is instanciated and used for the whole life of application, his methods being called concurrently 2) One and only one renderer is instanciated for each component type, his methods being called concurrently 3) For each component in tree, a renderer in instanciated called during lifecycle and freed when respnse is send 4) Behaviour is not explicited by JSF specs and application should consider Renderers could shared, but are not forced to be. From the Sun javadoc for the renderer class: http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/api/javax/faces/render/Renderer.html quote Individual Renderer instances will be instantiated as requested during the rendering process, and will remain in existence for the remainder of the lifetime of a web application. Because each instance may be invoked from more than one request processing thread simultaneously, they MUST be programmed in a thread-safe manner. /quote So it seems that (1) is what is required by the spec. Regards, Simon -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: Errors and Messages
Hi Daniel, there is no filtering available on the component - you'd need to write a new renderer. regards, Martin On 9/28/07, daniel ccss [EMAIL PROTECTED] wrote: Anyone?? On 9/26/07, daniel ccss [EMAIL PROTECTED] wrote: Thanks, but how can I have two h:messages one for errors and one for messages?? On 9/26/07, Kito D. Mann [EMAIL PROTECTED] wrote: From: daniel ccss [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 26, 2007 10:26 AM To: MyFaces Discussion Subject: Errors and Messages Hi all, I need to use a different style for showing messages and errors. For my messages I use this in my bean FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(message)); And this in the JSP h:messages styleClass=messages/ How can display errors in this way using a different style. Look at the h:messages tag – there's an errorClass property. ~~~ Kito D. Mann - Author, JavaServer Faces in Action http://www.virtua.com - JSF/Java EE consulting, training, and mentoring http://www.JSFCentral.com - JavaServer Faces FAQ, news, and info * Sign up for the JSF Central newsletter! http://oi.vresp.com/?fid=ac048d0e17 * -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: [Trinidad] selectOneChoice with autoSubmit problem
Hi Stephen, do this: tr:form id=departmentForm tr:selectOneChoice id=departments label=Department value=#{scoreEntryHome.department} autoSubmit=true s:selectItems value=#{scoreEntryHome.allowedDepartments} var=department label=#{department.name}/ /tr:selectOneChoice tr:commandButton id=SaveButton text=Update action=#{scoreEntryHome.save}/ /tr:form tr:form tr:table var=scoreEntry value=#{scoreEntryHome.scoreEntries} partialTriggers=::departmentForm:departments tr:column headerText=Name tr:selectBooleanCheckbox value=#{scoreEntry.name}/ /tr:column with :: you can get out of your naming-container up one level and then back in again with : and name. regards, Martin On 9/28/07, Richard Yee [EMAIL PROTECTED] wrote: You might try not using multiple forms and also not having the form id=departments and the selectOneChoice also set to departments -Richard Stephen Friedrich wrote: It seems that autoSubmit from a tr:selectOneChoice always uses PPR. I can't get other components to update, though. This is what I tried: tr:form id=departments tr:selectOneChoice id=departments label=Department value=#{scoreEntryHome.department} autoSubmit=true s:selectItems value=#{scoreEntryHome.allowedDepartments} var=department label=#{department.name}/ /tr:selectOneChoice tr:commandButton id=SaveButton text=Update action=#{scoreEntryHome.save}/ /tr:form tr:form tr:table var=scoreEntry value=#{scoreEntryHome.scoreEntries} partialTriggers=departments tr:column headerText=Name tr:selectBooleanCheckbox value=#{scoreEntry.name}/ /tr:column On the server scoreEntryHome.setDepartment() gets correctly called with the newly selected department, but the table won't update. I added the Update button just for testing, and of course it works fine. What am I doing wrong this time? ;-) Alternatively: Is there a way to disable PPR for autoSubmit? Oh, and additionally: It should be documented in the tag description that autoSubmit does PPR. (Trinidad 1.0.2, MyFaces 1.1.5, Facelets from VCS, Seam 1.2.1 on Tomcat 5.5.17) -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: [Trinidad] selectOneChoice with autoSubmit problem
Oh, right. Wonder why Stephen's solution finally works then? regards, Martin On 9/28/07, Matthias Wessendorf [EMAIL PROTECTED] wrote: tr:form isn't a namingcontainer On 9/28/07, Martin Marinschek [EMAIL PROTECTED] wrote: Hi Stephen, do this: tr:form id=departmentForm tr:selectOneChoice id=departments label=Department value=#{scoreEntryHome.department} autoSubmit=true s:selectItems value=#{scoreEntryHome.allowedDepartments} var=department label=#{department.name}/ /tr:selectOneChoice tr:commandButton id=SaveButton text=Update action=#{scoreEntryHome.save}/ /tr:form tr:form tr:table var=scoreEntry value=#{scoreEntryHome.scoreEntries} partialTriggers=::departmentForm:departments tr:column headerText=Name tr:selectBooleanCheckbox value=#{scoreEntry.name}/ /tr:column with :: you can get out of your naming-container up one level and then back in again with : and name. regards, Martin On 9/28/07, Richard Yee [EMAIL PROTECTED] wrote: You might try not using multiple forms and also not having the form id=departments and the selectOneChoice also set to departments -Richard Stephen Friedrich wrote: It seems that autoSubmit from a tr:selectOneChoice always uses PPR. I can't get other components to update, though. This is what I tried: tr:form id=departments tr:selectOneChoice id=departments label=Department value=#{scoreEntryHome.department} autoSubmit=true s:selectItems value=#{scoreEntryHome.allowedDepartments} var=department label=#{department.name}/ /tr:selectOneChoice tr:commandButton id=SaveButton text=Update action=#{scoreEntryHome.save}/ /tr:form tr:form tr:table var=scoreEntry value=#{scoreEntryHome.scoreEntries} partialTriggers=departments tr:column headerText=Name tr:selectBooleanCheckbox value=#{scoreEntry.name}/ /tr:column On the server scoreEntryHome.setDepartment() gets correctly called with the newly selected department, but the table won't update. I added the Update button just for testing, and of course it works fine. What am I doing wrong this time? ;-) Alternatively: Is there a way to disable PPR for autoSubmit? Oh, and additionally: It should be documented in the tag description that autoSubmit does PPR. (Trinidad 1.0.2, MyFaces 1.1.5, Facelets from VCS, Seam 1.2.1 on Tomcat 5.5.17) -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- Matthias Wessendorf further stuff: blog: http://matthiaswessendorf.wordpress.com/ mail: matzew-at-apache-dot-org -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: [Trinidad] selectOneChoice with autoSubmit problem
@Stephen: tr:subform is a naming-container? ok. interesting. wonder why. @Matze: Why would he want to update the full form? regards, Martin On 9/28/07, Matthias Wessendorf [EMAIL PROTECTED] wrote: On 9/28/07, Stephen Friedrich [EMAIL PROTECTED] wrote: Thanks a lot for all the answers. The duplicate id on form was actually a left-over from trial-and-error. I still don't understand why it did not work (without an id at the form). Sure, PPR works across forms, does it? I think you need to say partialTriggers=departments on the second form. -M Anyway this version works fine: |tr:form |tr:subform id=selectForm |tr:selectOneChoice id=departments label=Department |value=#{scoreEntryHome.department} autoSubmit=true | |s:selectItems value=#{scoreEntryHome.allowedDepartments} |var=department label=#{department.name}/ |/tr:selectOneChoice |/tr:subform | |tr:subform |tr:table var=scoreEntry value=#{scoreEntryHome.scoreEntries} | partialTriggers=:selectForm:departments Can somebody please add it to the tag docs that tr:selectOneChoice's autoSubmit does PPR?! Also it should be possible to switch to regular submit. E.g. server-side error logs are more useful - an exception during a PPR request is logged, but without giving the nested, original exception. Also currently individual component messages are not shown as a result of PPR. tr:form isn't a namingcontainer On 9/28/07, Martin Marinschek [EMAIL PROTECTED] wrote: Hi Stephen, do this: tr:form id=departmentForm tr:selectOneChoice id=departments label=Department value=#{scoreEntryHome.department} autoSubmit=true s:selectItems value=#{scoreEntryHome.allowedDepartments} var=department label=#{department.name}/ /tr:selectOneChoice tr:commandButton id=SaveButton text=Update action=#{scoreEntryHome.save}/ /tr:form tr:form tr:table var=scoreEntry value=#{scoreEntryHome.scoreEntries} partialTriggers=::departmentForm:departments tr:column headerText=Name tr:selectBooleanCheckbox value=#{scoreEntry.name}/ /tr:column with :: you can get out of your naming-container up one level and then back in again with : and name. regards, Martin On 9/28/07, Richard Yee [EMAIL PROTECTED] wrote: You might try not using multiple forms and also not having the form id=departments and the selectOneChoice also set to departments -Richard Stephen Friedrich wrote: It seems that autoSubmit from a tr:selectOneChoice always uses PPR. I can't get other components to update, though. This is what I tried: tr:form id=departments tr:selectOneChoice id=departments label=Department value=#{scoreEntryHome.department} autoSubmit=true s:selectItems value=#{scoreEntryHome.allowedDepartments} var=department label=#{department.name}/ /tr:selectOneChoice tr:commandButton id=SaveButton text=Update action=#{scoreEntryHome.save}/ /tr:form tr:form tr:table var=scoreEntry value=#{scoreEntryHome.scoreEntries} partialTriggers=departments tr:column headerText=Name tr:selectBooleanCheckbox value=#{scoreEntry.name}/ /tr:column On the server scoreEntryHome.setDepartment() gets correctly called with the newly selected department, but the table won't update. I added the Update button just for testing, and of course it works fine. What am I doing wrong this time? ;-) Alternatively: Is there a way to disable PPR for autoSubmit? Oh, and additionally: It should be documented in the tag description that autoSubmit does PPR. (Trinidad 1.0.2, MyFaces 1.1.5, Facelets from VCS, Seam 1.2.1 on Tomcat 5.5.17) -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- Matthias Wessendorf further stuff: blog: http://matthiaswessendorf.wordpress.com/ mail: matzew-at-apache-dot-org -- Matthias Wessendorf further stuff: blog: http://matthiaswessendorf.wordpress.com
Re: [Trinidad] selectOneChoice with autoSubmit problem
Does the subform then have a prependId attribute? regards, Martin On 9/28/07, Matthias Wessendorf [EMAIL PROTECTED] wrote: On 9/28/07, Martin Marinschek [EMAIL PROTECTED] wrote: @Stephen: tr:subform is a naming-container? ok. interesting. wonder why. that allows you to reuse IDs inside your subforms. @Matze: Why would he want to update the full form? I tried and it only worked that way. Isn't the real question, why using two forms in one page? Tobago, for instance has only one form, that is rendered with their tc:page / component. I think now, that Stephen uses a subForm, this solution is IMO more correct. -M regards, Martin On 9/28/07, Matthias Wessendorf [EMAIL PROTECTED] wrote: On 9/28/07, Stephen Friedrich [EMAIL PROTECTED] wrote: Thanks a lot for all the answers. The duplicate id on form was actually a left-over from trial-and-error. I still don't understand why it did not work (without an id at the form). Sure, PPR works across forms, does it? I think you need to say partialTriggers=departments on the second form. -M Anyway this version works fine: |tr:form |tr:subform id=selectForm |tr:selectOneChoice id=departments label=Department |value=#{scoreEntryHome.department} autoSubmit=true | |s:selectItems value=#{scoreEntryHome.allowedDepartments} |var=department label=#{department.name}/ |/tr:selectOneChoice |/tr:subform | |tr:subform |tr:table var=scoreEntry value=#{scoreEntryHome.scoreEntries} | partialTriggers=:selectForm:departments Can somebody please add it to the tag docs that tr:selectOneChoice's autoSubmit does PPR?! Also it should be possible to switch to regular submit. E.g. server-side error logs are more useful - an exception during a PPR request is logged, but without giving the nested, original exception. Also currently individual component messages are not shown as a result of PPR. tr:form isn't a namingcontainer On 9/28/07, Martin Marinschek [EMAIL PROTECTED] wrote: Hi Stephen, do this: tr:form id=departmentForm tr:selectOneChoice id=departments label=Department value=#{scoreEntryHome.department} autoSubmit=true s:selectItems value=#{scoreEntryHome.allowedDepartments} var=department label=#{department.name}/ /tr:selectOneChoice tr:commandButton id=SaveButton text=Update action=#{scoreEntryHome.save}/ /tr:form tr:form tr:table var=scoreEntry value=#{scoreEntryHome.scoreEntries} partialTriggers=::departmentForm:departments tr:column headerText=Name tr:selectBooleanCheckbox value=#{scoreEntry.name}/ /tr:column with :: you can get out of your naming-container up one level and then back in again with : and name. regards, Martin On 9/28/07, Richard Yee [EMAIL PROTECTED] wrote: You might try not using multiple forms and also not having the form id=departments and the selectOneChoice also set to departments -Richard Stephen Friedrich wrote: It seems that autoSubmit from a tr:selectOneChoice always uses PPR. I can't get other components to update, though. This is what I tried: tr:form id=departments tr:selectOneChoice id=departments label=Department value=#{scoreEntryHome.department} autoSubmit=true s:selectItems value=#{scoreEntryHome.allowedDepartments} var=department label=#{department.name}/ /tr:selectOneChoice tr:commandButton id=SaveButton text=Update action=#{scoreEntryHome.save}/ /tr:form tr:form tr:table var=scoreEntry value=#{scoreEntryHome.scoreEntries} partialTriggers=departments tr:column headerText=Name tr:selectBooleanCheckbox value=#{scoreEntry.name}/ /tr:column On the server scoreEntryHome.setDepartment() gets correctly called with the newly selected department, but the table won't update. I added the Update button just
Re: Orchestra Question / another solution?
I wouldn't call spring-webflow too complicated in comparison to Orchestra - but what you can't do with spring-webflow is to handle the underlying JPA-persistence context out of the box, you can do that with Orchestra. regards, Martin On 9/28/07, Simon Kitching [EMAIL PROTECTED] wrote: See here for information about conversations: http://myfaces.apache.org/orchestra/myfaces-orchestra-core/conversation.html If all you want is Spring DI and AOP for your beans, then you don't need Orchestra. However Spring core doesn't give you conversation scopes by default. Copnversation scopes are *really really* useful, however, and many projects are looking at providing conversation scopes in some way. Spring WebFlow is one example, but it seems quite complicated to me; IMO Orchestra is simpler to use with JSF. Regards, Simon Martin Dames [EMAIL PROTECTED] schrieb: Hey Matthias, hmm... I don't understand the conversation (dialog, wizard) scope exactly. Is this a pretty common scope or an orchestra own name? As the hightlights says: It utilizes the powerful Spring bean configuration mechanism instead of JSF's managed-bean facility. The release of Spring 2.0 made it possible to define custom bean scopes in Spring. If a JSF Managed bean is declared in Spring using the Orchestra conversation scope, then when that bean is referenced from a JSF EL expression it is automatically created within that conversation scope. It is not necessary for non-conversation-scoped managed beans to be declared via Spring, although we do recommend it: request and session scopes are also supported and you benefit from having one common syntax for defining the beans of your application, from the AOP features Spring provides, and from Spring's other advanced features. Orchestra can be used to don't declare managed-beans in the faces- context.xml. That is actually what I want.. I don't have some JSF beans and some spring beans in two seperate different syntax conf files. I just want to use spring DI. Then I can handle all the beans with the aop, and other spring stuff. So, the question is now... what are the benefit of the conversation scope? and what is it exactly? Thank you very much! Am 28.09.2007 um 10:07 schrieb Matthias Wessendorf: Hi Martin, Cagatay's blog is about using Spring's bean facility to *declare* Managed Beans. No need for a declaration of your managed beans inside the faces-config.xml file. Orchestra is about providing a conversion (wizard) scope, that is between request and session. See the Orchestra docs ([1]) for more -M [1] http://myfaces.apache.org/orchestra/index.html On 9/28/07, Martin Dames [EMAIL PROTECTED] wrote: Hey all, I saw yesterday the following solution for using spring app context for managing beans in jsf: http://cagataycivici.wordpress.com/2007/09/10/using-spring-to-manage- jsf-beans/ So this is the same solution as orchestra offers, right? Where are the benefits of using an extra lib (orchestra) instead of just doing the solution above? When I am using the conversation scope, can I use the session or request scope at the same time? (Ok, this would be a spring question I think) -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: General JSF Question regarding duplicate component ID
Hi CD, Volker, in MyFaces this isn't necessary anymore - and hasn't been for over a year. If you are using Facelets, though - there is a bug in Facelets with Facets handling (so with unique ids of components in Facets), which has only been resolved after the last production release (so 1.11. doesn't have it in). regards, Martin On 9/26/07, CD [EMAIL PROTECTED] wrote: Thanks for replying Volker. I do use the JSF tags to create said components (which is why I am confused as to why this occurs). Any other thoughts? On 9/26/07, Volker Weber [EMAIL PROTECTED] wrote: Hi, you MUST assign a unique id to all components created by your application code, e.g.: all componets which are not created by the framework via jsf tags. And (according to my experience) you should not use createUniqueId() of UIViewRoot. Regards, Volker 2007/9/25, CD [EMAIL PROTECTED]: Hi All, I seem to get a occasional incident in my application where I receive a 500 error stating that a duplicate component id was found in the view. Would anyone like to share a common pattern that is utilized to ensure that this does not occur? Any other tips would be helpful as well. Thanks! CD -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: error page not working in MF 1.2?
Hi Piotr, can you please open an issue, and attach a small sample app? regards, Martin On 9/27/07, Piotr [EMAIL PROTECTED] wrote: Hi users, I have upgraded recently MF to 1.2 version and I'm facing strange situation where in case of error with 500 code instead of my custom error page Tomcat displays its own. I have been trying to use the org.apache.myfaces.ERROR_HANDLING (true false) but it doesn't influence the behavior at all. When I switched to the JSF RI 1.2 it worked fine just like with previous version of MF. Here is my web.xml error pages part: ... context-param param-nameorg.apache.myfaces.ERROR_HANDLING/param-name param-valuetrue/param-value /context-param ... error-page error-code500/error-code location/500.html/location /error-page error-page error-code400/error-code location/index.html/location /error-page error-page error-code403/error-code location/403.html/location /error-page error-page error-code404/error-code location/404.html/location /error-page Strange thing is that e.g. 404 error page works fine, like it should. Am I missing sth? I'm using MF 1.2, Facelets 1.1.13 and Tomcat 6.0.14. Thx for all replies Piotr. -- View this message in context: http://www.nabble.com/error-page-not-working-in-MF-1.2--tf4525353.html#a12911387 Sent from the MyFaces - Users mailing list archive at Nabble.com. -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: [Trinidad] tr:iterator
May I also suggest to look at t:dataList? regards, Martin On 9/28/07, William Gosse [EMAIL PROTECTED] wrote: I've seen tr:iterator not behave well when laying out commandLinks horizontally. I've had much better luck with the Facelets ui:repeat tag for this kind of stuff. Unfortunately it doesn't have a varStatus. From: Francisco Passos [mailto:[EMAIL PROTECTED] Sent: Thursday, September 27, 2007 12:42 PM To: MyFaces Discussion Subject: [Trinidad] tr:iterator Good afternoon! I'm using tr:iterator to present various commandLinks on a page. The problem is: they are always duplicated. I've checked and the list on the bean only has 2 elements. However 4 links are generated. Here's the xhtml: tr:iterator id=tabber value=#{fichaBean.gruposAtributos} var=grupoAtributos binding=#{fichaBean.tabNavigationPane} varStatus=status tr:spacer width=15px / tr:commandLink id=tab text=#{grupoAtributos.ndenomin } partialSubmit=true selected=#{grupoAtributos.igrupoid eq fichaBean.selectedGroupId} actionListener=#{fichaBean.refreshIt} tr:setActionListener from=#{grupoAtributos.igrupoid} to=#{fichaBean.selectedGroupId} / /tr:commandLink /tr:iterator Does anyone know why this happens and what I can do to avoid it? Thank you, Francisco Passos The information transmitted herewith is sensitive information of Chordiant Software or its customers and is intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer. -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
Re: pls help with exception
Hi guys, don't want to sound pedantic, but please stay in English while discussing here on the list - except you mark the conversation clearly as off-topic and explain why you have to write in a language apart from English. regards, Martin On 9/24/07, Alonso Isidoro Roman [EMAIL PROTECTED] wrote: Buenos dias Angel, ojala puedas ayudarme /* * YellProxy.java * * Created on 13 de septiembre de 2007, 11:59 * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package es.yell.frontlite.servlets; import java.util.Collection; import java.util.Locale; import java.util.ResourceBundle; import javax.faces.context.FacesContext; import javax.faces.event.ActionEvent ; import javax.faces.event.ValueChangeEvent; import javax.faces.model.SelectItem; import org.springframework.beans.factory.InitializingBean; import es.yell.frontlite.service.impl.*; import org.springframework.util.Assert ; /** * Esta clase va a hacer las siguientes acciones: * Averiguar quien es el cliente, IE, firefox, PDA. * Averiguar si tiene el js activado. * en funcion si tiene el js activado o no, redirijo la peticion a un servicio u otro * la peticion que hace el cliente * @author operador */ public class YellProxy{ //campo que sirve para almacenar el resultado de la operacion que se hace en el cliente para ver si js esta activado. private String jsActivado; //campo que representa la identidad del navegador, IE, firefox... private String quienSoy; //campos que van a almacenar los campos que y donde de la pagina ppal. private String campoQue; //a este campo habra que destokenizar para rellenar los siguientes campos, direccion, localidad y cp private String campoDonde; //atributo que pasamos al servicio con los parametros que nos da el formulario de la jsp private BusquedaVO busquedaVO; //el servicio que nos da acceso a la capa de datos.INYECTADO private SrvBusquedaNoxtrumServiceImpl servicio; //atributo q contiene toda la informacion cuando utilizamos AJAX private String xml; //atributo q contiene toda la informacion cuando no utilizamos AJAX private Collection coleccion; /** Creates a new instance of YellProxy */ public YellProxy() { } /** *Este metodo responde al evento del boton encuentra que esta en la pagina principal. *Basicamente va a destokenizar el campo campoDonde en los subcampos Direccion, localidad y CP. *Tambien y dependiendo de si el cliente tiene activado o no el js, ejecutaremos un servicio u otro. */ public String encuentra(){ //deja los atributos privados rellenos. String mensaje ; crearYRellenarBusquedaVO(); //Javscript activado if (getJsActivado()!=null getJsActivado().compareToIgnoreCase(S) == 0){ //invocamos servicio adecuado setXml(this.getServicio().obtenerResultadosJSactivado(this.getBusquedaVO ())); mensaje=succesJS; }else{ //javascript no activado this.setColeccion(this.getServicio().obtenerResultadosJSdesactivado(this.getBusquedaVO ())); mensaje=succesNoJS; } return mensaje; } private void crearYRellenarBusquedaVO() { if (busquedaVO == null){ busquedaVO = new BusquedaVO(); } busquedaVO.setCampoQue(this.getCampoQue()); busquedaVO.setCampoDonde(this.getCampoDonde()); } public String getCampoQue() { return campoQue; } public void setCampoQue(String campoQue) { this.campoQue = campoQue; } public String getCampoDonde() { return campoDonde; } public void setCampoDonde(String campoDonde) { this.campoDonde = campoDonde; } public String getJsActivado() { return jsActivado; } public void setJsActivado(String jsActivado) { this.jsActivado = jsActivado; } public String getQuienSoy() { return quienSoy; } public void setQuienSoy(String quienSoy) { this.quienSoy = quienSoy; } public BusquedaVO getBusquedaVO() { return busquedaVO; } public void setBusquedaVO(BusquedaVO busquedaVO) { this.busquedaVO = busquedaVO; } public String getXml() { return xml; } public void setXml(String xml) { this.xml = xml; } public Collection getColeccion() { return coleccion; } public void setColeccion(Collection coleccion) { this.coleccion = coleccion; } public SrvBusquedaNoxtrumServiceImpl getServicio() { return servicio; } public void setServicio(SrvBusquedaNoxtrumServiceImpl servicio) { this.servicio = servicio; } } 2007/9/24, Angel Miralles Arevalo [EMAIL PROTECTED]: Please, send your bean