Re: [Tobago] global settings possible?
Hello Michał, You can see how to create a new tag by composing other tag here: https://svn.apache.org/repos/asf/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/LabelExtensionTag.java You will need to write a TLD-file, an may register it. (In Tobago the file is autogenerated). For writing TLD see Servlet-Spec. etc. Regards, Udo Michał 'Gandalf' Stawicki schrieb: Hello Udo, * Write your own tag. Like InExtensionTag in Tobago. Are there any examples of how it should be done, or should I look at Tobago's sources? I did some search, but couldn't find anything usefull. Thanks, michael
Re: [ Tobago ] Regarding Alignment Problems with gridLayout
Hello Madan, tc:column is only for Columns inside of tc:sheet. tc:cell is useful if there is a tc:gridLayout facet in the parent container to set spanX and/or spanY tc:panel may have its own layout-manager. A simple sample you can see here: http://tobago.atanion.net/tobago-example-demo/faces/overview/layout.jsp You may click on the view source button in the footer. Hope that helps, Udo madan chowdary schrieb: Hi Volker, Thnx for the reply... Gone through the code, hope this would help me... But can u suggest whats the best manner to write code with tc:gridLayout/ i need to display some textboxes and other components in a page. Right now i am using tc:cell/ . But what does tc:column/ does ? where can i use tc:cell/ and tc:column/ can i use a panel instead of tc:cell ? Regards, Madan - Original Message From: Volker Weber [EMAIL PROTECTED] To: MyFaces Discussion users@myfaces.apache.org Sent: Saturday, 24 February, 2007 12:06:36 AM Subject: Re: [ Tobago ] Regarding Alignment Problems with gridLayout Hi Madan, please see https://issues.apache.org/jira/browse/TOBAGO-295 hope it helps. Regards, Volker 2007/2/23, madan chowdary [EMAIL PROTECTED]: Hi All, I have a gridLayout in which i display some data in ordered manner. Based upon some conditions, i need to show data. I use rendered for condition checking, so for a tc:cell i place the rendered attribute. But when rendering the table is including this tc:cell also. The rows i specified for this cell is aslo rendered , but this doesn't show anything as the condition is false. But the space is shown. This makes all my alignment look awkward , Any Suggestions regarding this, Think many would have faced this problem. I need to fix some UI Issues which includes these things also.. Thnx in Advance Regards, Madan Here's a new way to find what you're looking for - Yahoo! Answers Here’s a new way to find what you're looking for - Yahoo! Answers http://us.rd.yahoo.com/mail/in/yanswers/*http://in.answers.yahoo.com/
Re: [Solved] ERROR: Value is not a valid option
Hi, I am having this problem too. My select one is set up as follows: h:selectOneMenu id=regionList binding=#{Bean.regionListUI} value=#{Bean.region} f:converter converterId=myapp.Region/ f:selectItem itemValue=0 itemLabel=(all)/ t:selectItems var=r itemLabel=#{r.name} itemValue=#{r.idString} value=#{applicationBean.regionMap} / f:attribute name=fieldRef value=Region List/ /h:selectOneMenu - This was working fine with 1.1.4 but since the upgrade to 1.1.5 it now falls over. - The application bean is at application scope, so the values should always be available. - The converter changes an ID to a region and vice versa. - The page loads up fine, I only have the problem when I select a command button that runs an action listener. - I use a 't:saveState value=#{Bean_track}/' for my request-scoped bean. - The region bean implements a working 'equals' method. - If I select the manually populated select item, (all), it works correctly. My converter is like this: public final static String CONVERTER_ID = myapp.Region; public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String string) throws ConverterException { return JSFUtils.getAppBackingBean().getRegionMap().get(Integer.parseInt(string)); } public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object object) throws ConverterException { if (object == null) { return null; } else if (object instanceof Region) { final Region region = (Region) object; return region.getId().toString(); } return object.toString(); } I am at a complete loss at the moment, so any thoughts on what could be causing this error would be appreciated. Thanks, Carl Ernst Fastl wrote: Hi, I have had a similar problem recently. Generally happens if the application is not able to find the selected value in the List of selectItems. This can be due to 2 possible situations: 1. The list is not available during validation - try using a t:saveState value=#{reportsBean.containerTypeList } / to ensure it is 2. The values of the selectItems (getValue() and setValue()) do not contain Strings and there is no converter: - use a corresponding converter e.g. for Long - LongConverter for the selectOneMenu hope that helps regards Ernst On 2/22/07, Srinivas V [EMAIL PROTECTED] wrote: Hi All, Please help me!! I am having an issue with SelectOneMenu. I have installed JSF 1.1.5-SNAPSHOT,Tomahawk1.1.5- SNAPSHOT and tomahawk-sandbox-1.1.5-SNAPSHOT. Previously i had myfaces1.1 jar I dint have issue with selectOneMenu before. Now when I submit the page, I am getting this jsf validation error: Container:Value is not a valid option for a selectOneMenu even if i select some option. code: h:panelGroup rendered=#{reportsBean.renderContainerType} x:outputLabel for=containerfilter value=#{msgBundle.EPCMgr_ContainerLbl}: styleClass=standard_text_bold/ f:verbatimbr//f:verbatim h:selectOneMenu id=containerfilter value=#{reportsBean.containerType} immediate=true disabled=#{ reportsBean.optionDisabled } styleClass=standard_input f:selectItem itemValue= itemLabel= / f:selectItems value=#{reportsBean.containerTypeList }/ /h:selectOneMenu /h:panelGroup Can anybody tell me why it is happening? regards srinivas -- View this message in context: http://www.nabble.com/ERROR%3A-Value-is-not-a-valid-option-tf3270984.html#a9155607 Sent from the MyFaces - Users mailing list archive at Nabble.com.
togglelink within a datatable
Hi, I am trying to do inline editing within a table. I have included a togglePanel component as a column value within a t:datatable, my problem is that the 'for' attribute seems to require the explicit id of the component to hide/display, so when my table contains more than one row, the ids get mixed up. Does anyone have a solution to this or a better way to do this ? This is my jsf snippet h:column s:togglePanel s:toggleGroup s:toggleLink for=editValue h:outputText value=click to edit/ /s:toggleLink /s:toggleGroup t:div id=editValue t:inputText value=#{test.value}/ h:commandLink value=Update actionListener=#{handler.update}/ /t:div /s:togglePanel /h:column Thanks, Paul. -- View this message in context: http://www.nabble.com/togglelink-within-a-datatable-tf3291761.html#a9155856 Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: [Tobago] tc:tab won't resize
Hallo Michał, I think I've the same scenario working, with 1.0.9 and also 1.0.10-SNAPSHOT How do you realize the resizing of the page? Udo Michał 'Gandalf' Stawicki schrieb: Hi, I have a tc:page that always sets its' size to maximum. So, if a user resizes his window, after next submit the size of tc:page will change. Now, I have a tc:tabGroup, which resizes correctly. The problem is, that tc:tab won't. When I first open a tab, it calculates the size correctly, but then this size will be permanent - in spite of resizing tc:page and tc:tabGroup, the tc:tab will have a constant size, all I get are scrollbars. Did anyone experience this? Regards, michael
Re: sandbox floatingPanel css control
Joe Ersinghaus schrieb: Hello, Does anyone know how to control the style (width or height) in the sandbox floatingPane.jsp example? I've tried adding sized elements inside the s:floatingPane control, and this will increase width (adjusted to the internal control), but the pane scroll-bar overflows. Hi the floating pane is a dojo control, it usually has its own template in the dojo file hierarchy. If you need small alterations the best bet is, to check the underlying dojo widget template and alter the used css styles to your needs. If you need a major overhaul an exchange of the template is probably mandatory. I am not sure if the template attribute already is exposed by the Widget I have this high on my todo list (a base dojo output class which exposes those attributes) but I am bound by other stuff currently so no fix for this unless someone else patches it in for at least another two weeks. anyway here is the core dojo internal template which is used you can pick the needed css classes there (from the dojo/src/widget/templates dir) div id=${this.widgetId} dojoAttachEvent=onMouseDown class=dojoFloatingPane div dojoAttachPoint=titleBar class=dojoFloatingPaneTitleBar style=display:none img dojoAttachPoint=titleBarIcon class=dojoFloatingPaneTitleBarIcon div dojoAttachPoint=closeAction dojoAttachEvent=onClick:closeWindow class=dojoFloatingPaneCloseIcon/div div dojoAttachPoint=restoreAction dojoAttachEvent=onClick:restoreWindow class=dojoFloatingPaneRestoreIcon/div div dojoAttachPoint=maximizeAction dojoAttachEvent=onClick:maximizeWindow class=dojoFloatingPaneMaximizeIcon/div div dojoAttachPoint=minimizeAction dojoAttachEvent=onClick:minimizeWindow class=dojoFloatingPaneMinimizeIcon/div div dojoAttachPoint=titleBarText class=dojoFloatingPaneTitleText${this.title}/div /div div id=${this.widgetId}_container dojoAttachPoint=containerNode class=dojoFloatingPaneClient/div div dojoAttachPoint=resizeBar class=dojoFloatingPaneResizebar style=display:none/div /div the original css is following: /** Outer Window ***/ .dojoFloatingPane { /* essential css */ position: absolute; overflow: visible; /* so drop shadow is displayed */ z-index: 10; /* styling css */ border: 1px solid; border-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight; background-color: ThreeDFace; } /** Title Bar / .dojoFloatingPaneTitleBar { vertical-align: top; margin: 2px 2px 2px 2px; z-index: 10; background-color: #7596c6; cursor: default; overflow: hidden; border-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight; vertical-align: middle; } .dojoFloatingPaneTitleText { float: left; padding: 2px 4px 2px 2px; white-space: nowrap; color: CaptionText; font: small-caption; } .dojoTitleBarIcon { float: left; height: 22px; width: 22px; vertical-align: middle; margin-right: 5px; margin-left: 5px; } .dojoFloatingPaneActions{ float: right; position: absolute; right: 2px; top: 2px; vertical-align: middle; } .dojoFloatingPaneActionItem { vertical-align: middle; margin-right: 1px; height: 22px; width: 22px; } .dojoFloatingPaneTitleBarIcon { /* essential css */ float: left; /* styling css */ margin-left: 2px; margin-right: 4px; height: 22px; } /* minimize/maximize icons are specified by CSS only */ .dojoFloatingPaneMinimizeIcon, .dojoFloatingPaneMaximizeIcon, .dojoFloatingPaneRestoreIcon, .dojoFloatingPaneCloseIcon { vertical-align: middle; height: 22px; width: 22px; float: right; } .dojoFloatingPaneMinimizeIcon { background-image: url(images/floatingPaneMinimize.gif); } .dojoFloatingPaneMaximizeIcon { background-image: url(images/floatingPaneMaximize.gif); } .dojoFloatingPaneRestoreIcon { background-image: url(images/floatingPaneRestore.gif); } .dojoFloatingPaneCloseIcon { background-image: url(images/floatingPaneClose.gif); } /* bar at bottom of window that holds resize handle */ .dojoFloatingPaneResizebar { z-index: 10; height: 13px; background-color: ThreeDFace; } /* Client Area ***/ .dojoFloatingPaneClient { position: relative; z-index: 10; border: 1px solid; border-color: ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow; margin: 2px; background-color: ThreeDFace; padding: 8px; font-family:
Re: sandbox floatingPanel css control
Joe Ersinghaus schrieb: Hello, Does anyone know how to control the style (width or height) in the sandbox floatingPane.jsp example? I've tried adding sized elements inside the s:floatingPane control, and this will increase width (adjusted to the internal control), but the pane scroll-bar overflows. Thanks, Joe ok programmatically you have to apply javascript for now use the resizeTo function of the javascript object generated by the initialization process. This one should work at the first sight. Which means we need a width and height attribute in the jsf code in the long run :-) alternativele you can use dojo.widgetById(widgetId set by the code).resizeTo(with,height); Sorry for not having an easier way, but the component is alpha ;-)
RE: PPRPanelGroup
Hello, That is what I have done so far. I have tried both 1.1.4 and 1.1.5 in a new web application that only contains the original JSP file and the corresponding Backing Bean. And these are the results: PPRSumit button - Request/Page Refresh ConfiguredSubmit Button - Request/Page Refresh Update first group partially checkbox - Request/Page Refresh testAction Button - Request/Page Refresh Partial testAction button - Request/Page Refresh Partially submit by change combobox - OK, Ajax Partially submit by change checkbox - OK, Ajax Command link - OK, Ajax Second PPRPanelGroup Button - Request/Page Refresh Any explanation for that? Frank -Original Message- From: Gerald Müllan [mailto:[EMAIL PROTECTED] Sent: Donnerstag, 22. Februar 2007 17:26 To: MyFaces Discussion Subject: Re: PPRPanelGroup Hi, you have to register every component which should fire a ppr-request. This can be done in an exactly manner via the partialTriggers attribute: E.g. id of a commandButton is nextWizardStep; Consequently if going to the next wizard step should occur via a ppr-request (the whole wizard page is embedded in the s:pprPanelGroup) partialTriggers has to be set to nextWizardStep. The other possibility is to use the partialTriggerPattern attribute: E.g. if you want to use nextWizardStep and previousWizardStep buttons, just write *WizardStep as the partialTriggerPattern attribute. Every component which is registered via one of the above attributes should fire a ppr-request, because of the interception point before the regular form post. If it does not, there maybe a bug or another problem. E.g. you cannot use aliasBeans in combination with ppr because of the scoping. But please post the corresponding code, maybe we can then say something more on that. Regarding the sandbox examples: You are right, the secondFormButton does one time a ppr-request and the other time a regular submit. It seems to steem from the fact that the value of the button is changing after activating a command component from the first form. But don`t waste time on this, your problem should be another one.. cheers, Gerald On 2/22/07, Oellien, F (Frank) [EMAIL PROTECTED] wrote: I have a question regarding the PPRPanelGroup. When I use the Sandbox-example.war file I can use the PPRPanelGroup example as expected. However when I implement the corresponding jsp file and the backing bean in my own application every action like pressing a commandlink or a commandbutton will be followed by a request and a complete side refresh. What I have to keep in mind when working with the Ajax functionilities? By reading the source code it is also unclear for me why PPRSubmit button will not led to a whole page refresh and the button in the secondform does. Regards Frank -- This message, including attachments, is confidential and may be privileged. If you are not an intended recipient, please notify the sender then delete and destroy the original message and all copies. You should not copy, forward and/or disclose this message, in whole or in part, without permission of the sender. -- -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- This message, including attachments, is confidential and may be privileged. If you are not an intended recipient, please notify the sender then delete and destroy the original message and all copies. You should not copy, forward and/or disclose this message, in whole or in part, without permission of the sender. --
Re: togglelink within a datatable
Paul Ryan schrieb: Hi, I am trying to do inline editing within a table. I have included a togglePanel component as a column value within a t:datatable, my problem is that the 'for' attribute seems to require the explicit id of the component to hide/display, so when my table contains more than one row, the ids get mixed up. Does anyone have a solution to this or a better way to do this ? This is my jsf snippet h:column s:togglePanel s:toggleGroup s:toggleLink for=editValue h:outputText value=click to edit/ /s:toggleLink /s:toggleGroup t:div id=editValue t:inputText value=#{test.value}/ h:commandLink value=Update actionListener=#{handler.update}/ /t:div /s:togglePanel /h:column There is a less dynamic toggle mechanism already embedded in tomahawk check the master detail example which does exactly that, toggeling of detail stuff in a data table.
Re: Sub columns in datatable
[EMAIL PROTECTED] schrieb: Hi all, How to include sub columns in datatable. It has three columns Ssn,Names,profession. As illustrated in the fig below for Names (first names,middle names,last names). How to get the sub columns in the datatable. Try to nest a datalist into the colum of your table this should be possible.
Re: some functioanlity questions
Colin Chalmers schrieb: 1. The browser Back-button when the user clicks on the browser back-button he should be taken back a page without loss of data . I've seen comments about client/side state saving in connection with cache expiry settings I've also seen solutions based on seam shale. Can someone comment on this as to what works for them? Myfaces has an integrated state history you can enable/disable I do not have the exact infos on it, but it has been working well for almost a year now. The back button is indeed not a problem anymore not even in server side state saving, in client side one the state is pushed into the html code anyway. 2. Bookmarking pages I've seen workarounds with servlet-filters. Does MyFaces have a solution or should I be looking at Jsf_sping? Bookmarking is not possible in post situations, restfulness can be achieved via outputlink and dedicated params. Commandlink enforces a form post which is not restful. Http get is ommitted from jsf. (but can be simulated via outputlink) There might be other solutions but that is what you get out of the box. (Some systems can provide dedicated nav handlers which push you to a generic entry page if you bookmark inside of a form) 3. Google findable Is anyone able to tweak faces to allow Google to crawl and index? see above, to my knowledge you have to plan ahead and make the crawlabel data restful which means you need a page hierarchy being able to be crawlable. Which means, make commandlinks for the pages you need to be crawled. 4. Initializing data-sources We had an ugly workaround to init/destroy data in backing-beans. I see that Shale has methods for this (aptly called init/destroy) How do others do this with *basic* myfaces to ensure that data is retrieved once during the life-cycle? For now Shale is probably the best option you can get currently, besides seam. If you are in an orm context, there will be another option soon, the new myfaces fusion project addresses this issue very similar to Seam (Currently it is in development, but something usable will be there soon) Which means you work in conversation contexts and you have an open connection/entity manager per conversation, the objects are kept in ram as long as the conversation is open, and you can synchronize them back to the db via flush() once the conversation is done, everything is dropped. Seam does it that way, fusion also, but fusion is not quite there yet to be easily usable (will be soon however) The restfulness of those systems and the bookmarking ability is another issue. If you bookmark a conversation system, under best circumstances it should push you to a dedicated page outside or at the begin of the conversation, which lets you start anew.
Re: [Tobago] tc:tab won't resize
I have a layout tag (def-layout.tag): %@ tag pageEncoding=UTF-8 % %@ taglib uri=http://myfaces.apache.org/tobago/component; prefix=tc % %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % f:view locale=#{pageDisplayBean.locale} tc:page label=Chemigrafia id=overview state=#{layout} width=#{layout.width} height=#{layout.height} f:facet name=layout tc:gridLayout border=0 rows=fixed;*;fixed / /f:facet tc:panel f:facet name=layout tc:gridLayout columns=*;60px/ /f:facet tc:label value=#{pageDisplayBean.headerText}/ tc:link action=#{logoutManagedBean.logout} image=pages/images/wyloguj.gif rendered=#{clientLoginManagedBean.userLogged} immediate=true/ /tc:panel tc:cell jsp:doBody / /tc:cell tc:label value=#{pageDisplayBean.footerText}/ /tc:page /f:view I got the Layout class from some example, I can't remember now which one (but it works ok, the page is resized correctly). And then on the proper page I have this code: [EMAIL PROTECTED] contentType=text/html; charset=UTF-8 % %@ taglib prefix=f uri=http://java.sun.com/jsf/core% %@ taglib prefix=h uri=http://java.sun.com/jsf/html% %@ taglib prefix=tc uri=http://myfaces.apache.org/tobago/component% %@ taglib prefix=tx uri=http://myfaces.apache.org/tobago/extension% %@ taglib tagdir=/WEB-INF/tags/layout prefix=layout% layout:def-layout jsp:body tc:box id=panoramix label=Chemigrafia Operatora tc:tabGroup switchType=reloadPage immediate=true tc:tab label=Przyjęte zamówienia /tc:tab ... some more tabs /tc:tabGroup /tc:box /tc:panel /jsp:body /layout:def-layout When I first open the tab, it is sized correctly - but if I resize the browser window, switch tabs / submit something - than the page and tabGroup get's resized, but the tab itself preserves it's original size. In Mozilla the tabGroup gets scrollbars if the tab is too large, but in IE7 there are no scrolls. regards, michal On 26/02/07, Udo Schnurpfeil [EMAIL PROTECTED] wrote: Hallo Michał, I think I've the same scenario working, with 1.0.9 and also 1.0.10-SNAPSHOT How do you realize the resizing of the page? Udo Michał 'Gandalf' Stawicki schrieb: Hi, I have a tc:page that always sets its' size to maximum. So, if a user resizes his window, after next submit the size of tc:page will change. Now, I have a tc:tabGroup, which resizes correctly. The problem is, that tc:tab won't. When I first open a tab, it calculates the size correctly, but then this size will be permanent - in spite of resizing tc:page and tc:tabGroup, the tc:tab will have a constant size, all I get are scrollbars. Did anyone experience this? Regards, michael -- [EMAIL PROTECTED] http://stawicki.jasliska.pl GG: 369 JID: [EMAIL PROTECTED]
Re: Sub columns in datatable
You can do it by using datatable inside a datatable. So basically inside second column there will be datatable and you have to change value to the datatable accordingly. [EMAIL PROTECTED] wrote: Hi all, How to include sub columns in datatable. It has three columns Ssn,Names,profession. As illustrated in the fig below for Names (first names,middle names,last names). How to get the sub columns in the datatable. Best Regards, Pallavi The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com
Re: [Tobago] nesting tc:sheet
Hi, no answers to this one... Is there any way in Tobago to do double-iteration (so I iterate over some List, and than I iterate over some elements than I get from the first list)? I can't use forEach as I need to use tc:selectOneChoice and f:selectItems and these won't work with forEach regards, michael On 14/02/07, Michał 'Gandalf' Stawicki [EMAIL PROTECTED] wrote: Hi, did anyone tried nesting tc:sheet inside another tc:sheet's column? I don't get any errors, but the inner tc:sheet just isn't rendered regards, michael -- [EMAIL PROTECTED] http://stawicki.jasliska.pl GG: 369 JID: [EMAIL PROTECTED] -- [EMAIL PROTECTED] http://stawicki.jasliska.pl GG: 369 JID: [EMAIL PROTECTED]
debugging bean generated componenets
Hi, I am creating a bean generated page using components and would like to see the jsf tags during the rendering in order to debug the code. I used to have a package that I would set to DEBUG in log4j but I cannot find the example I used. Any suggestions? In general, any good debug methods in JSF, what about Junit? Regards, Yaron
Sandbox inputSuggest
Hi, when I use inputSuggest from nightly build of sandbox there are attributes styleClass and style missing. In an older build it was present. Maybe something wrong with the TLD ? Regards, Oliver
Re: [Tobago] nesting tc:sheet
tc:selectItems may resolve your problem, it is similar to f:selectItems but allows $-Expressions, as far as I know. So you can use forEach. Do you really need nested loops? Is the inner a loop over the items? Then you can use ?:selectItems instead of ?:selectItem. Regards Udo Michał 'Gandalf' Stawicki schrieb: Hi, no answers to this one... Is there any way in Tobago to do double-iteration (so I iterate over some List, and than I iterate over some elements than I get from the first list)? I can't use forEach as I need to use tc:selectOneChoice and f:selectItems and these won't work with forEach regards, michael On 14/02/07, Michał 'Gandalf' Stawicki [EMAIL PROTECTED] wrote: Hi, did anyone tried nesting tc:sheet inside another tc:sheet's column? I don't get any errors, but the inner tc:sheet just isn't rendered regards, michael -- [EMAIL PROTECTED] http://stawicki.jasliska.pl GG: 369 JID: [EMAIL PROTECTED]
RE: PPRPanelGroup - Additional Info
I have just figured out, that the PPRPanelGroup shows only this strange behavior, if used with Sun Standard implementation. When I use myfaces instead the resukts are different: Now I receive an alert window with the message: 'an error occurred during the ajax-request XMLHttpTransport Error: 500 Internal Server Error Frank -Original Message- From: Oellien, F (Frank) [mailto:[EMAIL PROTECTED] Sent: Montag, 26. Februar 2007 13:27 To: MyFaces Discussion Subject: RE: PPRPanelGroup Hello, That is what I have done so far. I have tried both 1.1.4 and 1.1.5 in a new web application that only contains the original JSP file and the corresponding Backing Bean. And these are the results: PPRSumit button - Request/Page Refresh ConfiguredSubmit Button - Request/Page Refresh Update first group partially checkbox - Request/Page Refresh testAction Button - Request/Page Refresh Partial testAction button - Request/Page Refresh Partially submit by change combobox - OK, Ajax Partially submit by change checkbox - OK, Ajax Command link - OK, Ajax Second PPRPanelGroup Button - Request/Page Refresh Any explanation for that? Frank -Original Message- From: Gerald Müllan [mailto:[EMAIL PROTECTED] Sent: Donnerstag, 22. Februar 2007 17:26 To: MyFaces Discussion Subject: Re: PPRPanelGroup Hi, you have to register every component which should fire a ppr-request. This can be done in an exactly manner via the partialTriggers attribute: E.g. id of a commandButton is nextWizardStep; Consequently if going to the next wizard step should occur via a ppr-request (the whole wizard page is embedded in the s:pprPanelGroup) partialTriggers has to be set to nextWizardStep. The other possibility is to use the partialTriggerPattern attribute: E.g. if you want to use nextWizardStep and previousWizardStep buttons, just write *WizardStep as the partialTriggerPattern attribute. Every component which is registered via one of the above attributes should fire a ppr-request, because of the interception point before the regular form post. If it does not, there maybe a bug or another problem. E.g. you cannot use aliasBeans in combination with ppr because of the scoping. But please post the corresponding code, maybe we can then say something more on that. Regarding the sandbox examples: You are right, the secondFormButton does one time a ppr-request and the other time a regular submit. It seems to steem from the fact that the value of the button is changing after activating a command component from the first form. But don`t waste time on this, your problem should be another one.. cheers, Gerald On 2/22/07, Oellien, F (Frank) [EMAIL PROTECTED] wrote: I have a question regarding the PPRPanelGroup. When I use the Sandbox-example.war file I can use the PPRPanelGroup example as expected. However when I implement the corresponding jsp file and the backing bean in my own application every action like pressing a commandlink or a commandbutton will be followed by a request and a complete side refresh. What I have to keep in mind when working with the Ajax functionilities? By reading the source code it is also unclear for me why PPRSubmit button will not led to a whole page refresh and the button in the secondform does. Regards Frank -- This message, including attachments, is confidential and may be privileged. If you are not an intended recipient, please notify the sender then delete and destroy the original message and all copies. You should not copy, forward and/or disclose this message, in whole or in part, without permission of the sender. -- -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- This message, including attachments, is confidential and may be privileged. If you are not an intended recipient, please notify the sender then delete and destroy the original message and all copies. You should not copy, forward and/or disclose this message, in whole or in part, without permission of the sender. -- -- This message, including attachments, is confidential and may be privileged. If you are not an intended recipient, please notify the sender then delete and destroy the original message and all copies. You should not copy, forward and/or disclose this message, in whole or in part, without permission of the sender. --
Re: [Solved] ERROR: Value is not a valid option
I'm having the same problem. I had some code that was working for a long time with 1.1.5-SNAPSHOT, and now I'm getting that error. h:selectOneMenu value=#{shared$FavoriteDocumentAdd.documentTypeId} onchange=toggleInputRow() id=documentTypeSelect style=background-color:rgb(204,204,255) f:selectItem itemLabel=Website URL itemValue=3/ f:selectItem itemLabel=File Upload itemValue=1/ f:selectItem itemLabel=Description Only itemValue=2/ /h:selectOneMenu The value being set is a short. Essentially it looks like the code was doing an automatic conversion before, but now chokes. I just reverted the code to 1.1.5-SNAPSHOT, and it works again. I'm going to try to take a quick look at the differences between UISelectOne.javabetween those two versions, but in practice I've found with any large code base, it'll take a little time to really understand the layout. On 2/26/07, CarlHowarth [EMAIL PROTECTED] wrote: Hi, I am having this problem too. My select one is set up as follows: h:selectOneMenu id=regionList binding=#{Bean.regionListUI} value=#{Bean.region} f:converter converterId=myapp.Region/ f:selectItem itemValue=0 itemLabel=(all)/ t:selectItems var=r itemLabel=#{r.name} itemValue=#{r.idString} value=#{applicationBean.regionMap} / f:attribute name=fieldRef value=Region List/ /h:selectOneMenu - This was working fine with 1.1.4 but since the upgrade to 1.1.5 it now falls over. - The application bean is at application scope, so the values should always be available. - The converter changes an ID to a region and vice versa. - The page loads up fine, I only have the problem when I select a command button that runs an action listener. - I use a 't:saveState value=#{Bean_track}/' for my request-scoped bean. - The region bean implements a working 'equals' method. - If I select the manually populated select item, (all), it works correctly. My converter is like this: public final static String CONVERTER_ID = myapp.Region; public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String string) throws ConverterException { return JSFUtils.getAppBackingBean().getRegionMap().get(Integer.parseInt(string)); } public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object object) throws ConverterException { if (object == null) { return null; } else if (object instanceof Region) { final Region region = (Region) object; return region.getId().toString(); } return object.toString(); } I am at a complete loss at the moment, so any thoughts on what could be causing this error would be appreciated. Thanks, Carl Ernst Fastl wrote: Hi, I have had a similar problem recently. Generally happens if the application is not able to find the selected value in the List of selectItems. This can be due to 2 possible situations: 1. The list is not available during validation - try using a t:saveState value=#{reportsBean.containerTypeList } / to ensure it is 2. The values of the selectItems (getValue() and setValue()) do not contain Strings and there is no converter: - use a corresponding converter e.g. for Long - LongConverter for the selectOneMenu hope that helps regards Ernst On 2/22/07, Srinivas V [EMAIL PROTECTED] wrote: Hi All, Please help me!! I am having an issue with SelectOneMenu. I have installed JSF 1.1.5-SNAPSHOT,Tomahawk1.1.5- SNAPSHOT and tomahawk-sandbox-1.1.5-SNAPSHOT. Previously i had myfaces1.1 jar I dint have issue with selectOneMenu before. Now when I submit the page, I am getting this jsf validation error: Container:Value is not a valid option for a selectOneMenu even if i select some option. code: h:panelGroup rendered=#{reportsBean.renderContainerType} x:outputLabel for=containerfilter value=#{msgBundle.EPCMgr_ContainerLbl}: styleClass=standard_text_bold/ f:verbatimbr//f:verbatim h:selectOneMenu id=containerfilter value=#{reportsBean.containerType} immediate=true disabled=#{ reportsBean.optionDisabled } styleClass=standard_input f:selectItem itemValue= itemLabel= / f:selectItems value=#{reportsBean.containerTypeList }/ /h:selectOneMenu /h:panelGroup Can anybody tell me why it is happening? regards srinivas -- View this message in context: http://www.nabble.com/ERROR%3A-Value-is-not-a-valid-option-tf3270984.html#a9155607 Sent from the MyFaces - Users mailing list archive at Nabble.com.
RE: Re: [Tobago] nesting tc:sheet
There's no tc:selectItems in the Tobago tag doc. Is this a new tag? Regards Helmut tc:selectItems may resolve your problem, it is similar to f:selectItems but allows $-Expressions, as far as I know. So you can use forEach. Do you really need nested loops? Is the inner a loop over the items? Then you can use ?:selectItems instead of ?:selectItem. Regards Udo Michał 'Gandalf' Stawicki schrieb: Hi, no answers to this one... Is there any way in Tobago to do double-iteration (so I iterate over some List, and than I iterate over some elements than I get from the first list)? I can't use forEach as I need to use tc:selectOneChoice and f:selectItems and these won't work with forEach regards, michael On 14/02/07, Michał 'Gandalf' Stawicki [EMAIL PROTECTED] wrote: Hi, did anyone tried nesting tc:sheet inside another tc:sheet's column? I don't get any errors, but the inner tc:sheet just isn't rendered regards, michael -- [EMAIL PROTECTED] http://stawicki.jasliska.pl GG: 369 JID: [EMAIL PROTECTED]
Re: Re: [Tobago] nesting tc:sheet
nope, your right - I can't find it in 'Latest SVN TLD documentation' there is tc:selectItem, so I think you could make another iteration and create many tc:selectItem 's :) life isn't easy regards, michael On 26/02/07, H. Swaczinna [EMAIL PROTECTED] wrote: There's no tc:selectItems in the Tobago tag doc. Is this a new tag? Regards Helmut tc:selectItems may resolve your problem, it is similar to f:selectItems but allows $-Expressions, as far as I know. So you can use forEach. Do you really need nested loops? Is the inner a loop over the items? Then you can use ?:selectItems instead of ?:selectItem. Regards Udo Michał 'Gandalf' Stawicki schrieb: Hi, no answers to this one... Is there any way in Tobago to do double-iteration (so I iterate over some List, and than I iterate over some elements than I get from the first list)? I can't use forEach as I need to use tc:selectOneChoice and f:selectItems and these won't work with forEach regards, michael On 14/02/07, Michał 'Gandalf' Stawicki [EMAIL PROTECTED] wrote: Hi, did anyone tried nesting tc:sheet inside another tc:sheet's column? I don't get any errors, but the inner tc:sheet just isn't rendered regards, michael -- [EMAIL PROTECTED] http://stawicki.jasliska.pl GG: 369 JID: [EMAIL PROTECTED] -- [EMAIL PROTECTED] http://stawicki.jasliska.pl GG: 369 JID: [EMAIL PROTECTED]
Re: [Solved] ERROR: Value is not a valid option
Does it work when you use itemValue=#{3} as workaround? I also had the same problem with itemValue=true, what I think is http://issues.apache.org/jira/browse/TOMAHAWK-152 ... Cheers, Martin On Mon, 2007-02-26 at 11:23 -0500, Kevin Galligan wrote: I'm having the same problem. I had some code that was working for a long time with 1.1.5-SNAPSHOT, and now I'm getting that error. h:selectOneMenu value=#{shared$FavoriteDocumentAdd.documentTypeId} onchange=toggleInputRow() id=documentTypeSelect style=background-color:rgb(204,204,255) f:selectItem itemLabel=Website URL itemValue=3/ f:selectItem itemLabel=File Upload itemValue=1/ f:selectItem itemLabel=Description Only itemValue=2/ /h:selectOneMenu The value being set is a short. Essentially it looks like the code was doing an automatic conversion before, but now chokes. I just reverted the code to 1.1.5-SNAPSHOT, and it works again. I'm going to try to take a quick look at the differences between UISelectOne.java between those two versions, but in practice I've found with any large code base, it'll take a little time to really understand the layout. On 2/26/07, CarlHowarth [EMAIL PROTECTED] wrote: Hi, I am having this problem too. My select one is set up as follows: h:selectOneMenu id=regionList binding=#{Bean.regionListUI} value=#{Bean.region} f:converter converterId= myapp.Region/ f:selectItem itemValue=0 itemLabel=(all)/ t:selectItems var=r itemLabel=#{r.name} itemValue=#{ r.idString} value=#{applicationBean.regionMap} / f:attribute name=fieldRef value=Region List/ /h:selectOneMenu - This was working fine with 1.1.4 but since the upgrade to 1.1.5 it now falls over. - The application bean is at application scope, so the values should always be available. - The converter changes an ID to a region and vice versa. - The page loads up fine, I only have the problem when I select a command button that runs an action listener. - I use a 't:saveState value=#{Bean_track}/' for my request-scoped bean. - The region bean implements a working 'equals' method. - If I select the manually populated select item, (all), it works correctly. My converter is like this: public final static String CONVERTER_ID = myapp.Region; public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String string) throws ConverterException { return JSFUtils.getAppBackingBean().getRegionMap().get(Integer.parseInt(string)); } public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object object) throws ConverterException { if (object == null) { return null; } else if (object instanceof Region) { final Region region = (Region) object; return region.getId().toString(); } return object.toString(); } I am at a complete loss at the moment, so any thoughts on what could be causing this error would be appreciated. Thanks, Carl Ernst Fastl wrote: Hi, I have had a similar problem recently. Generally happens if the application is not able to find the selected value in the List of selectItems. This can be due to 2 possible situations: 1. The list is not available during validation - try using a t:saveState value=#{reportsBean.containerTypeList } / to ensure it is 2. The values of the selectItems (getValue() and setValue()) do not contain Strings and there is no converter: - use a corresponding converter e.g. for Long - LongConverter for the selectOneMenu hope that helps regards Ernst On 2/22/07, Srinivas V [EMAIL PROTECTED] wrote: Hi All, Please help me!! I am having an issue with SelectOneMenu. I have installed JSF 1.1.5-SNAPSHOT,Tomahawk1.1.5- SNAPSHOT and tomahawk-sandbox-1.1.5-SNAPSHOT. Previously i had myfaces1.1 jar I dint have issue with selectOneMenu before. Now when I submit the page, I am getting this jsf validation error:
Re: [Solved] ERROR: Value is not a valid option
More info. I took a look at the code. Revision 449566, repo path... https://svn.apache.org/repos/asf/myfaces/core/trunk/api/src/main/java/javax/faces/component/UISelectOne.java The original code does the following: _ValueConverter converter = new _ValueConverter() { public Object getConvertedValue(FacesContext context, String value) { return UISelectOne.this.getConvertedValue(context, value); } }; // selected value must match to one of the available options if (!_SelectItemsUtil.matchValue(context, value, new _SelectItemsIterator(this), converter)) In summary, inside 'matchValue', this attempts to convert the value based on the bound value type in the backing bean. So, in my case, it recognizes a Short, and attempts to convert the string to a short. r449566 looks like the following... // selected value must match to one of the available options if (!_SelectItemsUtil.matchValue(value, new _SelectItemsIterator(this))) The converter isn't being used anymore. Now, this revision was checked in on 9/25/06. That looks a little old to be showing up in 1.1.5-SNAPSHOT. The file I have locally is 11/25/06. I decompiled it and it does have the old version. I think on 11/25 I did a local build of 1.1.5-SNAPSHOT and that may be insulating me from the change. Not sure. Anyway, the select menu is going to be more strict in this version. Is that correct, or should it attempt the conversion? I tried putting in a number converter, but it choked as well. The message was very long, but it looked like it was putting out a Long, and failing with the attempted to setting of the Short. I could write my own converter, but the old way was a lot easier. Just want to make sure that's my only option before I start hacking away. Thanks, -Kevin On 2/26/07, Kevin Galligan [EMAIL PROTECTED] wrote: I'm having the same problem. I had some code that was working for a long time with 1.1.5-SNAPSHOT, and now I'm getting that error. h:selectOneMenu value=#{shared$FavoriteDocumentAdd.documentTypeId} onchange=toggleInputRow() id=documentTypeSelect style=background-color:rgb(204,204,255) f:selectItem itemLabel=Website URL itemValue=3/ f:selectItem itemLabel=File Upload itemValue=1/ f:selectItem itemLabel=Description Only itemValue=2/ /h:selectOneMenu The value being set is a short. Essentially it looks like the code was doing an automatic conversion before, but now chokes. I just reverted the code to 1.1.5-SNAPSHOT, and it works again. I'm going to try to take a quick look at the differences between UISelectOne.javabetween those two versions, but in practice I've found with any large code base, it'll take a little time to really understand the layout. On 2/26/07, CarlHowarth [EMAIL PROTECTED] wrote: Hi, I am having this problem too. My select one is set up as follows: h:selectOneMenu id=regionList binding=#{Bean.regionListUI} value=#{Bean.region} f:converter converterId= myapp.Region/ f:selectItem itemValue=0 itemLabel=(all)/ t:selectItems var=r itemLabel=#{r.name} itemValue=#{ r.idString } value=#{applicationBean.regionMap} / f:attribute name=fieldRef value=Region List/ /h:selectOneMenu - This was working fine with 1.1.4 but since the upgrade to 1.1.5 it now falls over. - The application bean is at application scope, so the values should always be available. - The converter changes an ID to a region and vice versa. - The page loads up fine, I only have the problem when I select a command button that runs an action listener. - I use a 't:saveState value=#{Bean_track}/' for my request-scoped bean. - The region bean implements a working 'equals' method. - If I select the manually populated select item, (all), it works correctly. My converter is like this: public final static String CONVERTER_ID = myapp.Region; public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String string) throws ConverterException { return JSFUtils.getAppBackingBean().getRegionMap().get(Integer.parseInt (string)); } public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object object) throws ConverterException { if (object == null) { return null; } else if (object instanceof Region) { final Region region = (Region) object; return region.getId().toString(); } return object.toString(); } I am at a complete loss at the moment, so any thoughts on what could be causing this error would be appreciated. Thanks, Carl Ernst Fastl wrote: Hi, I have had a similar problem recently. Generally happens if the application is not able to find the selected value in the List of selectItems. This can be due to 2 possible situations: 1. The list is not available during validation - try using a t:saveState
Re: [Solved] ERROR: Value is not a valid option
I did try that and didn't have any luck. I think that was due to the fact that I was using shorts rather than ints, but I'd have to try it again now that I have a better understanding of everything involved. I looked at TOMAHAWK-152 briefly. I'll have to sit down and take a better look at it. It looks to be in the realm. The string value of 'true' not matching with a boolean type value? I guess the bottom line is I'd like to find out if I should be using an explicit converter to go from String to Short, or if the JSF api being used should be able to handle a simple[r] conversion like that. It was doing that conversion originally. Does the JSF spec cover this? Anybody happen to know what the reference implementation does? I'd love to try it out, but we're trying to push this out the door, so for the near future I have to focus on what's right in front of me. On 2/26/07, Martin Grotzke [EMAIL PROTECTED] wrote: Does it work when you use itemValue=#{3} as workaround? I also had the same problem with itemValue=true, what I think is http://issues.apache.org/jira/browse/TOMAHAWK-152 ... Cheers, Martin On Mon, 2007-02-26 at 11:23 -0500, Kevin Galligan wrote: I'm having the same problem. I had some code that was working for a long time with 1.1.5-SNAPSHOT, and now I'm getting that error. h:selectOneMenu value=#{shared$FavoriteDocumentAdd.documentTypeId} onchange=toggleInputRow() id=documentTypeSelect style=background-color:rgb(204,204,255) f:selectItem itemLabel=Website URL itemValue=3/ f:selectItem itemLabel=File Upload itemValue=1/ f:selectItem itemLabel=Description Only itemValue=2/ /h:selectOneMenu The value being set is a short. Essentially it looks like the code was doing an automatic conversion before, but now chokes. I just reverted the code to 1.1.5-SNAPSHOT, and it works again. I'm going to try to take a quick look at the differences between UISelectOne.java between those two versions, but in practice I've found with any large code base, it'll take a little time to really understand the layout. On 2/26/07, CarlHowarth [EMAIL PROTECTED] wrote: Hi, I am having this problem too. My select one is set up as follows: h:selectOneMenu id=regionList binding=#{Bean.regionListUI} value=#{Bean.region} f:converter converterId= myapp.Region/ f:selectItem itemValue=0 itemLabel=(all)/ t:selectItems var=r itemLabel=#{r.name} itemValue=#{ r.idString} value=#{applicationBean.regionMap} / f:attribute name=fieldRef value=Region List/ /h:selectOneMenu - This was working fine with 1.1.4 but since the upgrade to 1.1.5 it now falls over. - The application bean is at application scope, so the values should always be available. - The converter changes an ID to a region and vice versa. - The page loads up fine, I only have the problem when I select a command button that runs an action listener. - I use a 't:saveState value=#{Bean_track}/' for my request-scoped bean. - The region bean implements a working 'equals' method. - If I select the manually populated select item, (all), it works correctly. My converter is like this: public final static String CONVERTER_ID = myapp.Region; public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String string) throws ConverterException { return JSFUtils.getAppBackingBean().getRegionMap().get(Integer.parseInt (string)); } public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object object) throws ConverterException { if (object == null) { return null; } else if (object instanceof Region) { final Region region = (Region) object; return region.getId().toString(); } return object.toString(); } I am at a complete loss at the moment, so any thoughts on what could be causing this error would be appreciated. Thanks, Carl Ernst Fastl wrote: Hi, I have had a similar problem recently. Generally happens if the application is not able to find the selected value in the List of selectItems. This can be due to 2 possible situations: 1. The list is not available during validation - try using a t:saveState value=#{reportsBean.containerTypeList } / to ensure it is 2. The values of the selectItems (getValue() and setValue()) do not
Re: [Solved] ERROR: Value is not a valid option
The log message was this: URL: http://svn.apache.org/viewvc?view=revrev=449566 Log: fix for MYFACES-1328 : UISelectOne and UISelectMany fail with custom converter that returns java.lang.String from getAsObject() method. Thanks to Nikolay Petrov for tracking this down. http://issues.apache.org/jira/browse/MYFACES-1328 On 2/26/07, Kevin Galligan [EMAIL PROTECTED] wrote: More info. I took a look at the code. Revision 449566, repo path... https://svn.apache.org/repos/asf/myfaces/core/trunk/api/src/main/java/javax/faces/component/UISelectOne.java The original code does the following: _ValueConverter converter = new _ValueConverter() { public Object getConvertedValue(FacesContext context, String value) { return UISelectOne.this.getConvertedValue(context, value); } }; // selected value must match to one of the available options if (!_SelectItemsUtil.matchValue(context, value, new _SelectItemsIterator(this), converter)) In summary, inside 'matchValue', this attempts to convert the value based on the bound value type in the backing bean. So, in my case, it recognizes a Short, and attempts to convert the string to a short. r449566 looks like the following... // selected value must match to one of the available options if (!_SelectItemsUtil.matchValue(value, new _SelectItemsIterator(this))) The converter isn't being used anymore. Now, this revision was checked in on 9/25/06. That looks a little old to be showing up in 1.1.5-SNAPSHOT. The file I have locally is 11/25/06. I decompiled it and it does have the old version. I think on 11/25 I did a local build of 1.1.5-SNAPSHOT and that may be insulating me from the change. Not sure. Anyway, the select menu is going to be more strict in this version. Is that correct, or should it attempt the conversion? I tried putting in a number converter, but it choked as well. The message was very long, but it looked like it was putting out a Long, and failing with the attempted to setting of the Short. I could write my own converter, but the old way was a lot easier. Just want to make sure that's my only option before I start hacking away. Thanks, -Kevin On 2/26/07, Kevin Galligan [EMAIL PROTECTED] wrote: I'm having the same problem. I had some code that was working for a long time with 1.1.5-SNAPSHOT, and now I'm getting that error. h:selectOneMenu value=#{shared$FavoriteDocumentAdd.documentTypeId} onchange=toggleInputRow() id=documentTypeSelect style=background-color:rgb(204,204,255) f:selectItem itemLabel=Website URL itemValue=3/ f:selectItem itemLabel=File Upload itemValue=1/ f:selectItem itemLabel=Description Only itemValue=2/ /h:selectOneMenu The value being set is a short. Essentially it looks like the code was doing an automatic conversion before, but now chokes. I just reverted the code to 1.1.5-SNAPSHOT, and it works again. I'm going to try to take a quick look at the differences between UISelectOne.java between those two versions, but in practice I've found with any large code base, it'll take a little time to really understand the layout. On 2/26/07, CarlHowarth [EMAIL PROTECTED] wrote: Hi, I am having this problem too. My select one is set up as follows: h:selectOneMenu id=regionList binding=#{Bean.regionListUI} value=#{Bean.region} f:converter converterId= myapp.Region/ f:selectItem itemValue=0 itemLabel=(all)/ t:selectItems var=r itemLabel=#{ r.name} itemValue=#{ r.idString} value=#{applicationBean.regionMap} / f:attribute name=fieldRef value=Region List/ /h:selectOneMenu - This was working fine with 1.1.4 but since the upgrade to 1.1.5 it now falls over. - The application bean is at application scope, so the values should always be available. - The converter changes an ID to a region and vice versa. - The page loads up fine, I only have the problem when I select a command button that runs an action listener. - I use a 't:saveState value=#{Bean_track}/' for my request-scoped bean. - The region bean implements a working 'equals' method. - If I select the manually populated select item, (all), it works correctly. My converter is like this: public final static String CONVERTER_ID = myapp.Region; public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String string) throws ConverterException { return JSFUtils.getAppBackingBean().getRegionMap().get(Integer.parseInt(string)); } public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object object) throws ConverterException { if (object == null) { return null; } else if (object instanceof Region) { final Region region = (Region) object; return region.getId().toString(); } return object.toString(); } I am at
Re: [Solved] ERROR: Value is not a valid option
Take a look at http://issues.apache.org/jira/browse/MYFACES-1328. It looks like the RI does not have this convenience conversion. I don't know what the spec says, but that'd be the place to get a definitive answer. If you're using facelets, as a temporary workaround you could create a convertStringToShort() function (or whatever conversion you're expecting to have happen automatically). On 2/26/07, Kevin Galligan [EMAIL PROTECTED] wrote: I did try that and didn't have any luck. I think that was due to the fact that I was using shorts rather than ints, but I'd have to try it again now that I have a better understanding of everything involved. I looked at TOMAHAWK-152 briefly. I'll have to sit down and take a better look at it. It looks to be in the realm. The string value of 'true' not matching with a boolean type value? I guess the bottom line is I'd like to find out if I should be using an explicit converter to go from String to Short, or if the JSF api being used should be able to handle a simple[r] conversion like that. It was doing that conversion originally. Does the JSF spec cover this? Anybody happen to know what the reference implementation does? I'd love to try it out, but we're trying to push this out the door, so for the near future I have to focus on what's right in front of me. On 2/26/07, Martin Grotzke [EMAIL PROTECTED] wrote: Does it work when you use itemValue=#{3} as workaround? I also had the same problem with itemValue=true, what I think is http://issues.apache.org/jira/browse/TOMAHAWK-152 ... Cheers, Martin On Mon, 2007-02-26 at 11:23 -0500, Kevin Galligan wrote: I'm having the same problem. I had some code that was working for a long time with 1.1.5-SNAPSHOT, and now I'm getting that error. h:selectOneMenu value=#{shared$FavoriteDocumentAdd.documentTypeId} onchange=toggleInputRow() id=documentTypeSelect style=background-color:rgb(204,204,255) f:selectItem itemLabel=Website URL itemValue=3/ f:selectItem itemLabel=File Upload itemValue=1/ f:selectItem itemLabel=Description Only itemValue=2/ /h:selectOneMenu The value being set is a short. Essentially it looks like the code was doing an automatic conversion before, but now chokes. I just reverted the code to 1.1.5-SNAPSHOT, and it works again. I'm going to try to take a quick look at the differences between UISelectOne.java between those two versions, but in practice I've found with any large code base, it'll take a little time to really understand the layout. On 2/26/07, CarlHowarth [EMAIL PROTECTED] wrote: Hi, I am having this problem too. My select one is set up as follows: h:selectOneMenu id=regionList binding=#{Bean.regionListUI} value=#{Bean.region} f:converter converterId= myapp.Region/ f:selectItem itemValue=0 itemLabel=(all)/ t:selectItems var=r itemLabel=#{r.name } itemValue=#{ r.idString} value=#{applicationBean.regionMap} / f:attribute name=fieldRef value=Region List/ /h:selectOneMenu - This was working fine with 1.1.4 but since the upgrade to 1.1.5 it now falls over. - The application bean is at application scope, so the values should always be available. - The converter changes an ID to a region and vice versa. - The page loads up fine, I only have the problem when I select a command button that runs an action listener. - I use a 't:saveState value=#{Bean_track}/' for my request-scoped bean. - The region bean implements a working 'equals' method. - If I select the manually populated select item, (all), it works correctly. My converter is like this: public final static String CONVERTER_ID = myapp.Region; public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String string) throws ConverterException { return JSFUtils.getAppBackingBean().getRegionMap().get(Integer.parseInt(string)); } public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object object) throws ConverterException { if (object == null) { return null; } else if (object instanceof Region) { final Region region = (Region) object; return region.getId().toString(); } return object.toString(); } I am at a complete loss at the moment, so any thoughts on what could be causing this error would be appreciated. Thanks, Carl Ernst Fastl wrote:
Re: [Solved] ERROR: Value is not a valid option
I am using facelets. Where would that function go? Each f:selectItem entry? f:selectItem itemLabel=Website URL itemValue=#{myfn:convertStringToShort(3)}/ On 2/26/07, Mike Kienenberger [EMAIL PROTECTED] wrote: Take a look at http://issues.apache.org/jira/browse/MYFACES-1328. It looks like the RI does not have this convenience conversion. I don't know what the spec says, but that'd be the place to get a definitive answer. If you're using facelets, as a temporary workaround you could create a convertStringToShort() function (or whatever conversion you're expecting to have happen automatically). On 2/26/07, Kevin Galligan [EMAIL PROTECTED] wrote: I did try that and didn't have any luck. I think that was due to the fact that I was using shorts rather than ints, but I'd have to try it again now that I have a better understanding of everything involved. I looked at TOMAHAWK-152 briefly. I'll have to sit down and take a better look at it. It looks to be in the realm. The string value of 'true' not matching with a boolean type value? I guess the bottom line is I'd like to find out if I should be using an explicit converter to go from String to Short, or if the JSF api being used should be able to handle a simple[r] conversion like that. It was doing that conversion originally. Does the JSF spec cover this? Anybody happen to know what the reference implementation does? I'd love to try it out, but we're trying to push this out the door, so for the near future I have to focus on what's right in front of me. On 2/26/07, Martin Grotzke [EMAIL PROTECTED] wrote: Does it work when you use itemValue=#{3} as workaround? I also had the same problem with itemValue=true, what I think is http://issues.apache.org/jira/browse/TOMAHAWK-152 ... Cheers, Martin On Mon, 2007-02-26 at 11:23 -0500, Kevin Galligan wrote: I'm having the same problem. I had some code that was working for a long time with 1.1.5-SNAPSHOT, and now I'm getting that error. h:selectOneMenu value=#{shared$FavoriteDocumentAdd.documentTypeId} onchange=toggleInputRow() id=documentTypeSelect style=background-color:rgb(204,204,255) f:selectItem itemLabel=Website URL itemValue=3/ f:selectItem itemLabel=File Upload itemValue=1/ f:selectItem itemLabel=Description Only itemValue=2/ /h:selectOneMenu The value being set is a short. Essentially it looks like the code was doing an automatic conversion before, but now chokes. I just reverted the code to 1.1.5-SNAPSHOT, and it works again. I'm going to try to take a quick look at the differences between UISelectOne.java between those two versions, but in practice I've found with any large code base, it'll take a little time to really understand the layout. On 2/26/07, CarlHowarth [EMAIL PROTECTED] wrote: Hi, I am having this problem too. My select one is set up as follows: h:selectOneMenu id=regionList binding=#{Bean.regionListUI} value=#{Bean.region} f:converter converterId= myapp.Region/ f:selectItem itemValue=0 itemLabel=(all)/ t:selectItems var=r itemLabel=#{r.name } itemValue=#{ r.idString} value=#{applicationBean.regionMap} / f:attribute name=fieldRef value=Region List/ /h:selectOneMenu - This was working fine with 1.1.4 but since the upgrade to 1.1.5 it now falls over. - The application bean is at application scope, so the values should always be available. - The converter changes an ID to a region and vice versa. - The page loads up fine, I only have the problem when I select a command button that runs an action listener. - I use a 't:saveState value=#{Bean_track}/' for my request-scoped bean. - The region bean implements a working 'equals' method. - If I select the manually populated select item, (all), it works correctly. My converter is like this: public final static String CONVERTER_ID = myapp.Region; public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String string) throws ConverterException { return JSFUtils.getAppBackingBean().getRegionMap().get(Integer.parseInt (string)); } public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object object) throws ConverterException { if (object == null) { return null; } else if (object instanceof Region) { final Region region = (Region) object; return
Re: [Solved] ERROR: Value is not a valid option
Yes, that's how I would do it. If you specify an itemValue, then that value must be of the correct type. Ie, is not a containerType (Srinivas) and 0 is not a region (Carl). On 2/26/07, Kevin Galligan [EMAIL PROTECTED] wrote: I am using facelets. Where would that function go? Each f:selectItem entry? f:selectItem itemLabel=Website URL itemValue=#{myfn:convertStringToShort(3)}/ On 2/26/07, Mike Kienenberger [EMAIL PROTECTED] wrote: Take a look at http://issues.apache.org/jira/browse/MYFACES-1328. It looks like the RI does not have this convenience conversion. I don't know what the spec says, but that'd be the place to get a definitive answer. If you're using facelets, as a temporary workaround you could create a convertStringToShort() function (or whatever conversion you're expecting to have happen automatically). On 2/26/07, Kevin Galligan [EMAIL PROTECTED] wrote: I did try that and didn't have any luck. I think that was due to the fact that I was using shorts rather than ints, but I'd have to try it again now that I have a better understanding of everything involved. I looked at TOMAHAWK-152 briefly. I'll have to sit down and take a better look at it. It looks to be in the realm. The string value of 'true' not matching with a boolean type value? I guess the bottom line is I'd like to find out if I should be using an explicit converter to go from String to Short, or if the JSF api being used should be able to handle a simple[r] conversion like that. It was doing that conversion originally. Does the JSF spec cover this? Anybody happen to know what the reference implementation does? I'd love to try it out, but we're trying to push this out the door, so for the near future I have to focus on what's right in front of me. On 2/26/07, Martin Grotzke [EMAIL PROTECTED] wrote: Does it work when you use itemValue=#{3} as workaround? I also had the same problem with itemValue=true, what I think is http://issues.apache.org/jira/browse/TOMAHAWK-152 ... Cheers, Martin On Mon, 2007-02-26 at 11:23 -0500, Kevin Galligan wrote: I'm having the same problem. I had some code that was working for a long time with 1.1.5-SNAPSHOT, and now I'm getting that error. h:selectOneMenu value=#{shared$FavoriteDocumentAdd.documentTypeId} onchange=toggleInputRow() id=documentTypeSelect style=background-color:rgb(204,204,255) f:selectItem itemLabel=Website URL itemValue=3/ f:selectItem itemLabel=File Upload itemValue=1/ f:selectItem itemLabel=Description Only itemValue=2/ /h:selectOneMenu The value being set is a short. Essentially it looks like the code was doing an automatic conversion before, but now chokes. I just reverted the code to 1.1.5-SNAPSHOT, and it works again. I'm going to try to take a quick look at the differences between UISelectOne.java between those two versions, but in practice I've found with any large code base, it'll take a little time to really understand the layout. On 2/26/07, CarlHowarth [EMAIL PROTECTED] wrote: Hi, I am having this problem too. My select one is set up as follows: h:selectOneMenu id=regionList binding=#{Bean.regionListUI} value=#{ Bean.region} f:converter converterId= myapp.Region/ f:selectItem itemValue=0 itemLabel=(all)/ t:selectItems var=r itemLabel=#{ r.name } itemValue=#{ r.idString} value=#{applicationBean.regionMap} / f:attribute name=fieldRef value=Region List/ /h:selectOneMenu - This was working fine with 1.1.4 but since the upgrade to 1.1.5 it now falls over. - The application bean is at application scope, so the values should always be available. - The converter changes an ID to a region and vice versa. - The page loads up fine, I only have the problem when I select a command button that runs an action listener. - I use a 't:saveState value=#{Bean_track}/' for my request-scoped bean. - The region bean implements a working 'equals' method. - If I select the manually populated select item, (all), it works correctly. My converter is like this: public final static String CONVERTER_ID = myapp.Region; public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String string) throws ConverterException { return JSFUtils.getAppBackingBean().getRegionMap().get(Integer.parseInt(string)); } public String getAsString(FacesContext facesContext,
Re: [Solved] ERROR: Value is not a valid option
Thanks for the quick replies. I think that clears it up. On 2/26/07, Mike Kienenberger [EMAIL PROTECTED] wrote: Yes, that's how I would do it. If you specify an itemValue, then that value must be of the correct type. Ie, is not a containerType (Srinivas) and 0 is not a region (Carl). On 2/26/07, Kevin Galligan [EMAIL PROTECTED] wrote: I am using facelets. Where would that function go? Each f:selectItem entry? f:selectItem itemLabel=Website URL itemValue=#{myfn:convertStringToShort(3)}/ On 2/26/07, Mike Kienenberger [EMAIL PROTECTED] wrote: Take a look at http://issues.apache.org/jira/browse/MYFACES-1328. It looks like the RI does not have this convenience conversion. I don't know what the spec says, but that'd be the place to get a definitive answer. If you're using facelets, as a temporary workaround you could create a convertStringToShort() function (or whatever conversion you're expecting to have happen automatically). On 2/26/07, Kevin Galligan [EMAIL PROTECTED] wrote: I did try that and didn't have any luck. I think that was due to the fact that I was using shorts rather than ints, but I'd have to try it again now that I have a better understanding of everything involved. I looked at TOMAHAWK-152 briefly. I'll have to sit down and take a better look at it. It looks to be in the realm. The string value of 'true' not matching with a boolean type value? I guess the bottom line is I'd like to find out if I should be using an explicit converter to go from String to Short, or if the JSF api being used should be able to handle a simple[r] conversion like that. It was doing that conversion originally. Does the JSF spec cover this? Anybody happen to know what the reference implementation does? I'd love to try it out, but we're trying to push this out the door, so for the near future I have to focus on what's right in front of me. On 2/26/07, Martin Grotzke [EMAIL PROTECTED] wrote: Does it work when you use itemValue=#{3} as workaround? I also had the same problem with itemValue=true, what I think is http://issues.apache.org/jira/browse/TOMAHAWK-152 ... Cheers, Martin On Mon, 2007-02-26 at 11:23 -0500, Kevin Galligan wrote: I'm having the same problem. I had some code that was working for a long time with 1.1.5-SNAPSHOT, and now I'm getting that error. h:selectOneMenu value=#{shared$FavoriteDocumentAdd.documentTypeId} onchange=toggleInputRow() id=documentTypeSelect style=background-color:rgb(204,204,255) f:selectItem itemLabel=Website URL itemValue=3/ f:selectItem itemLabel=File Upload itemValue=1/ f:selectItem itemLabel=Description Only itemValue=2/ /h:selectOneMenu The value being set is a short. Essentially it looks like the code was doing an automatic conversion before, but now chokes. I just reverted the code to 1.1.5-SNAPSHOT, and it works again. I'm going to try to take a quick look at the differences between UISelectOne.java between those two versions, but in practice I've found with any large code base, it'll take a little time to really understand the layout. On 2/26/07, CarlHowarth [EMAIL PROTECTED] wrote: Hi, I am having this problem too. My select one is set up as follows: h:selectOneMenu id=regionList binding=#{Bean.regionListUI} value=#{ Bean.region} f:converter converterId= myapp.Region/ f:selectItem itemValue=0 itemLabel=(all)/ t:selectItems var=r itemLabel=#{ r.name } itemValue=#{ r.idString} value=#{applicationBean.regionMap} / f:attribute name=fieldRef value=Region List/ /h:selectOneMenu - This was working fine with 1.1.4 but since the upgrade to 1.1.5 it now falls over. - The application bean is at application scope, so the values should always be available. - The converter changes an ID to a region and vice versa. - The page loads up fine, I only have the problem when I select a command button that runs an action listener. - I use a 't:saveState value=#{Bean_track}/' for my request-scoped bean. - The region bean implements a working 'equals' method. - If I select the manually populated select item, (all), it works correctly. My converter is like this: public final static String CONVERTER_ID = myapp.Region ; public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String string) throws
Re: [Solved] ERROR: Value is not a valid option
On 2/26/07, Mike Kienenberger [EMAIL PROTECTED] wrote: Yes, that's how I would do it. If you specify an itemValue, then that value must be of the correct type. Ie, is not a containerType (Srinivas) and 0 is not a region (Carl). Another way to handle this is to provide your itemValues from a backing bean for these things: ie, itemValue=#{constants.noSelectionContainerType} itemLabel=no selection
sitemesh and jsf
I'm trying to use sitmesh with JSF and am getting the following exception: This is my template decorator page and has a f:view page. Is there something I have to do with this to initialize the FacesContext for the decorators/templates? javax.faces.FacesException: Faces context not found. getResponseWriter will fail. Check if the FacesServlet has been initialized at all in your web.xml configuration fileand if you are accessing your jsf-pages through the correct mapping. E.g.: if your FacesServlet is mapped to *.jsf (with the servlet-mapping-element), you need to access your pages as 'sample.jsf'. If you tried to access 'sample.jsp', you'd get this error-message. javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:926) javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:313) org.apache.myfaces.taglib.core.ViewTag.doStartTag(ViewTag.java:73) org.apache.jsp.decorators.andreasTemplate_jsp._jspx_meth_f_view_0(andreasTemplate_jsp.java:146) org.apache.jsp.decorators.andreasTemplate_jsp._jspService(andreasTemplate_jsp.java:122) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) com.age.j.soft.sitemesh.TemplateFilterImpl.applyDecorator(TemplateFilterImpl.java:49) com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:62) org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
Unable to display Suggested Items using Sandbox component s:inputAjaxSuggest
Hi I am using Facelets 1.1.2 and tomahawk-sandbox-1.1.3-SNAPSHOT.jar, tomahawk-1.1.3.jar, MyFaces 1.1.4. The code works perfectly fine but when i enter values into textbox it doesnt show up suggested Items . Then i debugged the application with log4j Here is the jsp page h:outputText value=Enter your name : / s:inputSuggestAjax suggestedItemsMethod=#{test.getSuggestedWords} value=#{test.currentValue} / br / h:commandButton value=Submit/ br / h:outputText value=Your name is #{test.currentValue}/ Here is the backing bean public List getSuggestedWords(String keyword) { List list = new ArrayList(); list.add(keyword + Ahmed Saleh); list.add(keyword + Kahki); list.add(keyword + Kourany); list.add(keyword + Kiki); list.add(keyword + Saleh Abouetta); list.add(keyword + Hashim); return list; } public String getCurrentValue() { return currentValue; } public void setCurrentValue(String currentValue) { this.currentValue = currentValue; } //current selected value String currentValue; I have set the Save State to Client in web.xml Any pointers/suggestions will be highly appreciated Regards Bansi -- View this message in context: http://www.nabble.com/Unable-to-display-Suggested-Items-using-Sandbox-component-s%3AinputAjaxSuggest-tf3295288.html#a9166912 Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: tobago demo 109 : tc tree control: Faces Tree recurring problem
Hello, you may use the upcoming new tree from the sandbox. I've added a simple editor in the tobago-example-sandbox. It shows how an editor may written (in the moment it is a VERY simple example, it only adds one node to the selected node). Regards, Udo ws_dev2001 schrieb: Hi all, I am using tobago 109 and myfaces 114 on tomcat. My interest is in the tobago component tree control. I am not able to operate the copy and edit functionality. If anyone can help me out it would be really useful. I get this stack trace in the tobago demo log : Caused by: org.apache.jasper.JasperException: Client-id : m1172375745580 is duplicated in the faces tree. Component : page:mytree:m1172375745580, path: {Component-Path : [Class: org.apache.myfaces.tobago.component.UIViewRoot,ViewId: /overview/treeCnt.jsp][Class: org.apache.myfaces.tobago.component.UIPage,Id: page][Class: org.apache.myfaces.tobago.component.UITreeOld,Id: mytree][Class: org.apache.myfaces.tobago.component.UITreeOldNode,Id: root][Class: org.apache.myfaces.tobago.component.UITreeOldNode,Id: movies][Class: org.apache.myfaces.tobago.component.UITreeOldNode,Id: m1172375745580]} TIA, May the source be with u R2D2. ___ All New Yahoo! Mail – Tired of unwanted email come-ons? Let our SpamGuard protect you. http://uk.docs.yahoo.com/nowyoucan.html
Re: [Solved] Unable to display Suggested Items using Sandbox component s:inputAjaxSuggest
Here is some more info on my earlier posting I figured out from debugging that control doesnt go to getSuggestedWords() method as the following line never gets printed in the log console : System.out.println(In getSuggestedWords method ); Wondering what could be the reason Regards Bansi bansi wrote: Hi I am using Facelets 1.1.2 and tomahawk-sandbox-1.1.3-SNAPSHOT.jar, tomahawk-1.1.3.jar, MyFaces 1.1.4. The code works perfectly fine but when i enter values into textbox it doesnt show up suggested Items . Then i debugged the application with log4j Here is the jsp page h:outputText value=Enter your name : / s:inputSuggestAjax suggestedItemsMethod=#{test.getSuggestedWords} value=#{test.currentValue} / br / h:commandButton value=Submit/ br / h:outputText value=Your name is #{test.currentValue}/ Here is the backing bean public List getSuggestedWords(String keyword) { List list = new ArrayList(); list.add(keyword + Ahmed Saleh); list.add(keyword + Kahki); list.add(keyword + Kourany); list.add(keyword + Kiki); list.add(keyword + Saleh Abouetta); list.add(keyword + Hashim); return list; } public String getCurrentValue() { return currentValue; } public void setCurrentValue(String currentValue) { this.currentValue = currentValue; } //current selected value String currentValue; I have set the Save State to Client in web.xml Any pointers/suggestions will be highly appreciated Regards Bansi -- View this message in context: http://www.nabble.com/Unable-to-display-Suggested-Items-using-Sandbox-component-s%3AinputAjaxSuggest-tf3295288.html#a9168175 Sent from the MyFaces - Users mailing list archive at Nabble.com.
[Tobago] Problem with PDF download and Ajax
Hi, I've a page with a link to download a PDF file. The PDF download itself works without a problem. But after a download Ajax requests don't work anymore, for example a popup or a tabGroup with reloadTab. Here's a small testcase for this behavior. The page: %@ taglib uri=http://myfaces.apache.org/tobago/component; prefix=tc %%@ taglib uri=http://java.sun.com/jsf/core; prefix=f %%@ page contentType=text/html;charset=UTF-8 language=java %%@ page pageEncoding=UTF-8 %f:view tc:page id=testPage width=300px height=200px tc:panel f:facet name=layout tc:gridLayout cellspacing=0 rows=fixed;fixed/ /f:facet tc:link id=pdfLink label=PDF immediate=true transition=false actionListener=#{anlagenController.showPDFActionListener} f:attribute name=file value=test1.pdf/ /tc:link tc:link id=ajaxLink label=Ajax tc:attribute name=renderedPartially value=testPopup/ f:facet name=popup tc:popup id=testPopup width=300 height=200 tc:button id=closeButton label=Close tc:attribute name=popupClose value=immediate/ /tc:button /tc:popup /f:facet /tc:link /tc:panel /tc:page /f:view The java code for the PDF download: public void showPDFActionListener(ActionEvent e) { String filename = (String)e.getComponent().getAttributes().get(file); sendFile(attachmentPath, filename, application/pdf); } protected void sendFile(String filepath, String filename, String mimeType) { File file = new File(filepath, filename); if (file.exists() file.isFile()) { try { InputStream in = new FileInputStream(file); FacesContext facesContext = FacesContext.getCurrentInstance(); HttpServletResponse response = (HttpServletResponse)facesContext.getExternalContext().getResponse(); response.setContentType(mimeType); response.setContentLength(in.available()); response.setHeader(Content-disposition, attachment;filename=\ + filename + \); ServletOutputStream out = response.getOutputStream(); byte[] buffer = new byte[0x1]; while (in.read(buffer) 0) { out.write(buffer); } in.close(); out.close(); StateManager stateManager = (StateManager)facesContext.getApplication().getStateManager(); stateManager.saveSerializedView(facesContext); facesContext.responseComplete(); } catch (Exception x) { getLog().error(Error writing output, x); } } else { getLog().error(File + file.getAbsolutePath() + not found); } } I think there's a problem with Ajax when a page submit has no result. Regards Helmut
Re: [Tobago] Problem with PDF download and Ajax
Hello Helmut, just solved see: http://issues.apache.org/jira/browse/TOBAGO-303 Should be available with the next nightly build Regards Bernd H. Swaczinna wrote: Hi, I've a page with a link to download a PDF file. The PDF download itself works without a problem. But after a download Ajax requests don't work anymore, for example a popup or a tabGroup with reloadTab. Here's a small testcase for this behavior. The page: %@ taglib uri=http://myfaces.apache.org/tobago/component; prefix=tc %%@ taglib uri=http://java.sun.com/jsf/core; prefix=f %%@ page contentType=text/html;charset=UTF-8 language=java %%@ page pageEncoding=UTF-8 %f:view tc:page id=testPage width=300px height=200px tc:panel f:facet name=layout tc:gridLayout cellspacing=0 rows=fixed;fixed/ /f:facet tc:link id=pdfLink label=PDF immediate=true transition=false actionListener=#{anlagenController.showPDFActionListener} f:attribute name=file value=test1.pdf/ /tc:link tc:link id=ajaxLink label=Ajax tc:attribute name=renderedPartially value=testPopup/ f:facet name=popup tc:popup id=testPopup width=300 height=200 tc:button id=closeButton label=Close tc:attribute name=popupClose value=immediate/ /tc:button /tc:popup /f:facet /tc:link /tc:panel /tc:page /f:view The java code for the PDF download: public void showPDFActionListener(ActionEvent e) { String filename = (String)e.getComponent().getAttributes().get(file); sendFile(attachmentPath, filename, application/pdf); } protected void sendFile(String filepath, String filename, String mimeType) { File file = new File(filepath, filename); if (file.exists() file.isFile()) { try { InputStream in = new FileInputStream(file); FacesContext facesContext = FacesContext.getCurrentInstance(); HttpServletResponse response = (HttpServletResponse)facesContext.getExternalContext().getResponse(); response.setContentType(mimeType); response.setContentLength(in.available()); response.setHeader(Content-disposition, attachment;filename=\ + filename + \); ServletOutputStream out = response.getOutputStream(); byte[] buffer = new byte[0x1]; while (in.read(buffer) 0) { out.write(buffer); } in.close(); out.close(); StateManager stateManager = (StateManager)facesContext.getApplication().getStateManager(); stateManager.saveSerializedView(facesContext); facesContext.responseComplete(); } catch (Exception x) { getLog().error(Error writing output, x); } } else { getLog().error(File + file.getAbsolutePath() + not found); } } I think there's a problem with Ajax when a page submit has no result. Regards Helmut
jscookMenu
Hello, I'm having two seemingly very strange problems with the jscookMenu component. The first problem relates to navigation. I embedded a jscMenu inside a dataTable to act as something comparable to a right-click menu on a rich application. The menu works sort of the way one might expect, and calls the underlying bean actions. However, row selection on the table is not set, and navigation handling seems whacked thereafter (particularly with respect to the back button). I have a hard time even describing what goes on after using this embedded menu, because it seems that the regular commandLinks all get broken in spite of the fact that they worked fine before using the embedded menu. E.g. click on a commandLink (navigation works), click back, click menu (navigation works), click back, click on the previous commandLink and nav is broken, you are taken back to the screen handled by the menu. I know this is not enough information to go on in order to debug this problem, but what sort of components have people used to perform context sensitive navigation from within a table? The other problem I'm having with jscMenu is even more baffling to me. I cannot get the menu to appear at all. This is just a little test menu, and it refuses to be processed at all. It is behaving as though the menu definition is placed within a verbatim, but clearly it is not. That is, if I view the source html on a page generated with this menu in place, I still see the jsp syntax, nothing has been translated to html/js. The test menu was copy/pasted from another page where it works fine, so there is no issue with the menu definition itself. I've tried putting the menu in it's own form, but that did nothing. The only thing different about this particular page is that the vast majority of content on the page is built in java code, not jsp. I don't know what difference that could make, because every other component specified in jsp works as expected, but the menu is hosed. Any ideas would be greatly appreciated. Thanks -- Shane
[ANNOUNCE] Article: InFact Uses JSF to Power Book Search Portal
Hello, I'm pleased to announce the return of JSF Central's popular In the Trenches series. The latest installment tells the story of two developers who used JSF to develop the public-facing InFact Book Search site. Here's a quote: The first phase of the project was completed in less than three months starting from scratch. The initial feedback was very positive and was followed by requests to make some significant changes in the layout and features of the application. Our flexible, re-usable architecture for the backing bean and helper classes helped us to incorporate these changes surprisingly quickly (see Figure 2). At this point, we considered how long it would have taken us to make these same changes using the other frameworks we were familiar with, and we were glad we chose to go the JSF route. Read the full article here: http://www.jsfcentral.com/articles/trenches_6.html http://www.jsfcentral.com/articles/trenches_6.html ~~~ Kito D. Mann - Author, JavaServer Faces in Action http://www.JSFCentral.com http://www.jsfcentral.com/ - JavaServer Faces FAQ, news, and info * Sign up for the JSF Central newsletter! http://oi.vresp.com/?fid=ac048d0e17 *
need help editing a row of data.
I have a dataTable that has a list of users: t:dataTable value=#{userBackingBean.users} var=user preserveDataModel=false styleClass=users headerClass=usersHeader rowClasses=evenRow, oddRow columnClasses=username,name border=0 h:column f:facet name=header h:outputText value=#{messages['label.username ']}/ /f:facet [h:commandLink f:actionListener type= com.baselogic.tro.user.impl.UserActionListener/ h:outputText value=#{user.username}/ /h:commandLinkbl:nbsp/]bl:nbsp/bl:nbsp/bl:nbsp/ When I click this link, I get sent to com.baselogic.tro.user.impl.UserActionListener.processAction: public void processAction(ActionEvent anEvent) throws AbortProcessingException { log.info(++); log.info(processAction(ActionEvent anEvent)); log.info(++); User tmpUserBean = null; UIComponent tmpComponent = anEvent.getComponent(); while (null != tmpComponent !(tmpComponent instanceof UIData)) { log.info (---while--); tmpComponent = tmpComponent.getParent(); } if (tmpComponent != null (tmpComponent instanceof UIData)) { Object tmpRowData = ((UIData) tmpComponent).getRowData(); if (tmpRowData instanceof User) { tmpUserBean = (User) tmpRowData; //TODO Implementation of your method log.info (++); log.info(tmpUserBean.toString(): + tmpUserBean.toString ()); log.info (++); } } //TODO Exception Handling if UIData not found or tmpRowBean of wrong type tmpUserBean prints the row I was expecting, but now I do not know how to get tmpUserBean in the request and sent back to userDetail.xhtml -- --- Thanks, Mick Knutson http://www.baselogic.com http://www.blincmagazine.com http://www.djmick.com http://www.myspace.com/djmick_dot_com http://www.thumpradio.com ---
Re: need help editing a row of data.
Mick Knutson wrote: tmpUserBean prints the row I was expecting, but now I do not know how to get tmpUserBean in the request and sent back to userDetail.xhtml What do you mean by sent back to userDetail.xhtml? Note that the h:commandLink tag can take an actionListener *attribute* as an alternative to using an f:actionListener child. The attribute form is an EL expression, ie can point to a method on your normal backing bean, which I find far more useful than an independent ActionListener class. Regards, Simon
Re: need help editing a row of data.
i display a table of users on listUsers.xhtml Then I want to click the username link and open the selected user in that row on editUser.xhtml so I can edit that user. On 2/26/07, Simon Kitching [EMAIL PROTECTED] wrote: Mick Knutson wrote: tmpUserBean prints the row I was expecting, but now I do not know how to get tmpUserBean in the request and sent back to userDetail.xhtml What do you mean by sent back to userDetail.xhtml? Note that the h:commandLink tag can take an actionListener *attribute* as an alternative to using an f:actionListener child. The attribute form is an EL expression, ie can point to a method on your normal backing bean, which I find far more useful than an independent ActionListener class. Regards, Simon -- --- Thanks, Mick Knutson http://www.baselogic.com http://www.blincmagazine.com http://www.djmick.com http://www.myspace.com/djmick_dot_com http://www.thumpradio.com ---
Re: need help editing a row of data.
I also tried this: http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters then I have this method: public String prepareForEdit(){ log.info (++); log.info (++); log.info (++); log.info (++); log.info(UserBackingBean.prepareForEdit(String)); log.info(UserBackingBean.user.username(): + user.getUsername()); String outcome = Constants.FAILURE; try { user = manager.getUser(user.getUsername()); log.info (++); log.info(user.toString(): + user.toString()); log.info (++); outcome = Constants.EDIT; } catch (Exception e) { outcome = Constants.FAILURE; FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(e.getMessage())); e.printStackTrace(); return(null); } return outcome; } but then when I get redirected to the editUser.xhtml page, the form is blank. I even added: t:saveState id=user value=#{userBackingBean.user} / as all the mangedBean's are request scope but I can't seem to populate the editUser form with data. On 2/26/07, Simon Kitching [EMAIL PROTECTED] wrote: Mick Knutson wrote: tmpUserBean prints the row I was expecting, but now I do not know how to get tmpUserBean in the request and sent back to userDetail.xhtml What do you mean by sent back to userDetail.xhtml? Note that the h:commandLink tag can take an actionListener *attribute* as an alternative to using an f:actionListener child. The attribute form is an EL expression, ie can point to a method on your normal backing bean, which I find far more useful than an independent ActionListener class. Regards, Simon -- --- Thanks, Mick Knutson http://www.baselogic.com http://www.blincmagazine.com http://www.djmick.com http://www.myspace.com/djmick_dot_com http://www.thumpradio.com ---
Facelets doesnt render sandbox component s:inputSuggestAjax
I am using Facelets 1.1.2 and tomahawk-sandbox 1.1.4 I figured out that Facelets were unable to render inputSuggestAjax component. I further validated it by putting debugging statements in suggestedItemsMethod The control never gets transfered to the method doesnt print the statements Then i tried using inputSuggestAjax component inside a simple JSP page. Guess what The inputSuggestAjax component got rendered perfectly with a small clock kind of thing to the extreme right of textbox whereas in case of Facelets it is a plain textbox Most importantly control got transfered to suggestedItemsMethod It also printed the statements inside the method Wondering is it really a problem with Facelets or is it i am doing something wrong here Regards Bansi -- View this message in context: http://www.nabble.com/Facelets-doesnt-render-sandbox-component-s%3AinputSuggestAjax-tf3297417.html#a9173089 Sent from the MyFaces - Users mailing list archive at Nabble.com.
Confused with session issues...
Regards to all, Ive been working on an application with JSF for 6 months and we are reaching the point when we need to do some optimization as there are lots of objects in session scope and this has got us quite concerned. I have been going over the lists past conversations regarding this subject but I continue with 2 mayor questions: 1. Is there any way to get an accurate estimation of the session size without using serialization? 2. Excessive Session use is discouraged, however components such as the tree and results tables only work properly when backed up by session scoped beans, I see some contradiction here and the savestate solution doesnt work for me as my application has multiple navigation paths between pages (no real rules of the type origin --destination can be applied) Thanks, JV
Re: Confused with session issues...
You can use t:updateActionListener to push values from one page to another, even if the data is request-scoped. On 2/26/07, Jorge Vásquez [EMAIL PROTECTED] wrote: Regards to all, I've been working on an application with JSF for 6 months and we are reaching the point when we need to do some optimization as there are lots of objects in session scope and this has got us quite concerned. I have been going over the list's past conversations regarding this subject but I continue with 2 mayor questions: 1. Is there any way to get an accurate estimation of the session size without using serialization? 2. Excessive Session use is discouraged, however components such as the tree and results tables only work properly when backed up by session scoped beans, I see some contradiction here and the savestate solution doesn't work for me as my application has multiple navigation paths between pages (no real rules of the type origin àdestination can be applied) Thanks, JV
Re: t:datatable with commandLink and parameter
Mick, I'm taking a look at this. I'll let you know what I figure out. On 2/26/07, Mick Knutson [EMAIL PROTECTED] wrote: I am still having issues it seems. I can display the table just fine and then when I click the link, I get sent to UserBackingBeanImpl.prepareForEdit() then to my edit user form, but there is still no data shown. I have attached the 2 xhrml files and the UserBackingBeanImpl.java file here.. I really appreciate your help. On 2/23/07, Mike Kienenberger [EMAIL PROTECTED] wrote: The following should work. t:saveState id=user value=#{ userBackingBean.user} / You'll want to set this on the receiving page, the page with the editable form (user detail page). You can also preserve values across pages by putting the same t:saveState on both pages with the same id. You'll need to be sure that the id is unique (I generally use the page name followed by the item to preserve, ie. viewUsersPageSelectedUser. The other thing you need to be sure of is that your UIData list is also preserved, but preserveDataModel=true should work. I normally use a t:saveState to do this, though, and never preserveDataModel. t:saveState id=viewUsersPageUserList value=#{ userBackingBean.users} / On 2/23/07, Mick Knutson [EMAIL PROTECTED] wrote: The only thing I am trying to do is view a list of users. Then be able to click the username, pull up that user in an editable form. On 2/23/07, Mick Knutson [EMAIL PROTECTED] wrote: Because I am using the jsf-acegi in my app, I can't make everything session scoped as it gives me these strange errors so I changed them all back to request. So how should I implement this t:saveState ??? On my userTable.xhtml: x:saveState id=user value=#{userBackingBean.user} / ??? On 2/23/07, Mike Kienenberger [EMAIL PROTECTED] wrote: Not enough information, but my guess is that userBackingBean is request-scoped and not being preserved across requests.An easy test is to make it session-scoped temporarily and see if that works. If it does, a better fix in my opinion is to either use t:saveState on userBackingBean.user (if you don't need to preserve the whole bean) or userBackingBean (if you do). On 2/23/07, Mick Knutson [EMAIL PROTECTED] wrote: Ok, thanks. But now, I have a UserBackingBean.user = manager.getUser(user.getUsername()); then: outcome = Constants.SUCCESS; But the form does not display any of the user variables. Hence I thought I had to bind those variables which was wrong. You help is greatly appreciated by the way... :-) On 2/23/07, Mike Kienenberger [EMAIL PROTECTED] wrote: binding=#{userBackingBean.user.username} is the cause of this error. It's attempting to assign the HtmlInputText component to the value of username. binding is for getting a reference to the component on a page into your backing bean. On 2/23/07, Mick Knutson [EMAIL PROTECTED] wrote: The issue was in my method signature. I needed to have no parameters in the action. With that completed, there seems to be another issue now. Caused by: javax.faces.el.EvaluationException: Bean: com.baselogic.tro.user.User , property: username, newValue: [EMAIL PROTECTED] 90c56,newValue class: javax.faces.component.html.HtmlInputText method parameter class: java.lang.String at org.apache.myfaces.el.PropertyResolverImpl.setProperty (PropertyResolverImpl.java:414) at org.apache.myfaces.el.PropertyResolverImpl.setValue (PropertyResolverImpl.java:176) at com.sun.facelets.el.LegacyELContext$LegacyELResolver.setValue(LegacyELContext.java :201) at com.sun.el.parser.AstValue.setValue(AstValue.java :113) at com.sun.el.ValueExpressionImpl.setValue (ValueExpressionImpl.java:246) at com.sun.facelets.el.TagValueExpression.setValue( TagValueExpression.java:93) at com.sun.facelets.el.LegacyValueBinding.setValue(LegacyValueBinding.java:68) ... 67 more Caused by: java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java :25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.myfaces.el.PropertyResolverImpl.setProperty (PropertyResolverImpl.java :409) ... 73
Re: t:datatable with commandLink and parameter
Well, one thing I see right off: t:updateActionListener property=#{userBackingBean.user.username} value=#{user.username} This is only going to set a username, not a user. Furthermore, if user is already null, it may not set anything. My guess is that you really want this: t:updateActionListener property=#{userBackingBean.user} value=#{user} On 2/26/07, Mike Kienenberger [EMAIL PROTECTED] wrote: Mick, I'm taking a look at this. I'll let you know what I figure out. On 2/26/07, Mick Knutson [EMAIL PROTECTED] wrote: I am still having issues it seems. I can display the table just fine and then when I click the link, I get sent to UserBackingBeanImpl.prepareForEdit() then to my edit user form, but there is still no data shown. I have attached the 2 xhrml files and the UserBackingBeanImpl.java file here.. I really appreciate your help. On 2/23/07, Mike Kienenberger [EMAIL PROTECTED] wrote: The following should work. t:saveState id=user value=#{ userBackingBean.user} / You'll want to set this on the receiving page, the page with the editable form (user detail page). You can also preserve values across pages by putting the same t:saveState on both pages with the same id. You'll need to be sure that the id is unique (I generally use the page name followed by the item to preserve, ie. viewUsersPageSelectedUser. The other thing you need to be sure of is that your UIData list is also preserved, but preserveDataModel=true should work. I normally use a t:saveState to do this, though, and never preserveDataModel. t:saveState id=viewUsersPageUserList value=#{ userBackingBean.users} / On 2/23/07, Mick Knutson [EMAIL PROTECTED] wrote: The only thing I am trying to do is view a list of users. Then be able to click the username, pull up that user in an editable form. On 2/23/07, Mick Knutson [EMAIL PROTECTED] wrote: Because I am using the jsf-acegi in my app, I can't make everything session scoped as it gives me these strange errors so I changed them all back to request. So how should I implement this t:saveState ??? On my userTable.xhtml: x:saveState id=user value=#{userBackingBean.user} / ??? On 2/23/07, Mike Kienenberger [EMAIL PROTECTED] wrote: Not enough information, but my guess is that userBackingBean is request-scoped and not being preserved across requests.An easy test is to make it session-scoped temporarily and see if that works. If it does, a better fix in my opinion is to either use t:saveState on userBackingBean.user (if you don't need to preserve the whole bean) or userBackingBean (if you do). On 2/23/07, Mick Knutson [EMAIL PROTECTED] wrote: Ok, thanks. But now, I have a UserBackingBean.user = manager.getUser(user.getUsername()); then: outcome = Constants.SUCCESS; But the form does not display any of the user variables. Hence I thought I had to bind those variables which was wrong. You help is greatly appreciated by the way... :-) On 2/23/07, Mike Kienenberger [EMAIL PROTECTED] wrote: binding=#{userBackingBean.user.username} is the cause of this error. It's attempting to assign the HtmlInputText component to the value of username. binding is for getting a reference to the component on a page into your backing bean. On 2/23/07, Mick Knutson [EMAIL PROTECTED] wrote: The issue was in my method signature. I needed to have no parameters in the action. With that completed, there seems to be another issue now. Caused by: javax.faces.el.EvaluationException: Bean: com.baselogic.tro.user.User , property: username, newValue: [EMAIL PROTECTED] 90c56,newValue class: javax.faces.component.html.HtmlInputText method parameter class: java.lang.String at org.apache.myfaces.el.PropertyResolverImpl.setProperty (PropertyResolverImpl.java:414) at org.apache.myfaces.el.PropertyResolverImpl.setValue (PropertyResolverImpl.java:176) at com.sun.facelets.el.LegacyELContext$LegacyELResolver.setValue(LegacyELContext.java :201) at com.sun.el.parser.AstValue.setValue(AstValue.java :113) at com.sun.el.ValueExpressionImpl.setValue (ValueExpressionImpl.java:246) at com.sun.facelets.el.TagValueExpression.setValue( TagValueExpression.java:93) at
Re: t:datatable with commandLink and parameter
And private User user = new User(); should just be private User user; On 2/26/07, Mike Kienenberger [EMAIL PROTECTED] wrote: Well, one thing I see right off: t:updateActionListener property=#{userBackingBean.user.username} value=#{user.username} This is only going to set a username, not a user. Furthermore, if user is already null, it may not set anything. My guess is that you really want this: t:updateActionListener property=#{userBackingBean.user} value=#{user} On 2/26/07, Mike Kienenberger [EMAIL PROTECTED] wrote: Mick, I'm taking a look at this. I'll let you know what I figure out. On 2/26/07, Mick Knutson [EMAIL PROTECTED] wrote: I am still having issues it seems. I can display the table just fine and then when I click the link, I get sent to UserBackingBeanImpl.prepareForEdit() then to my edit user form, but there is still no data shown. I have attached the 2 xhrml files and the UserBackingBeanImpl.java file here.. I really appreciate your help. On 2/23/07, Mike Kienenberger [EMAIL PROTECTED] wrote: The following should work. t:saveState id=user value=#{ userBackingBean.user} / You'll want to set this on the receiving page, the page with the editable form (user detail page). You can also preserve values across pages by putting the same t:saveState on both pages with the same id. You'll need to be sure that the id is unique (I generally use the page name followed by the item to preserve, ie. viewUsersPageSelectedUser. The other thing you need to be sure of is that your UIData list is also preserved, but preserveDataModel=true should work. I normally use a t:saveState to do this, though, and never preserveDataModel. t:saveState id=viewUsersPageUserList value=#{ userBackingBean.users} / On 2/23/07, Mick Knutson [EMAIL PROTECTED] wrote: The only thing I am trying to do is view a list of users. Then be able to click the username, pull up that user in an editable form. On 2/23/07, Mick Knutson [EMAIL PROTECTED] wrote: Because I am using the jsf-acegi in my app, I can't make everything session scoped as it gives me these strange errors so I changed them all back to request. So how should I implement this t:saveState ??? On my userTable.xhtml: x:saveState id=user value=#{userBackingBean.user} / ??? On 2/23/07, Mike Kienenberger [EMAIL PROTECTED] wrote: Not enough information, but my guess is that userBackingBean is request-scoped and not being preserved across requests.An easy test is to make it session-scoped temporarily and see if that works. If it does, a better fix in my opinion is to either use t:saveState on userBackingBean.user (if you don't need to preserve the whole bean) or userBackingBean (if you do). On 2/23/07, Mick Knutson [EMAIL PROTECTED] wrote: Ok, thanks. But now, I have a UserBackingBean.user = manager.getUser(user.getUsername()); then: outcome = Constants.SUCCESS; But the form does not display any of the user variables. Hence I thought I had to bind those variables which was wrong. You help is greatly appreciated by the way... :-) On 2/23/07, Mike Kienenberger [EMAIL PROTECTED] wrote: binding=#{userBackingBean.user.username} is the cause of this error. It's attempting to assign the HtmlInputText component to the value of username. binding is for getting a reference to the component on a page into your backing bean. On 2/23/07, Mick Knutson [EMAIL PROTECTED] wrote: The issue was in my method signature. I needed to have no parameters in the action. With that completed, there seems to be another issue now. Caused by: javax.faces.el.EvaluationException: Bean: com.baselogic.tro.user.User , property: username, newValue: [EMAIL PROTECTED] 90c56,newValue class: javax.faces.component.html.HtmlInputText method parameter class: java.lang.String at org.apache.myfaces.el.PropertyResolverImpl.setProperty (PropertyResolverImpl.java:414) at org.apache.myfaces.el.PropertyResolverImpl.setValue (PropertyResolverImpl.java:176) at com.sun.facelets.el.LegacyELContext$LegacyELResolver.setValue(LegacyELContext.java :201) at com.sun.el.parser.AstValue.setValue(AstValue.java :113)
Fwd: t:datatable with commandLink and parameter
Not sure why this bounced as spam. Maybe it was the zip attachment. Trying the pieces as individuals. -- Forwarded message -- From: Mike Kienenberger [EMAIL PROTECTED] Date: Feb 26, 2007 11:56 PM Subject: Re: t:datatable with commandLink and parameter To: MyFaces Discussion users@myfaces.apache.org Cc: [EMAIL PROTECTED] Here's an example showing what you want. I tried to preserve all of the various things you were trying to demonstrate while deleting the unnecessary parts :-) Here's some of the bigger issues: - You were setting the username rather than the user on the detail page. - You were using t:saveState on your table page's user object. Thus, you'd set the user/username, and then promptly lose it when the table page overwrote the value back to null. - You were trying to saveState the value of users (the list of users) on the table page, but in reality, this was a constant function call, not a settable value. I demonstrated one possible way to do this, but there are many. Some minor things: - You don't need to mess with ListDataModel. Just return a list of your items. - You were initializing the value of user. Just leave it null. Best practices: - Stick a single form in your template. Use sandbox:subForm if you want to have virtual forms on each content page. I assume you're using prepareForEdit to fetch or create a mutable version of the user. If that's not the case, simply change your button to action=Constants.EDIT instead of action=#{bean.method} since you don't need to execute any java code. Note that I changed this to user = manager.getUser(user) instead of getUser(username) in order to keep the example simple. If you don't plan on editing the user directly, I'd dump the user variable, and save the username of the selected user instead. t:updateActionListener property=#{userBackingBean.selectedUsername} value=#{user.userName} If possible, consider cleaning up and simplifying this even further and making it available either on a wiki page or as a myfaces example. On 2/26/07, Mick Knutson [EMAIL PROTECTED] wrote: I am still having issues it seems. I can display the table just fine and then when I click the link, I get sent to UserBackingBeanImpl.prepareForEdit() then to my edit user form, but there is still no data shown. I have attached the 2 xhrml files and the UserBackingBeanImpl.java file here.. I really appreciate your help. On 2/23/07, Mike Kienenberger [EMAIL PROTECTED] wrote: The following should work. t:saveState id=user value=#{ userBackingBean.user} / You'll want to set this on the receiving page, the page with the editable form (user detail page). You can also preserve values across pages by putting the same t:saveState on both pages with the same id. You'll need to be sure that the id is unique (I generally use the page name followed by the item to preserve, ie. viewUsersPageSelectedUser. The other thing you need to be sure of is that your UIData list is also preserved, but preserveDataModel=true should work. I normally use a t:saveState to do this, though, and never preserveDataModel. t:saveState id=viewUsersPageUserList value=#{ userBackingBean.users} / On 2/23/07, Mick Knutson [EMAIL PROTECTED] wrote: The only thing I am trying to do is view a list of users. Then be able to click the username, pull up that user in an editable form. On 2/23/07, Mick Knutson [EMAIL PROTECTED] wrote: Because I am using the jsf-acegi in my app, I can't make everything session scoped as it gives me these strange errors so I changed them all back to request. So how should I implement this t:saveState ??? On my userTable.xhtml: x:saveState id=user value=#{userBackingBean.user} / ??? On 2/23/07, Mike Kienenberger [EMAIL PROTECTED] wrote: Not enough information, but my guess is that userBackingBean is request-scoped and not being preserved across requests.An easy test is to make it session-scoped temporarily and see if that works. If it does, a better fix in my opinion is to either use t:saveState on userBackingBean.user (if you don't need to preserve the whole bean) or userBackingBean (if you do). On 2/23/07, Mick Knutson [EMAIL PROTECTED] wrote: Ok, thanks. But now, I have a UserBackingBean.user = manager.getUser(user.getUsername()); then: outcome = Constants.SUCCESS; But the form does not display any of the user variables. Hence I thought I had to bind those variables which was wrong. You help is greatly appreciated by the way... :-) On 2/23/07, Mike Kienenberger [EMAIL PROTECTED] wrote: binding=#{userBackingBean.user.username} is the cause of this error. It's attempting to assign the HtmlInputText component to the value of username. binding is for getting a reference to the component on a
Re: need help editing a row of data.
Solution to this issue (using t:updateActionListener and t:saveState) posted on the previous thread t:datatable with commandLink and parameter On 2/26/07, Mick Knutson [EMAIL PROTECTED] wrote: I also tried this: http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters then I have this method: public String prepareForEdit(){ log.info(++); log.info(++); log.info(++); log.info(++); log.info(UserBackingBean.prepareForEdit (String)); log.info(UserBackingBean.user.username(): + user.getUsername()); String outcome = Constants.FAILURE; try { user = manager.getUser(user.getUsername ()); log.info(++); log.info(user.toString(): + user.toString()); log.info(++); outcome = Constants.EDIT; } catch (Exception e) { outcome = Constants.FAILURE; FacesContext.getCurrentInstance().addMessage(null, new FacesMessage( e.getMessage())); e.printStackTrace(); return(null); } return outcome; } but then when I get redirected to the editUser.xhtml page, the form is blank. I even added: t:saveState id=user value=#{userBackingBean.user} / as all the mangedBean's are request scope but I can't seem to populate the editUser form with data. On 2/26/07, Simon Kitching [EMAIL PROTECTED] wrote: Mick Knutson wrote: tmpUserBean prints the row I was expecting, but now I do not know how to get tmpUserBean in the request and sent back to userDetail.xhtml What do you mean by sent back to userDetail.xhtml? Note that the h:commandLink tag can take an actionListener *attribute* as an alternative to using an f:actionListener child. The attribute form is an EL expression, ie can point to a method on your normal backing bean, which I find far more useful than an independent ActionListener class. Regards, Simon -- --- Thanks, Mick Knutson http://www.baselogic.com http://www.blincmagazine.com http://www.djmick.com http://www.myspace.com/djmick_dot_com http://www.thumpradio.com ---
[ Tobago ] Regarding PopUp's
Hi All, I need to display a popup which is shown when a user places mouse over a link. My case is as such... There would be a link, which on clicked will navigate to a page which has the User Details. Now when he places his mouse over the link, i need to show a popup which has the same details as when shown when he clicks the link. according to wht i know, the popup will be shown only when we click on the link, but not on mouse over. Is this could be done with mouseover function ? Thnx in advance, Regards, Madan __ Yahoo! India Answers: Share what you know. Learn something new http://in.answers.yahoo.com/