Re: [TRINIDAD] Please help with dependent components
Hi Andrew, Thanks for your help, I'll try this asap Regards Jean-Noel On 16 Feb 2010, at 00:24, Andrew Robinson wrote: Option 1) Instead of using entryBean.subProjects to check for disabled, why not, since you are already using component binding, just set the component disabled attribute to true or false based on when it changes. Set it to true in the page and then when you set it in the component, it will remember that state and no longer check the EL. Option 2) Store the disable state in the pageFlowScope Option 3) Use a session scoped bean to store the disabled state Option 4 (JSF 2 only)) Store the disabled state in the viewScope Option 5 (3rd party)) Store the value in a conversation scope provided by a 3rd party library On Mon, Feb 15, 2010 at 1:02 PM, Jean-Noël Colin jn.co...@gmail.com wrote: Andrew, entryBean is indeed in request scope. Indeed, entryBean.subProjects is always null, and I suspected this was related to the 'disabled' attribute. Thus my question is: how can I set the proper value before the decoding is done? When should that be performed? Thanks for your help Jean-Noel On 15 Feb 2010, at 19:03, Andrew Robinson wrote: What scope is entryBean? If entryBean is requestScope, then entryBean.subProjects will be null on each request and would need to be set before the decoding is done, otherwise the 2nd choice will never decode as it will be disabled. If entryBean is not requestScope than you also have a problem as you cannot use component binding with non-request scoped objects. -Andrew On Sun, Feb 14, 2010 at 8:32 AM, Jean-Noël Colin jn.co...@gmail.com wrote: Hi I need to write a simple page with 2 selectOneChoice components, the second being dependent on the first. This means that the second should be disabled as long as a correct value in the first one has not been selected. Also, the items in the second need to be dynamically loaded depending on the content on the first one. I guess this should be easily feasible in Trinidad, but obviously, I must be missing something because I can't get it to work. it seems that the value of the second component never gets properly populated in the bean entry. Also, strangely, in the 'valuechangelistener', the oldvalue is always null, even when a proper value was correctly selected. Also, is it possible to avoid the presence of a 'empty' selectItem by auto-selecting the first valid entry (how can I do that)? Thanks a lot for your help Jean-Noel Colin tr:selectOneChoice id=project label=project binding=#{entryBean.projectSelector} value=#{entryBean.currentLine.projectId} showRequired=true autoSubmit=true unselectedLabel=Select immediate=true valueChangeListener=#{entryBean.projectChangeListener} f:selectItems value=#{globalData.activeprojects} / /tr:selectOneChoice tr:selectOneChoice id=subproject label=sub-project partialTriggers=project binding=#{entryBean.subProjectSelector} value=#{entryBean.currentLine.subProjectId} showRequired=true unselectedLabel=Select disabled=#{empty entryBean.subProjects} f:selectItems value=#{entryBean.subProjects} / /tr:selectOneChoice
[ANN] Release of Apache MyFaces Trinidad's Maven plugins (1.2.12)
Hi, The Apache MyFaces community is pleased to announce its 1.2.12 release of the Apache MyFaces Trinidad Maven2 plugins. These Maven2 plugins have been deployed to the Apache Maven2 repository. They are mirrored by ibiblio as well. release notes: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310661styleName=Htmlversion=12314452 -- Matthias Wessendorf blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf twitter: http://twitter.com/mwessendorf
[ANN] Release of Apache MyFaces Trinidad's Maven plugins (2.0.1)
Hi, The Apache MyFaces community is pleased to announce its 2.0.1 release of the Apache MyFaces Trinidad Maven2 plugins. This release contains support for the new JSF 2.0 related API/metadata. These Maven2 plugins have been deployed to the Apache Maven2 repository and they should be mirrored by ibiblio as well (very soon). release notes: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310661styleName=Htmlversion=12314512 -- Matthias Wessendorf blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf twitter: http://twitter.com/mwessendorf
[Announce] Release of Apache MyFaces Trinidad 2.0.0-alpha-2
The Apache MyFaces Trinidad team is pleased to announce the release of Apache MyFaces Trinidad Core 2.0.0-alpha-2. Apache MyFaces Trinidad 2 is a JavaServer(tm) Faces 2.0 component library. Note: This is the second release of the Apache MyFaces Trinidad 2 series and it is an alpha relases. Apache MyFaces Trinidad Core 2.0.0-alpha-2 is available in both binary and source distributions: * http://myfaces.apache.org/trinidad/download.html Apache MyFaces Trinidad is available in the central Maven repository under Group ID org.apache.myfaces.trinidad. Release Notes: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310661styleName=Htmlversion=12314513 Enjoy! Matthias -- Matthias Wessendorf blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf twitter: http://twitter.com/mwessendorf
[Announce] Release of Apache MyFaces Trinidad 1.0.12
The Apache MyFaces Trinidad team is pleased to announce the release of Apache MyFaces Trinidad Core 1.0.12. Apache MyFaces Trinidad is a JavaServer(tm) Faces 1.1 component library. Trinidad Core 1.0.12 is available in both binary and source distributions: * http://myfaces.apache.org/trinidad/download.html Apache MyFaces Trinidad is available in the central Maven repository under Group ID org.apache.myfaces.trinidad. Release Notes: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310661styleName=Htmlversion=12314137 Enjoy! -- Matthias Wessendorf blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf twitter: http://twitter.com/mwessendorf
[Trinidad] applet viewState
Hi, I have an applet in a trinidad web page like this, next to it is a small tr:form f:verbatim applet code=UploadApplet.class archive=upload/upload-applet.jar width=500 height=200 /applet /f:verbatim tr:form tr:commandButton text=done action=#{myBacking.done}/ /tr:form When I hit the submit buttom in the form after I used the applet about 20 seconds I get a javax.faces.application.ViewExpiredException I checked the form value of input name=javax.faces.ViewState but the number stay's the same. what can I do? thanks
Re: [Trinidad] applet viewState
Hi, If you submit the form immediatly you don't get the ViewExpiredException? Some more infos about your system would also be nice, e.g. what JSF and Trinidad version you are using. Regards, Jakob 2010/2/16 baeschtu baeschtu baesc...@gmail.com Hi, I have an applet in a trinidad web page like this, next to it is a small tr:form f:verbatim applet code=UploadApplet.class archive=upload/upload-applet.jar width=500 height=200 /applet /f:verbatim tr:form tr:commandButton text=done action=#{myBacking.done}/ /tr:form When I hit the submit buttom in the form after I used the applet about 20 seconds I get a javax.faces.application.ViewExpiredException I checked the form value of input name=javax.faces.ViewState but the number stay's the same. what can I do? thanks
Re: [Trinidad] Help with autoSubmit
This looks ok to me. Can you try simplifying the test case, like 1. always have the second selectOneChoice enabled 2. try seeing what immediate does 3. Yes, the projectChangeListener should not be needed. 4. get rid of all fields but the not working selectOneChoice. does that work? Jean-Noël Colin wrote, On 2/12/2010 8:08 AM PT: Hi I've been working with JSF IceFaces, but rather new to MyFaces + Trinidad. And I'm facing a problem with autoSubmit. Basically, I have two selectOneChoice elements (project and subproject), and the second should be disabled until the first one has been selected. In the same form, I also have a few other fields that are marked as required and need some further validation. The problem I have is the following: when I select an item in the first selectOneChoice, the second becomes enabled. So far so good... So I fill in the other fields and click the 'add' button. The problem is that the selected value in the second selectOneChoice (#{entryBean.currentLine.subProjectId}) does not get pushed to the backing bean, while the two others are. I can see that when the addAction method is fired; only projectId and activityId return the right value, subprojectid is always 0. The first selectOneChoice is marked as immediate to bypass the validation controls. I have also attached a valueChangeListener (projectChangeListener) to it so that the value gets stored in the backing bean (btw, why isn't that done automatically?) Am I doing something wrong or is this a know issue? I don't think my case is really unusual... Thanks a lot for your help Jean-Noël Colin public String addAction() { System.out.println(Add action called); System.out.println(currentLine.getProjectId()); System.out.println(currentLine.getSubProjectId()); System.out.println(currentLine.getActivityId()); return null; } public void projectChangeListener(ValueChangeEvent event) { System.out.println(new project: + event.getOldValue() + : + event.getNewValue()); System.out.println(currentLine.getSubProjectId()); currentLine.setProjectId((Long) event.getNewValue()); tr:panelHeader text=Hello world tr:panelGroupLayout tr:chooseDate id=dateChooser/tr:chooseDate tr:separator / tr:panelFormLayout tr:inputDate id=dateField chooseId=dateChooser label=Day value=#{entryBean.currentLine.lineDate}/tr:inputDate tr:inputText label=#hours columns=3 required=true showRequired=true value=#{entryBean.currentLine.lineHours} /tr:inputText tr:selectOneChoice id=project label=project value=#{entryBean.currentLine.projectId} required=true showRequired=true autoSubmit=true unselectedLabel=Select immediate=true valueChangeListener=#{entryBean.projectChangeListener} f:selectItems value=#{globalData.activeprojects} / /tr:selectOneChoice tr:selectOneChoice id=subproject label=sub-project partialTriggers=project value=#{entryBean.currentLine.subProjectId} required=true showRequired=true unselectedLabel=Select disabled=#{entryBean.currentLine.projectId eq 0} f:selectItems value=#{globalData.activeprojects} / /tr:selectOneChoice tr:outputText value=#{entryBean.currentLine.projectId} partialTriggers=project / tr:selectOneChoice label=activity value=#{entryBean.currentLine.activityId} required=true showRequired=true unselectedLabel=Select f:selectItems value=#{globalData.activities} / /tr:selectOneChoice tr:inputText label=Comment required=true showRequired=true /tr:inputText tr:panelButtonBar halign=center tr:commandButton text=Add action=#{entryBean.addAction} / tr:resetButton text=Cancel / /tr:panelButtonBar
Re: [Trinidad] Help with autoSubmit
Oh, I see you probably got your answer in your other email post. Jeanne Waldman wrote, On 2/16/2010 10:35 AM PT: This looks ok to me. Can you try simplifying the test case, like 1. always have the second selectOneChoice enabled 2. try seeing what immediate does 3. Yes, the projectChangeListener should not be needed. 4. get rid of all fields but the not working selectOneChoice. does that work? Jean-Noël Colin wrote, On 2/12/2010 8:08 AM PT: Hi I've been working with JSF IceFaces, but rather new to MyFaces + Trinidad. And I'm facing a problem with autoSubmit. Basically, I have two selectOneChoice elements (project and subproject), and the second should be disabled until the first one has been selected. In the same form, I also have a few other fields that are marked as required and need some further validation. The problem I have is the following: when I select an item in the first selectOneChoice, the second becomes enabled. So far so good... So I fill in the other fields and click the 'add' button. The problem is that the selected value in the second selectOneChoice (#{entryBean.currentLine.subProjectId}) does not get pushed to the backing bean, while the two others are. I can see that when the addAction method is fired; only projectId and activityId return the right value, subprojectid is always 0. The first selectOneChoice is marked as immediate to bypass the validation controls. I have also attached a valueChangeListener (projectChangeListener) to it so that the value gets stored in the backing bean (btw, why isn't that done automatically?) Am I doing something wrong or is this a know issue? I don't think my case is really unusual... Thanks a lot for your help Jean-Noël Colin public String addAction() { System.out.println(Add action called); System.out.println(currentLine.getProjectId()); System.out.println(currentLine.getSubProjectId()); System.out.println(currentLine.getActivityId()); return null; } public void projectChangeListener(ValueChangeEvent event) { System.out.println(new project: + event.getOldValue() + : + event.getNewValue()); System.out.println(currentLine.getSubProjectId()); currentLine.setProjectId((Long) event.getNewValue()); tr:panelHeader text=Hello world tr:panelGroupLayout tr:chooseDate id=dateChooser/tr:chooseDate tr:separator / tr:panelFormLayout tr:inputDate id=dateField chooseId=dateChooser label=Day value=#{entryBean.currentLine.lineDate}/tr:inputDate tr:inputText label=#hours columns=3 required=true showRequired=true value=#{entryBean.currentLine.lineHours} /tr:inputText tr:selectOneChoice id=project label=project value=#{entryBean.currentLine.projectId} required=true showRequired=true autoSubmit=true unselectedLabel=Select immediate=true valueChangeListener=#{entryBean.projectChangeListener} f:selectItems value=#{globalData.activeprojects} / /tr:selectOneChoice tr:selectOneChoice id=subproject label=sub-project partialTriggers=project value=#{entryBean.currentLine.subProjectId} required=true showRequired=true unselectedLabel=Select disabled=#{entryBean.currentLine.projectId eq 0} f:selectItems value=#{globalData.activeprojects} / /tr:selectOneChoice tr:outputText value=#{entryBean.currentLine.projectId} partialTriggers=project / tr:selectOneChoice label=activity value=#{entryBean.currentLine.activityId} required=true showRequired=true unselectedLabel=Select f:selectItems value=#{globalData.activities} / /tr:selectOneChoice tr:inputText label=Comment required=true showRequired=true /tr:inputText tr:panelButtonBar halign=center tr:commandButton text=Add action=#{entryBean.addAction} / tr:resetButton text=Cancel / /tr:panelButtonBar /tr:panelFormLayout /tr:panelGroupLayout /tr:panelHeader
Re: [Trinidad] applet viewState
Hi Jakob, yes when I submit the form immediatly I don't get the ViewExpiredException. I use this versions: Myfaces 1.2.8 Trinidad 1.2.5 Regards Bastian 2010/2/16 Jakob Korherr jakob.korh...@gmail.com Hi, If you submit the form immediatly you don't get the ViewExpiredException? Some more infos about your system would also be nice, e.g. what JSF and Trinidad version you are using. Regards, Jakob 2010/2/16 baeschtu baeschtu baesc...@gmail.com Hi, I have an applet in a trinidad web page like this, next to it is a small tr:form f:verbatim applet code=UploadApplet.class archive=upload/upload-applet.jar width=500 height=200 /applet /f:verbatim tr:form tr:commandButton text=done action=#{myBacking.done}/ /tr:form When I hit the submit buttom in the form after I used the applet about 20 seconds I get a javax.faces.application.ViewExpiredException I checked the form value of input name=javax.faces.ViewState but the number stay's the same. what can I do? thanks
Re: [Trinidad] applet viewState
OK. The problem seems to have to do something with problems on state-saving. This is the only place where a ViewExpiredException is thrown. Are you using client-side state saving? have you tried using server-side state saving? Regards, Jakob 2010/2/16 baeschtu baeschtu baesc...@gmail.com Hi Jakob, yes when I submit the form immediatly I don't get the ViewExpiredException. I use this versions: Myfaces 1.2.8 Trinidad 1.2.5 Regards Bastian 2010/2/16 Jakob Korherr jakob.korh...@gmail.com Hi, If you submit the form immediatly you don't get the ViewExpiredException? Some more infos about your system would also be nice, e.g. what JSF and Trinidad version you are using. Regards, Jakob 2010/2/16 baeschtu baeschtu baesc...@gmail.com Hi, I have an applet in a trinidad web page like this, next to it is a small tr:form f:verbatim applet code=UploadApplet.class archive=upload/upload-applet.jar width=500 height=200 /applet /f:verbatim tr:form tr:commandButton text=done action=#{myBacking.done}/ /tr:form When I hit the submit buttom in the form after I used the applet about 20 seconds I get a javax.faces.application.ViewExpiredException I checked the form value of input name=javax.faces.ViewState but the number stay's the same. what can I do? thanks
Re: [Trinidad] applet viewState
I just have seen this error log in the catalina.out. I guess this happens when I access a lib on the file system. 20:33:36,106 WARN FacesServlet:164 - Someone is trying to access a secure resource : /META-INF/services/javax.xml.parsers.DocumentBuilderFactory remote address is 127.0.0.1 remote host is 127.0.0.1 remote user is null request URI is /upload-webapp/faces/META-INF/services/javax.xml.parsers.DocumentBuilderFactory 2010/2/16 Jakob Korherr jakob.korh...@gmail.com OK. The problem seems to have to do something with problems on state-saving. This is the only place where a ViewExpiredException is thrown. Are you using client-side state saving? have you tried using server-side state saving? Regards, Jakob 2010/2/16 baeschtu baeschtu baesc...@gmail.com Hi Jakob, yes when I submit the form immediatly I don't get the ViewExpiredException. I use this versions: Myfaces 1.2.8 Trinidad 1.2.5 Regards Bastian 2010/2/16 Jakob Korherr jakob.korh...@gmail.com Hi, If you submit the form immediatly you don't get the ViewExpiredException? Some more infos about your system would also be nice, e.g. what JSF and Trinidad version you are using. Regards, Jakob 2010/2/16 baeschtu baeschtu baesc...@gmail.com Hi, I have an applet in a trinidad web page like this, next to it is a small tr:form f:verbatim applet code=UploadApplet.class archive=upload/upload-applet.jar width=500 height=200 /applet /f:verbatim tr:form tr:commandButton text=done action=#{myBacking.done}/ /tr:form When I hit the submit buttom in the form after I used the applet about 20 seconds I get a javax.faces.application.ViewExpiredException I checked the form value of input name=javax.faces.ViewState but the number stay's the same. what can I do? thanks
Re: [Trinidad] applet viewState
Does your applet access your webapp? 2010/2/16 baeschtu baeschtu baesc...@gmail.com I just have seen this error log in the catalina.out. I guess this happens when I access a lib on the file system. 20:33:36,106 WARN FacesServlet:164 - Someone is trying to access a secure resource : /META-INF/services/javax.xml.parsers.DocumentBuilderFactory remote address is 127.0.0.1 remote host is 127.0.0.1 remote user is null request URI is /upload-webapp/faces/META-INF/services/javax.xml.parsers.DocumentBuilderFactory 2010/2/16 Jakob Korherr jakob.korh...@gmail.com OK. The problem seems to have to do something with problems on state-saving. This is the only place where a ViewExpiredException is thrown. Are you using client-side state saving? have you tried using server-side state saving? Regards, Jakob 2010/2/16 baeschtu baeschtu baesc...@gmail.com Hi Jakob, yes when I submit the form immediatly I don't get the ViewExpiredException. I use this versions: Myfaces 1.2.8 Trinidad 1.2.5 Regards Bastian 2010/2/16 Jakob Korherr jakob.korh...@gmail.com Hi, If you submit the form immediatly you don't get the ViewExpiredException? Some more infos about your system would also be nice, e.g. what JSF and Trinidad version you are using. Regards, Jakob 2010/2/16 baeschtu baeschtu baesc...@gmail.com Hi, I have an applet in a trinidad web page like this, next to it is a small tr:form f:verbatim applet code=UploadApplet.class archive=upload/upload-applet.jar width=500 height=200 /applet /f:verbatim tr:form tr:commandButton text=done action=#{myBacking.done}/ /tr:form When I hit the submit buttom in the form after I used the applet about 20 seconds I get a javax.faces.application.ViewExpiredException I checked the form value of input name=javax.faces.ViewState but the number stay's the same. what can I do? thanks
[Trinidad] Backing Bean Caching issue
I have two myfaces pages with a backing bean each. Both of them have a spring service injected to get access to the hibernate dao's. They are related 1-N So I have a f:selectItems combobox in one of them served by a method like this in the backinbean. private ListEntity entities; .. public UISelectItems getEntityList() { entityList = new UISelectItems(); entities = getEntities(); Object[] values = new Object[entities.size()]; int count = 0; for (Entity e : entities) { values[count] = new SelectItem(e.getId(), e.getName()); count++; } entityList.setValue(values); return entityList; } So the problem is, when I add an Entity on the other page and return to the page with the combobox. The newly added Entity does not show up in the combobox. So I assume I get a cached version from the backing bean or the items are still cached in the viewState. thanks Bastian