ICEfaces
  1. ICEfaces
  2. ICE-5226

component binding does not work in View scope and partial submit with compat

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha2
    • Fix Version/s: 2.0-Alpha3, 2.0.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      jsf2.0, icefaces 2.0, compat
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial, Compatibility/Configuration

      Description

      Using View Scope and component binding, and example of HtmlInputText with session scope for both jsf2.0 and ICEfaces 2.0 bind the value of the component to the component directly bound in the backing bean. Using partial submit, the correct value is not always displayed. However, with View scope, (for example using TextEntry in compat showcase and add a component binding to the backing bean), the bean is not the same instance for each partial submit and the component bound directly to backing bean is null.

        Issue Links

          Activity

          Hide
          Mark Collette added a comment -

          Let's assume we have a state holder bean, in session or view scope. Now let's add a standard request scope bean, to hold our component binding, and act as a a controller. In the faces-config.xml, add the following:

          <managed-bean>
          <managed-bean-name>stateHolder</managed-bean-name>
          <managed-bean-class>org.icefaces.StateHolder</managed-bean-class>
          <managed-bean-scope>session</managed-bean-scope>
          </managed-bean>

          <managed-bean>
          <managed-bean-name>controller</managed-bean-name>
          <managed-bean-class>org.icefaces.Controller</managed-bean-class>
          <managed-bean-scope>request</managed-bean-scope>
          <managed-property>
          <property-name>stateHolder</property-name>
          <value>#

          {stateHolder}

          </value>
          </managed-property>
          </managed-bean>

          Now, the controller can use component bindings as well as regular ValueBindings to the display, and receive events. It doesn't matter that it can't hold state, since it has a reference to the session scoped bean, which simply holds long-term state.

          Show
          Mark Collette added a comment - Let's assume we have a state holder bean, in session or view scope. Now let's add a standard request scope bean, to hold our component binding, and act as a a controller. In the faces-config.xml, add the following: <managed-bean> <managed-bean-name>stateHolder</managed-bean-name> <managed-bean-class>org.icefaces.StateHolder</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> </managed-bean> <managed-bean> <managed-bean-name>controller</managed-bean-name> <managed-bean-class>org.icefaces.Controller</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> <managed-property> <property-name>stateHolder</property-name> <value># {stateHolder} </value> </managed-property> </managed-bean> Now, the controller can use component bindings as well as regular ValueBindings to the display, and receive events. It doesn't matter that it can't hold state, since it has a reference to the session scoped bean, which simply holds long-term state.
          Hide
          Mark Collette added a comment -

          Added a request scoped bean to hold the component binding, and to receive the ValueChangeEvent which made use of the component binding. Didn't need to tie the two beans together, since the new controller only needed static state from the model.

          Subversion 21550
          glimmer\compat\samples\component-showcase\src\org\icefaces\application\showcase\view\bean\examples\component\dataPaginator\DataScrollingController.java
          glimmer\compat\samples\component-showcase\src\org\icefaces\application\showcase\view\bean\examples\component\dataPaginator\DataScrollingModel.java
          glimmer\compat\samples\component-showcase\web\WEB-INF\includes\examples\custom\dataTable-dataScrolling.xhtml

          Show
          Mark Collette added a comment - Added a request scoped bean to hold the component binding, and to receive the ValueChangeEvent which made use of the component binding. Didn't need to tie the two beans together, since the new controller only needed static state from the model. Subversion 21550 glimmer\compat\samples\component-showcase\src\org\icefaces\application\showcase\view\bean\examples\component\dataPaginator\DataScrollingController.java glimmer\compat\samples\component-showcase\src\org\icefaces\application\showcase\view\bean\examples\component\dataPaginator\DataScrollingModel.java glimmer\compat\samples\component-showcase\web\WEB-INF\includes\examples\custom\dataTable-dataScrolling.xhtml
          Hide
          Mark Collette added a comment -

          This was the only component binding in compat component-showcase.

          Show
          Mark Collette added a comment - This was the only component binding in compat component-showcase.
          Hide
          Alejandro Cuervo added a comment -

          it doesn't work, the state holder bean is also reload when dataPaginator or another component with partiall submit is clicked

          Show
          Alejandro Cuervo added a comment - it doesn't work, the state holder bean is also reload when dataPaginator or another component with partiall submit is clicked
          Hide
          Alejandro Cuervo added a comment -

          the state holder bean has view scope

          Show
          Alejandro Cuervo added a comment - the state holder bean has view scope

            People

            • Assignee:
              Mark Collette
              Reporter:
              Judy Guglielmin
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: