[Trinidad] Trouble updating Page Flow Scope during Render Response
Hi... I have an application that is using the Page Flow Scope a bunch. In many of our beans' getXyz() methods, we are fetching some data and putting it in the Flow Scope for later requests to use. A couple of additions to one of our pages, which seemed to have nothing to do with each other, ended up giving me some problems: adding a tr:inputText value=#{myBean.theValue} / component whose getTheValue() method put something in the Flow Scope, a tr:inputDate / component, and a button that would open a dialog. With that combination, the dialog opened fine, but I got a NullPointerException when trying to close the dialog and return to the parent. Long story made short, I tracked the problem down to the fact that I was trying to put something into the Flow Scope during the Render Response phase. I finally found this thanks this really good comment on the PageFlowScopeMap._detachIfNeeded() method. It was a good comment because it led me to the explanation of what was happening (the Flow Scope tokens were getting confused, which caused problems when trying to pop the Flow Scope on return to the parent page)... but I'm still unsure about *why* it's necessary to detach the Flow Scope if we try to mutate it during Render Response. Could anybody please help me understand the need for this so I can have a better idea of how to avoid this in the future?? Thanks... Dave The information transmitted herewith is sensitive information of Chordiant Software or its customers and is intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.
Which component triggered request
When in a PhaseListener, or I suppose at any point during the request, is it possible to know which component triggered the request? Even just a clientId would suit my needs. Thanks... Dave The information transmitted herewith is sensitive information of Chordiant Software or its customers and is intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.
Checking for navigation rule
Hi everybody. Is there an easy way for an action method to check for the existence of a navigation rule before returning the outcome String? I know that the normal functionality is that, if you return an outcome that does not match to an existing navigation rule, the same view will be shown again. But I'd like to check for that nav rule before returning from the action method so I can go do something else instead of just showing the same page again. I've done something like the following, but this doesn't seem to be the most efficient since I'd be creating the ViewRoot once in handleNavigation() and then again when I return the outcome. public String actionMethod() { String outcome = someOutcome; UIViewRoot oldView = facesContext.getViewRoot(); facesContext.getApplication().getNavigationHandler().handleNavigation( facesContext, null, outcome ); if( facesContext.getViewRoot() == oldRoot ) { // No nav rule found, do something else... outcome = getOutcomeFromElsewhere(); } return outcome; } Any alternatives? Thanks... Dave The information transmitted herewith is sensitive information of Chordiant Software or its customers and is intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.
RE: Checking for navigation rule
It seems as though I'd be looking at having my own extended NavigationHandler. I was hoping to avoid that... didn't know if there was something else out there that I was just missing. Thanks guys. Dave -Original Message- From: Mike Kienenberger [mailto:[EMAIL PROTECTED] Sent: Friday, August 31, 2007 11:31 AM To: MyFaces Discussion Subject: Re: Checking for navigation rule This is complete guesswork, but what about extending navigationHandler and installing a custom navigation handler? You could then make the default behavior of your navigation handler to get outcomes from somewhere else, perhaps by setting navigationHandler.setFallBackOutcomeCallback(Method method), or perhaps caching the ViewRoot if you query for whether there's an outcome and reusing it on the real invocation. On 8/31/07, David Brunette [EMAIL PROTECTED] wrote: Hi everybody. Is there an easy way for an action method to check for the existence of a navigation rule before returning the outcome String? I know that the normal functionality is that, if you return an outcome that does not match to an existing navigation rule, the same view will be shown again. But I'd like to check for that nav rule before returning from the action method so I can go do something else instead of just showing the same page again. I've done something like the following, but this doesn't seem to be the most efficient since I'd be creating the ViewRoot once in handleNavigation() and then again when I return the outcome. public String actionMethod() { String outcome = someOutcome; UIViewRoot oldView = facesContext.getViewRoot(); facesContext.getApplication().getNavigationHandler().handleNavigation( facesContext, null, outcome ); if( facesContext.getViewRoot() == oldRoot ) { // No nav rule found, do something else... outcome = getOutcomeFromElsewhere(); } return outcome; } Any alternatives? Thanks... Dave The information transmitted herewith is sensitive information of Chordiant Software or its customers and is intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer. The information transmitted herewith is sensitive information of Chordiant Software or its customers and is intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.
RE: [Trinidad] Upgrading to 1.0.2
Regarding the problem with PPR, I had a similar problem with that soon after the PPR stuff was changed for 1.0.2 (see topic in the dev list named [Trinidad] AJAX PPR - Invalid PPR Response error). The problem only happened when using Weblogic and JSP. When using Weblogic with Facelets or Tomcat and either JSP or Facelets, PPR works fine. The problem was tracked down to the contentType being wrong for the response... it needs to be text/xml, but it was being changed to text/html somewhere. I wasn't able to track down a solution for this and, since it works with Facelets (which I'm using), it unfortunately fell down my priority list. Not sure if this has anything to do with your problem, but maybe it'll help... Dave From: Perkins, Nate-P63196 [mailto:[EMAIL PROTECTED] Sent: Wed 8/22/2007 3:31 PM To: MyFaces Discussion Subject: [Trinidad] Upgrading to 1.0.2 Hi, I'm testing my project with 1.0.2 and I am having several issues. 1. No PPR activity works, I get a javascript error Invalid PPR response any time I try to submit a PPR action Can anyone give me a clue as to what's wrong and how to fix it? 2. My skin no longer works, it seems that a few of the selectors have changed, namely: a) the panelHeader is rendering with af_messages_header class b) the panelBox has lost its background, it seems like there is no longer a distinction between panelBox transparent, light, etc. I looked at the JIRA issues attached to the 1.0.2 release and did not see an obvious item that applied to either of these discoveriescan anyone verify exactly what it was that changed for each of these? Nate Perkins 480-441-3667 [EMAIL PROTECTED] This email message is for the sole use of the intended recipient(s) and may contain GDC4S confidential or privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not an intended recipient, please contact the sender by reply email and destroy all copies of the original message. The information transmitted herewith is sensitive information of Chordiant Software or its customers and is intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer. winmail.dat
RE: PPR - Update an inputText dont work
Just to close out this discussion (in case anybody else is listening to the thread)... I've come across a way to reset the values of inputText components that are in a table. Turns out that it's actually pretty simple... very similar to some things discussed below. It's just a matter of looping through each row of the table and using the myTable.findComponent( inputTextId ) to get the components in the table. Once you've got the component, you can simply reset the values for that inputText the way it is described below. UIXCollection collection = getMyTable(); int size = collection.getRowCount(); for( int index = 0 ; index size ; index++ ) { collection.setRowKey( Integer.valueOf( index ) ); _resetEditableValues( collection.findComponent( inputTextId ) ); } From: David Brunette [mailto:[EMAIL PROTECTED] Sent: Monday, July 16, 2007 6:14 PM To: MyFaces Discussion Subject: RE: PPR - Update an inputText dont work Thanks for the suggestion. But unfortunately it still did not work for me. For an inputText on its own, it worked fine, but the values in my table still did not reset. While trying a bunch of things, I noticed that this is only happening if immediate=true is set on the commandButton. That seems like an odd thing to me. Can somebody explain why this is only happening if immediate=true?? Maybe if I understood that bit a little more, I could come up with a way to work with this. Dave From: MichaĆ 'Gandalf' Stawicki [mailto:[EMAIL PROTECTED] Sent: Mon 7/16/2007 12:57 PM To: MyFaces Discussion Subject: Re: PPR - Update an inputText dont work In my case, I just put fields in form named objectDetForm and when I need to reset them: private void resetFields() { UIComponent c = FacesContext.getCurrentInstance().getViewRoot().findComponent(objectDetForm); if(c != null c.getParent() != null) c.getParent().getChildren().remove(c); } It's dirty, but for me it works On 16/07/07, David Brunette [EMAIL PROTECTED] wrote: Hello. I am having trouble with this as well. But, the difference in my situation is that the inputText components that I am trying to reset are in a table. I'm having trouble getting a hold of those components in the table so I can reset the values. I've tried a couple things, such as binding the table to my bean and then trying to loop through all of its children (recursively) to find the inputTexts... but that didn't solve the issue for me. Any idea on what I can do with the inputText components in the table?? Thanks... Dave From: Martin Marinschek [mailto:[EMAIL PROTECTED] Sent: Thursday, July 12, 2007 12:20 PM To: MyFaces Discussion Subject: Re: PPR - Update an inputText dont work Hi Ariel, you'll have to clean out the value of the input-text - the problem that you are seeing is that JSF takes the current value in the inputText component, and sees this as more important than the backing bean value. so you'll have to bind your inputText to your backing bean (using binding=#{myBean.myInputText}, and a getter/setter pair getMyInputText / setMyInputText in your backing bean) and then call: myInputText.setSubmittedValue(null); myInputText.setValue(null); myInputText.setLocalValueSet(false); with this, your inputText will reread the value from the backing bean! regards, Martin On 7/12/07, Ariel Di Mattia [EMAIL PROTECTED] wrote: Hi all, I am having some problems with PPR. When I try to update an inputText, it's simply do nothing (no errors or warnings). But, if I put the same partialTriggers in other component (i.e. outputFormatted) with same backing bean, all works fine. Here is my code: f:view tr:document title=#{title.applicationName} t:div styleClass=mainPanel tr:form id=form tr:commandButton id=pSub_button immediate=true partialSubmit=true text=Update actionListener=#{newAgent.editContact} /tr:commandButton tr:panelLabelAndMessage label=OUTPUT FORMATTED: tr:outputFormatted id=cmdTarget1 partialTriggers=pSub_button styleUsage=instruction value=#{newAgent.nombreContacto } /tr:outputFormatted /tr:panelLabelAndMessage tr:panelLabelAndMessage label=INPUT TEXT: tr:inputText id=cmdTarget3 partialTriggers=pSub_button value=#{newAgent.nombreContacto} /tr:inputText /tr:panelLabelAndMessage /tr:form /t:div /tr:document /f:view And backing bean
RE: PPR - Update an inputText dont work
Hello. I am having trouble with this as well. But, the difference in my situation is that the inputText components that I am trying to reset are in a table. I'm having trouble getting a hold of those components in the table so I can reset the values. I've tried a couple things, such as binding the table to my bean and then trying to loop through all of its children (recursively) to find the inputTexts... but that didn't solve the issue for me. Any idea on what I can do with the inputText components in the table?? Thanks... Dave From: Martin Marinschek [mailto:[EMAIL PROTECTED] Sent: Thursday, July 12, 2007 12:20 PM To: MyFaces Discussion Subject: Re: PPR - Update an inputText dont work Hi Ariel, you'll have to clean out the value of the input-text - the problem that you are seeing is that JSF takes the current value in the inputText component, and sees this as more important than the backing bean value. so you'll have to bind your inputText to your backing bean (using binding=#{myBean.myInputText}, and a getter/setter pair getMyInputText / setMyInputText in your backing bean) and then call: myInputText.setSubmittedValue(null); myInputText.setValue(null); myInputText.setLocalValueSet(false); with this, your inputText will reread the value from the backing bean! regards, Martin On 7/12/07, Ariel Di Mattia [EMAIL PROTECTED] wrote: Hi all, I am having some problems with PPR. When I try to update an inputText, it's simply do nothing (no errors or warnings). But, if I put the same partialTriggers in other component (i.e. outputFormatted) with same backing bean, all works fine. Here is my code: f:view tr:document title=#{title.applicationName} t:div styleClass=mainPanel tr:form id=form tr:commandButton id=pSub_button immediate=true partialSubmit=true text=Update actionListener=#{newAgent.editContact} /tr:commandButton tr:panelLabelAndMessage label=OUTPUT FORMATTED: tr:outputFormatted id=cmdTarget1 partialTriggers=pSub_button styleUsage=instruction value=#{newAgent.nombreContacto } /tr:outputFormatted /tr:panelLabelAndMessage tr:panelLabelAndMessage label=INPUT TEXT: tr:inputText id=cmdTarget3 partialTriggers=pSub_button value=#{newAgent.nombreContacto} /tr:inputText /tr:panelLabelAndMessage /tr:form /t:div /tr:document /f:view And backing bean method for actionListener: public void editContact(ActionEvent event) { this.setNombreContacto(NOMBRE PPR); } Any ideas?. Is possible to do an inputText update via PPR?. I think that yes, but...my method seems to be incorrect : Thanks for all!!!. Ariel. -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces The information transmitted herewith is sensitive information of Chordiant Software or its customers and is intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.
RE: PPR - Update an inputText dont work
Thanks for the suggestion. But unfortunately it still did not work for me. For an inputText on its own, it worked fine, but the values in my table still did not reset. While trying a bunch of things, I noticed that this is only happening if immediate=true is set on the commandButton. That seems like an odd thing to me. Can somebody explain why this is only happening if immediate=true?? Maybe if I understood that bit a little more, I could come up with a way to work with this. Dave From: Michal 'Gandalf' Stawicki [mailto:[EMAIL PROTECTED] Sent: Mon 7/16/2007 12:57 PM To: MyFaces Discussion Subject: Re: PPR - Update an inputText dont work In my case, I just put fields in form named objectDetForm and when I need to reset them: private void resetFields() { UIComponent c = FacesContext.getCurrentInstance().getViewRoot().findComponent(objectDetForm); if(c != null c.getParent() != null) c.getParent().getChildren().remove(c); } It's dirty, but for me it works On 16/07/07, David Brunette [EMAIL PROTECTED] wrote: Hello. I am having trouble with this as well. But, the difference in my situation is that the inputText components that I am trying to reset are in a table. I'm having trouble getting a hold of those components in the table so I can reset the values. I've tried a couple things, such as binding the table to my bean and then trying to loop through all of its children (recursively) to find the inputTexts... but that didn't solve the issue for me. Any idea on what I can do with the inputText components in the table?? Thanks... Dave From: Martin Marinschek [mailto:[EMAIL PROTECTED] Sent: Thursday, July 12, 2007 12:20 PM To: MyFaces Discussion Subject: Re: PPR - Update an inputText dont work Hi Ariel, you'll have to clean out the value of the input-text - the problem that you are seeing is that JSF takes the current value in the inputText component, and sees this as more important than the backing bean value. so you'll have to bind your inputText to your backing bean (using binding=#{myBean.myInputText}, and a getter/setter pair getMyInputText / setMyInputText in your backing bean) and then call: myInputText.setSubmittedValue(null); myInputText.setValue(null); myInputText.setLocalValueSet(false); with this, your inputText will reread the value from the backing bean! regards, Martin On 7/12/07, Ariel Di Mattia [EMAIL PROTECTED] wrote: Hi all, I am having some problems with PPR. When I try to update an inputText, it's simply do nothing (no errors or warnings). But, if I put the same partialTriggers in other component (i.e. outputFormatted) with same backing bean, all works fine. Here is my code: f:view tr:document title=#{title.applicationName} t:div styleClass=mainPanel tr:form id=form tr:commandButton id=pSub_button immediate=true partialSubmit=true text=Update actionListener=#{newAgent.editContact} /tr:commandButton tr:panelLabelAndMessage label=OUTPUT FORMATTED: tr:outputFormatted id=cmdTarget1 partialTriggers=pSub_button styleUsage=instruction value=#{newAgent.nombreContacto } /tr:outputFormatted /tr:panelLabelAndMessage tr:panelLabelAndMessage label=INPUT TEXT: tr:inputText id=cmdTarget3 partialTriggers=pSub_button value=#{newAgent.nombreContacto} /tr:inputText /tr:panelLabelAndMessage /tr:form /t:div /tr:document /f:view And backing bean method for actionListener: public void editContact(ActionEvent event) { this.setNombreContacto(NOMBRE PPR); } Any ideas?. Is possible to do an inputText update via PPR?. I think that yes, but...my method seems to be incorrect : Thanks for all!!!. Ariel. -- http://www.irian.at http://www.irian.at/ Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces The information transmitted herewith is sensitive information of Chordiant Software or its customers and is intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete