ICEfaces
  1. ICEfaces
  2. ICE-1741

submittedValue of component remains stored during page navigation

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.3, 1.6DR#5
    • Fix Version/s: 2.0-Alpha3, 2.0.0
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      any
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      created a simple test case:

      - pageA contains inputText and commandButton to navigate to pageB
      - pageB contains outputText to show inputText's value from pageA and commandButton to navigate back to pageA
      - both the inputText and outputText components are bound to the same backing bean

      only if the standardRequestScope context-param is set to true in web.xml, the submittedValue is cleared when the user navigates back to pageA
      Show
      created a simple test case: - pageA contains inputText and commandButton to navigate to pageB - pageB contains outputText to show inputText's value from pageA and commandButton to navigate back to pageA - both the inputText and outputText components are bound to the same backing bean only if the standardRequestScope context-param is set to true in web.xml, the submittedValue is cleared when the user navigates back to pageA

      Description

      during page navigation, the submittedValue of inputText components is not cleared.
      this is only possible when the standardRequestScope context parameter in web.xml is set to true.
      if there are any validation errors and the user navigates back to the original page, the old submittedValues
      are still remaining. usually one would expect the submittedValues always to be cleared when a real navigation
      is initiated to another page

        Issue Links

          Activity

          Michael Thiem created issue -
          Hide
          Michael Thiem added a comment -

          The same happens in 1.5.3. Only when the standardRequestScope in web.xml is set to true,
          the request scoped backing beans become finalized and reinstantiated when navigating between
          different pages. This is to be expected default behaviour...

          Show
          Michael Thiem added a comment - The same happens in 1.5.3. Only when the standardRequestScope in web.xml is set to true, the request scoped backing beans become finalized and reinstantiated when navigating between different pages. This is to be expected default behaviour...
          Michael Thiem made changes -
          Field Original Value New Value
          ICEfaces Forum Reference http://www.icefaces.org/JForum/posts/list/4910.page
          Affects Version/s 1.5.3 [ 10030 ]
          Philip Breau made changes -
          Support Case References https://www.icesoft.ca:4443/supportilla/show_bug.cgi?id=4222
          Support Customer Ref. #s 739
          Ken Fyten made changes -
          Fix Version/s 1.7 [ 10080 ]
          Assignee Mircea Toma [ mircea.toma ]
          Ken Fyten made changes -
          Fix Version/s 1.6.1 [ 10070 ]
          Fix Version/s 1.7 [ 10080 ]
          Assignee Priority P2
          Hide
          Mircea Toma added a comment -

          Are the navigation rules doing redirects? If forwards are used then no new requests are made, requests that will update the request parameters, thus the parameters used in the first request are reused to render next view.

          Show
          Mircea Toma added a comment - Are the navigation rules doing redirects? If forwards are used then no new requests are made, requests that will update the request parameters, thus the parameters used in the first request are reused to render next view.
          Hide
          Michael Thiem added a comment -

          That's correct. Using redirects in navigation rules cause the submitted values to be overwritten on each redirect to another page. When redirects are commented out and forwards are used instead the values will be reused.

          Show
          Michael Thiem added a comment - That's correct. Using redirects in navigation rules cause the submitted values to be overwritten on each redirect to another page. When redirects are commented out and forwards are used instead the values will be reused.
          Hide
          Michael Thiem added a comment -

          this test case can be adjusted appropriately. when using redirects the values are null anytime a navigation rule is initiated.
          when redirects are commented out, the textField's value will be stored in the bean property and then be set to null when navigating back to pageA. (standardRequestScope must be set to true then).

          Show
          Michael Thiem added a comment - this test case can be adjusted appropriately. when using redirects the values are null anytime a navigation rule is initiated. when redirects are commented out, the textField's value will be stored in the bean property and then be set to null when navigating back to pageA. (standardRequestScope must be set to true then).
          Michael Thiem made changes -
          Attachment forum-4756.war [ 10633 ]
          Michael Thiem made changes -
          Attachment forum-4756-src.zip [ 10634 ]
          Hide
          Mircea Toma added a comment -

          After taking a close look at what's going on I can say that the behavior is the correct one.

          • Component level
            The submitted value acquired with HtmlInputText.getSubmittedValue() is null on page navigation from pageB to pageA because a new component tree is created (when using D2DFaceletViewHandler) thus HtmlInputText's 'submittedValue' field is initialized with the null value.
          • Bean level
            When standardRequestScope=false the request is long lived, so even if the beans have request scope they are reused between Ajax requests and recreated only on full page requests such as page load, reload or redirect.
            So, in the attached test case com.icesoft.icefaces.samples.request.Request bean is instantiated only once when forwards are used and that's why we don't see it's 'stringOne' field reset.

          'standardRequestScope' was specifically introduced for cases where applications require standard JSF behavior.

          Show
          Mircea Toma added a comment - After taking a close look at what's going on I can say that the behavior is the correct one. Component level The submitted value acquired with HtmlInputText.getSubmittedValue() is null on page navigation from pageB to pageA because a new component tree is created (when using D2DFaceletViewHandler) thus HtmlInputText's 'submittedValue' field is initialized with the null value. Bean level When standardRequestScope=false the request is long lived, so even if the beans have request scope they are reused between Ajax requests and recreated only on full page requests such as page load, reload or redirect. So, in the attached test case com.icesoft.icefaces.samples.request.Request bean is instantiated only once when forwards are used and that's why we don't see it's 'stringOne' field reset. 'standardRequestScope' was specifically introduced for cases where applications require standard JSF behavior.
          Mircea Toma made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Won't Fix [ 2 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Assignee Priority P2
          Assignee Mircea Toma [ mircea.toma ]
          Hide
          Ken Fyten added a comment -

          This issue is causing a lot of problems for many customers where adopting standard request scope is not a viable solution. We should consider clearing the old component tree ourselves when a page navigation event occurs.

          Show
          Ken Fyten added a comment - This issue is causing a lot of problems for many customers where adopting standard request scope is not a viable solution. We should consider clearing the old component tree ourselves when a page navigation event occurs.
          Ken Fyten made changes -
          Resolution Won't Fix [ 2 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Assignee Priority P2
          Assignee Ted Goddard [ ted.goddard ]
          Hide
          Ted Goddard added a comment -

          Are the backing beans the same on the two different pages? The observed behaviour may have nothing to do with the state of the component tree.

          Show
          Ted Goddard added a comment - Are the backing beans the same on the two different pages? The observed behaviour may have nothing to do with the state of the component tree.
          Hide
          Michael Thiem added a comment -

          The bean is the same on both pages

          Show
          Michael Thiem added a comment - The bean is the same on both pages
          Hide
          Ted Goddard added a comment -

          Since the bean is the same on both pages, this could be regarded as expected application behavior. In many cases, the ability to share data between pages is useful. In this case, the developer does not want to share data between pages, so perhaps the solution is to use distinctly named managed beans on the two different pages.

          Show
          Ted Goddard added a comment - Since the bean is the same on both pages, this could be regarded as expected application behavior. In many cases, the ability to share data between pages is useful. In this case, the developer does not want to share data between pages, so perhaps the solution is to use distinctly named managed beans on the two different pages.
          Ken Fyten made changes -
          Fix Version/s 1.7 [ 10080 ]
          Fix Version/s 1.6.1 [ 10070 ]
          Hide
          Ted Goddard added a comment -

          If the page is produced by JSP rather than Facelets, the submitted values may be retained in the component tree.
          Since Facelets reproduces the component tree from the handlers each time, the two may behave differently.

          Mircea, could you investigate a JSP case as well as the Facelets case?

          Two potential fixes have been proposed:
          1. clear out the submittedValues in the component tree for each request
          2. regenerate the component for each request in JSP mode

          2. is potentially higher risk because of the interaction with ICEfaces JSP parsing and may be better addressed when we adopt full JSP component tree generation, such as with JSF 1.2.

          Show
          Ted Goddard added a comment - If the page is produced by JSP rather than Facelets, the submitted values may be retained in the component tree. Since Facelets reproduces the component tree from the handlers each time, the two may behave differently. Mircea, could you investigate a JSP case as well as the Facelets case? Two potential fixes have been proposed: 1. clear out the submittedValues in the component tree for each request 2. regenerate the component for each request in JSP mode 2. is potentially higher risk because of the interaction with ICEfaces JSP parsing and may be better addressed when we adopt full JSP component tree generation, such as with JSF 1.2.
          Ted Goddard made changes -
          Assignee Ted Goddard [ ted.goddard ] Mircea Toma [ mircea.toma ]
          Ken Fyten made changes -
          Fix Version/s 1.7DR#3 [ 10112 ]
          Fix Version/s 1.7 [ 10080 ]
          Hide
          Mircea Toma added a comment -

          Fixed as a side-effect when fixing ICE-2189. Forward navigation rules now force a page reload which in turn re-creates the request map.

          Show
          Mircea Toma added a comment - Fixed as a side-effect when fixing ICE-2189 . Forward navigation rules now force a page reload which in turn re-creates the request map.
          Mircea Toma made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Sam Xiao made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Sam Xiao made changes -
          Attachment ICE-1741.war [ 10748 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #15252 Mon Nov 26 17:53:29 MST 2007 mircea.toma Stop propagating attributes between page reloads.

          ICE-1741
          Files Changed
          Commit graph MODIFY /icefaces/branches/icefaces-1.6/icefaces/core/src/com/icesoft/faces/webapp/http/portlet/PortletExternalContext.java
          Commit graph MODIFY /icefaces/branches/icefaces-1.6/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/ServletExternalContext.java
          Hide
          Mircea Toma added a comment -

          Stop propagating attributes between page reloads.

          Show
          Mircea Toma added a comment - Stop propagating attributes between page reloads.
          Mircea Toma made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Fix Version/s 1.6.3 [ 10120 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #15310 Thu Dec 06 17:48:01 MST 2007 mircea.toma Revert request attribute map lifecycle behaviour.
          ICE-1741
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/ServletExternalContext.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/portlet/PortletExternalContext.java
          Hide
          Ken Fyten added a comment -

          Re-opening as the fix for this causes backward-compatibility issues and must be reverted for the 1.7 release.

          Show
          Ken Fyten added a comment - Re-opening as the fix for this causes backward-compatibility issues and must be reverted for the 1.7 release.
          Ken Fyten made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Assignee Priority P2
          Assignee Mircea Toma [ mircea.toma ]
          Hide
          Ken Fyten added a comment -

          Need to replace the current extended Request scope with Std. Request scope behavior + a new scope.

          Show
          Ken Fyten added a comment - Need to replace the current extended Request scope with Std. Request scope behavior + a new scope.
          Ken Fyten made changes -
          Link This issue depends on ICE-1393 [ ICE-1393 ]
          Ken Fyten made changes -
          Assignee Mircea Toma [ mircea.toma ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #15314 Fri Dec 07 10:54:47 MST 2007 mircea.toma Revert request attribute map lifecycle behaviour.
          ICE-1741
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/ServletExternalContext.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/portlet/PortletExternalContext.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #15315 Fri Dec 07 10:55:08 MST 2007 mircea.toma Revert request attribute map lifecycle behaviour.
          ICE-1741
          Files Changed
          Commit graph MODIFY /icefaces/branches/icefaces-1.6/icefaces/core/src/com/icesoft/faces/webapp/http/portlet/PortletExternalContext.java
          Commit graph MODIFY /icefaces/branches/icefaces-1.6/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/ServletExternalContext.java
          Ken Fyten made changes -
          Fix Version/s 2.0 [ 10032 ]
          Fix Version/s 1.7DR#3 [ 10112 ]
          Fix Version/s 1.6.3 [ 10120 ]
          Ken Fyten made changes -
          Link This issue is duplicated by ICE-1343 [ ICE-1343 ]
          Hide
          Mircea Toma added a comment -

          The code area needing to be changed (ServletExternalContext.class) to fix this issue will reside in JSF 2.0.

          Show
          Mircea Toma added a comment - The code area needing to be changed (ServletExternalContext.class) to fix this issue will reside in JSF 2.0.
          Mircea Toma made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Fix Version/s 2.0.0 [ 10230 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Mircea Toma
              Reporter:
              Michael Thiem
            • Votes:
              10 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: