|
View:
New views
9 Messages
—
Rating Filter:
Alert me
|
|
|
[jira] Created: (MYFACES-749) inputText refresh probleminputText refresh problem
------------------------- Key: MYFACES-749 URL: http://issues.apache.org/jira/browse/MYFACES-749 Project: MyFaces Type: Bug Components: General Versions: 1.1.0, 1.0.9m9 Environment: Windows XP, Tomcat5.x Reporter: JagMohan I have a drop down LEVELS with an valueChangeListener and an inputText field that is supposed to change when the drop down is changed. The inputText field is bound to a simple String object. When the value of the drop down changes, request submits and upon processing the value of the backing bean changes. when comes to UI, its not showing the changed value in the <h:inputText> field, but its showing the updated value in <h:outputText> field. REFERENCES --------------------- <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <h:selectOneMenu id="SELECTlevel" immediate="true" value="#{irisRequestQueueBean.currentRequest.level}" disabled="#{empty irisRequestQueueBean.levels}" valueChangeListener="#{irisRequestQueueBean.changedLevel}" onchange="this.form.submit( );"> <f:selectItems value="#{irisRequestQueueBean.levels}" /> <j4j:idProxy id="levelId" /> </h:selectOneMenu> upon changing the level, backing bean value changes. but the below inputText not showing the updated value. but outputText is showing the correct value. <h:inputText id="checked" size="30" value="#{irisRequestQueueBean.currentRequest.title}"> </h:inputText> <h:outputText value="(#{irisRequestQueueBean.currentRequest.title})"/> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
|
[jira] Commented: (MYFACES-749) inputText refresh problem [ http://issues.apache.org/jira/browse/MYFACES-749?page=comments#action_12355869 ]
Mike Kienenberger commented on MYFACES-749: ------------------------------------------- The short answer is that this is probably not a bug. If you remove the immediate="true" field, you should see the behavor you expect. If you have more questions about why this is (it's complicated but boils down to short-circuiting the JSF lifecyle and skipping the model update phase), ask on the myfaces-users mailing list. I just posted a topic to a similar question that will answer most, if not all of your questions about it. Message-ID: <8f985b960510250824x6976dc5bx7e195ed464dcdd48@...> Date: Tue, 25 Oct 2005 11:24:20 -0400 From: Mike Kienenberger <mkienenb@...> To: MyFaces Discussion <users@...> Subject: Re: valueChangeListener - inputText - Which method is correct? > inputText refresh problem > ------------------------- > > Key: MYFACES-749 > URL: http://issues.apache.org/jira/browse/MYFACES-749 > Project: MyFaces > Type: Bug > Components: General > Versions: 1.1.0, 1.0.9m9 > Environment: Windows XP, Tomcat5.x > Reporter: JagMohan > > I have a drop down LEVELS with an valueChangeListener and an inputText field that is supposed to change when the drop down is changed. The inputText field is bound to a simple String object. > When the value of the drop down changes, request submits and upon processing the value of the backing bean changes. when comes to UI, its not showing the changed value in the <h:inputText> field, but its showing the updated value in <h:outputText> field. > REFERENCES > --------------------- > <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> > <h:selectOneMenu id="SELECTlevel" > immediate="true" > value="#{irisRequestQueueBean.currentRequest.level}" > disabled="#{empty irisRequestQueueBean.levels}" > valueChangeListener="#{irisRequestQueueBean.changedLevel}" > onchange="this.form.submit( );"> > <f:selectItems value="#{irisRequestQueueBean.levels}" /> > <j4j:idProxy id="levelId" /> > </h:selectOneMenu> > upon changing the level, backing bean value changes. but the below inputText not showing the updated value. but outputText is showing the correct value. > <h:inputText id="checked" size="30" value="#{irisRequestQueueBean.currentRequest.title}"> > </h:inputText> > <h:outputText value="(#{irisRequestQueueBean.currentRequest.title})"/> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
|
[jira] Commented: (MYFACES-749) inputText refresh problem [ http://issues.apache.org/jira/browse/MYFACES-749?page=comments#action_12355884 ]
JagMohan commented on MYFACES-749: ---------------------------------- Thanks Mike. I have tried by removing immediate="true". But still the same. But immediate="true" is there for some other select boxes at the start of the page like Division, Group, Dept. I have gone thru the mailing list. But found the same. Also I tried using binding method and used setValue method of UIInputText in the backing bean, but still the same. Regards - Jag > inputText refresh problem > ------------------------- > > Key: MYFACES-749 > URL: http://issues.apache.org/jira/browse/MYFACES-749 > Project: MyFaces > Type: Bug > Components: General > Versions: 1.1.0, 1.0.9m9 > Environment: Windows XP, Tomcat5.x > Reporter: JagMohan > > I have a drop down LEVELS with an valueChangeListener and an inputText field that is supposed to change when the drop down is changed. The inputText field is bound to a simple String object. > When the value of the drop down changes, request submits and upon processing the value of the backing bean changes. when comes to UI, its not showing the changed value in the <h:inputText> field, but its showing the updated value in <h:outputText> field. > REFERENCES > --------------------- > <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> > <h:selectOneMenu id="SELECTlevel" > immediate="true" > value="#{irisRequestQueueBean.currentRequest.level}" > disabled="#{empty irisRequestQueueBean.levels}" > valueChangeListener="#{irisRequestQueueBean.changedLevel}" > onchange="this.form.submit( );"> > <f:selectItems value="#{irisRequestQueueBean.levels}" /> > <j4j:idProxy id="levelId" /> > </h:selectOneMenu> > upon changing the level, backing bean value changes. but the below inputText not showing the updated value. but outputText is showing the correct value. > <h:inputText id="checked" size="30" value="#{irisRequestQueueBean.currentRequest.title}"> > </h:inputText> > <h:outputText value="(#{irisRequestQueueBean.currentRequest.title})"/> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
|
[jira] Commented: (MYFACES-749) inputText refresh problem [ http://issues.apache.org/jira/browse/MYFACES-749?page=comments#action_12355887 ]
Mike Kienenberger commented on MYFACES-749: ------------------------------------------- As I stated in the message posted to the list, the behavior you are trying to perform is very hard in JSF. The behavior you're seeing is unlikely to be a bug, though. Using "immediate" is mutually-exclusive with working with updated-models. immediate is only useful for trivial things like implementing cancel buttons. I also need to update selection lists on my page when other selection lists change without triggering validation problems. That's why I'm writing the OptionalValidationFramework. to get around these problems. http://wiki.apache.org/myfaces/OptionalValidationFramework. The only way you'll be able to demonstrate that this is a bug is to remove everything but selectOneMenu, inputText, and outputText from the page and show that it fails to work without any "immediate=true" attributes on the page. If you can get it to this point and still show the problem, post a simplified example of your problem to this issue, and someone will take a look (faces-config, jsp page, backing bean code). Otherwise, you can ask for help on determining a workaround to your situation by asking on the myfaces-user mailing list. I probably won't respond here again unless you've demonstrated it's a bug. > inputText refresh problem > ------------------------- > > Key: MYFACES-749 > URL: http://issues.apache.org/jira/browse/MYFACES-749 > Project: MyFaces > Type: Bug > Components: General > Versions: 1.1.0, 1.0.9m9 > Environment: Windows XP, Tomcat5.x > Reporter: JagMohan > > I have a drop down LEVELS with an valueChangeListener and an inputText field that is supposed to change when the drop down is changed. The inputText field is bound to a simple String object. > When the value of the drop down changes, request submits and upon processing the value of the backing bean changes. when comes to UI, its not showing the changed value in the <h:inputText> field, but its showing the updated value in <h:outputText> field. > REFERENCES > --------------------- > <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> > <h:selectOneMenu id="SELECTlevel" > immediate="true" > value="#{irisRequestQueueBean.currentRequest.level}" > disabled="#{empty irisRequestQueueBean.levels}" > valueChangeListener="#{irisRequestQueueBean.changedLevel}" > onchange="this.form.submit( );"> > <f:selectItems value="#{irisRequestQueueBean.levels}" /> > <j4j:idProxy id="levelId" /> > </h:selectOneMenu> > upon changing the level, backing bean value changes. but the below inputText not showing the updated value. but outputText is showing the correct value. > <h:inputText id="checked" size="30" value="#{irisRequestQueueBean.currentRequest.title}"> > </h:inputText> > <h:outputText value="(#{irisRequestQueueBean.currentRequest.title})"/> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
|
[jira] Commented: (MYFACES-749) inputText refresh problem [ http://issues.apache.org/jira/browse/MYFACES-749?page=comments#action_12355972 ]
markus willinger commented on MYFACES-749: ------------------------------------------ We have nearly the same problem (myfaces 1.0.9): We have a <x:dataTable> with some <h:commandLink> tags. By clicking on this <h:commandLink> tags, we take the datas (user datas) out of the DataModel (processing in the backing bean) an put this datas into <h:inputText required="true" id="Last_Name" value="#{userHandlingBackingBean._userObj._lastName}"> (for example) located in the same view and in the same form. Inside of this <h:inputText > tags we have validators, which validate, that these fields are not empty. Everything is fine. But when I left one textField empty, the validator brings up the error message. That's ok. But from now on, all the INPUTTEXT fields remain the OLD datas - although I click on the the next <h:commandLink> that shall display the new users preferences. This not wanted effect occurs only on <h:inputText > tags. The <h:outputText > tags are working like they want to do -> they "refresh" their texts. I've tried all that stuff posted on the familiar bug reports like deleting the immediate="true" property of the <h:commandLink> tag or of the <h:inputText > tag and so on. But nothing works! What we want is: WHENEVER clicking on the <h:commandLink> the <h:inputText > get the datas out of the <x:dataTable> (dataModel) - EVEN when a validator has was previously activated. Question: Is this a bug? I have debugged the system with eclipse and I found, that the user object, that is mapped to these <h:inputText > tags has the right datas but the <h:inputText > fields don't show these datas although they are mapped with the users attributes. I have found a pseudo solution: When clicking on <h:commandLink> the system has to do a whole redirect to the same jsf-site. But there must be another solution. In fact the immediate="true" in the <h:commandLink> tag should work, because it forces ignoreing the validators, but it doesn't! > inputText refresh problem > ------------------------- > > Key: MYFACES-749 > URL: http://issues.apache.org/jira/browse/MYFACES-749 > Project: MyFaces > Type: Bug > Components: General > Versions: 1.1.0, 1.0.9m9 > Environment: Windows XP, Tomcat5.x > Reporter: JagMohan > > I have a drop down LEVELS with an valueChangeListener and an inputText field that is supposed to change when the drop down is changed. The inputText field is bound to a simple String object. > When the value of the drop down changes, request submits and upon processing the value of the backing bean changes. when comes to UI, its not showing the changed value in the <h:inputText> field, but its showing the updated value in <h:outputText> field. > REFERENCES > --------------------- > <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> > <h:selectOneMenu id="SELECTlevel" > immediate="true" > value="#{irisRequestQueueBean.currentRequest.level}" > disabled="#{empty irisRequestQueueBean.levels}" > valueChangeListener="#{irisRequestQueueBean.changedLevel}" > onchange="this.form.submit( );"> > <f:selectItems value="#{irisRequestQueueBean.levels}" /> > <j4j:idProxy id="levelId" /> > </h:selectOneMenu> > upon changing the level, backing bean value changes. but the below inputText not showing the updated value. but outputText is showing the correct value. > <h:inputText id="checked" size="30" value="#{irisRequestQueueBean.currentRequest.title}"> > </h:inputText> > <h:outputText value="(#{irisRequestQueueBean.currentRequest.title})"/> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
|
[jira] Commented: (MYFACES-749) inputText refresh problem [ http://issues.apache.org/jira/browse/MYFACES-749?page=comments#action_12355979 ]
Mike Kienenberger commented on MYFACES-749: ------------------------------------------- Again, this is not a bug. This is how JSF is designed to work. Immediate=true doesn't skip validation. It causes processing to stop BEFORE the validation phase. And that means it also stops processing before the model update phase. The situation in the "What we want is:" section can only be solved using the OptionalValidationFramework or something similar. It cannot be done in standard JSF. The OVF technique is the only way to "skip validation" rather than "stop processing." Please ask further questions on the mailing list rather than in this issue. That's what the mailing list is for. Could one of the committers please close this issue as "WONT FIX"? Thanks. > inputText refresh problem > ------------------------- > > Key: MYFACES-749 > URL: http://issues.apache.org/jira/browse/MYFACES-749 > Project: MyFaces > Type: Bug > Components: General > Versions: 1.1.0, 1.0.9m9 > Environment: Windows XP, Tomcat5.x > Reporter: JagMohan > > I have a drop down LEVELS with an valueChangeListener and an inputText field that is supposed to change when the drop down is changed. The inputText field is bound to a simple String object. > When the value of the drop down changes, request submits and upon processing the value of the backing bean changes. when comes to UI, its not showing the changed value in the <h:inputText> field, but its showing the updated value in <h:outputText> field. > REFERENCES > --------------------- > <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> > <h:selectOneMenu id="SELECTlevel" > immediate="true" > value="#{irisRequestQueueBean.currentRequest.level}" > disabled="#{empty irisRequestQueueBean.levels}" > valueChangeListener="#{irisRequestQueueBean.changedLevel}" > onchange="this.form.submit( );"> > <f:selectItems value="#{irisRequestQueueBean.levels}" /> > <j4j:idProxy id="levelId" /> > </h:selectOneMenu> > upon changing the level, backing bean value changes. but the below inputText not showing the updated value. but outputText is showing the correct value. > <h:inputText id="checked" size="30" value="#{irisRequestQueueBean.currentRequest.title}"> > </h:inputText> > <h:outputText value="(#{irisRequestQueueBean.currentRequest.title})"/> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
|
[jira] Commented: (MYFACES-749) inputText refresh problem [ http://issues.apache.org/jira/browse/MYFACES-749?page=comments#action_12355986 ]
Mike Kienenberger commented on MYFACES-749: ------------------------------------------- I've written a wiki document on this issue that may clear up potential misconceptions. http://wiki.apache.org/myfaces/How_The_Immediate_Attribute_Works > inputText refresh problem > ------------------------- > > Key: MYFACES-749 > URL: http://issues.apache.org/jira/browse/MYFACES-749 > Project: MyFaces > Type: Bug > Components: General > Versions: 1.1.0, 1.0.9m9 > Environment: Windows XP, Tomcat5.x > Reporter: JagMohan > > I have a drop down LEVELS with an valueChangeListener and an inputText field that is supposed to change when the drop down is changed. The inputText field is bound to a simple String object. > When the value of the drop down changes, request submits and upon processing the value of the backing bean changes. when comes to UI, its not showing the changed value in the <h:inputText> field, but its showing the updated value in <h:outputText> field. > REFERENCES > --------------------- > <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> > <h:selectOneMenu id="SELECTlevel" > immediate="true" > value="#{irisRequestQueueBean.currentRequest.level}" > disabled="#{empty irisRequestQueueBean.levels}" > valueChangeListener="#{irisRequestQueueBean.changedLevel}" > onchange="this.form.submit( );"> > <f:selectItems value="#{irisRequestQueueBean.levels}" /> > <j4j:idProxy id="levelId" /> > </h:selectOneMenu> > upon changing the level, backing bean value changes. but the below inputText not showing the updated value. but outputText is showing the correct value. > <h:inputText id="checked" size="30" value="#{irisRequestQueueBean.currentRequest.title}"> > </h:inputText> > <h:outputText value="(#{irisRequestQueueBean.currentRequest.title})"/> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
|
[jira] Updated: (MYFACES-749) inputText refresh problem [ http://issues.apache.org/jira/browse/MYFACES-749?page=all ]
JagMohan updated MYFACES-749: ----------------------------- Attachment: faces-config.xml RequestQueueBean.java test.jsp As mentioned earlier I have attached faces-config.xml, Backing bean and the jsp. Still shows same even after removing the immediate="truee". Attached files are my test case to narrow down the issue. Attached files shows that it has division select box. Upon selecting the division, Level to be displayed in the textbox followed by lable as well. But as mentioned earlier only label shows. Thanks Jag > inputText refresh problem > ------------------------- > > Key: MYFACES-749 > URL: http://issues.apache.org/jira/browse/MYFACES-749 > Project: MyFaces > Type: Bug > Components: General > Versions: 1.1.0, 1.0.9m9 > Environment: Windows XP, Tomcat5.x > Reporter: JagMohan > Attachments: RequestQueueBean.java, faces-config.xml, test.jsp > > I have a drop down LEVELS with an valueChangeListener and an inputText field that is supposed to change when the drop down is changed. The inputText field is bound to a simple String object. > When the value of the drop down changes, request submits and upon processing the value of the backing bean changes. when comes to UI, its not showing the changed value in the <h:inputText> field, but its showing the updated value in <h:outputText> field. > REFERENCES > --------------------- > <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> > <h:selectOneMenu id="SELECTlevel" > immediate="true" > value="#{irisRequestQueueBean.currentRequest.level}" > disabled="#{empty irisRequestQueueBean.levels}" > valueChangeListener="#{irisRequestQueueBean.changedLevel}" > onchange="this.form.submit( );"> > <f:selectItems value="#{irisRequestQueueBean.levels}" /> > <j4j:idProxy id="levelId" /> > </h:selectOneMenu> > upon changing the level, backing bean value changes. but the below inputText not showing the updated value. but outputText is showing the correct value. > <h:inputText id="checked" size="30" value="#{irisRequestQueueBean.currentRequest.title}"> > </h:inputText> > <h:outputText value="(#{irisRequestQueueBean.currentRequest.title})"/> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
|
[jira] Commented: (MYFACES-749) inputText refresh problem [ http://issues.apache.org/jira/browse/MYFACES-749?page=comments#action_12356007 ]
Mike Kienenberger commented on MYFACES-749: ------------------------------------------- JagMohan, Thanks for the simple example. This is the exact same situation that's being discussed on the MyFaces-User mailing list with the subject as "Help still needed with valueChangeListener" Your example did allow me to quickly test my suspicions, however. The answer (which I will also post to that thread) is that renderers for EditableValueHolders (and everything that inherits from UIInput is an EVH) render the submittedValue of the component if that value is not null. The submitted value is only set to null if the component successfully validates. By marking your pulldown component as immediate, then short-circuiting the process by calling renderResponse(), you force the inputText component to always render the submitted value. So you need to not only update the backing bean, but also the submittedValue for the backing bean. However, it might be sufficient to just set the submittedValue of the dependent component (inputText in this case) to null, which will probably force the inputText component to render the value from the backing bean. But it might render the local value of the component instead -- I really don't know. But in any case, you have to change the submittedValue of the dependent component. As I said before, this isn't a bug. It's a lack of understanding of how JSF works. That's not surprising since the whole process gets very complicated once you start using immediate. Even I didn't guess correctly -- I thought the renderer would grab the backing bean value for non-validated components. However, if you're going to use immediate, you're going to have to do a lot more digging to determine what's really going on. > inputText refresh problem > ------------------------- > > Key: MYFACES-749 > URL: http://issues.apache.org/jira/browse/MYFACES-749 > Project: MyFaces > Type: Bug > Components: General > Versions: 1.1.0, 1.0.9m9 > Environment: Windows XP, Tomcat5.x > Reporter: JagMohan > Attachments: RequestQueueBean.java, faces-config.xml, test.jsp > > I have a drop down LEVELS with an valueChangeListener and an inputText field that is supposed to change when the drop down is changed. The inputText field is bound to a simple String object. > When the value of the drop down changes, request submits and upon processing the value of the backing bean changes. when comes to UI, its not showing the changed value in the <h:inputText> field, but its showing the updated value in <h:outputText> field. > REFERENCES > --------------------- > <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> > <h:selectOneMenu id="SELECTlevel" > immediate="true" > value="#{irisRequestQueueBean.currentRequest.level}" > disabled="#{empty irisRequestQueueBean.levels}" > valueChangeListener="#{irisRequestQueueBean.changedLevel}" > onchange="this.form.submit( );"> > <f:selectItems value="#{irisRequestQueueBean.levels}" /> > <j4j:idProxy id="levelId" /> > </h:selectOneMenu> > upon changing the level, backing bean value changes. but the below inputText not showing the updated value. but outputText is showing the correct value. > <h:inputText id="checked" size="30" value="#{irisRequestQueueBean.currentRequest.title}"> > </h:inputText> > <h:outputText value="(#{irisRequestQueueBean.currentRequest.title})"/> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
| Free embeddable forum powered by Nabble | Forum Help |