ICEfaces
  1. ICEfaces
  2. ICE-7103

Model not updated with ice:dataTable and f:ajax on h:selectBooleanCheckbox and PARTIAL_STATE_SAVING=false

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-2.0.0.GA
    • Fix Version/s: 3.0.RC1, 3.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      Mojarra 2.1.2
    • Assignee Priority:
      P2

      Description

      Because of http://java.net/jira/browse/JAVASERVERFACES-2041 we need to disable partial state saving in web.xml.

      However, this leads to a problem in a complex situation including composite components, ice:dataTable, h:selectBooleanCheckbox and f:ajax

        Activity

        Hide
        Adrian Gygax added a comment - - edited

        Attached example application demonstrating the bug.

        A composite component containing an ice.dataTable with a selectBooleanCheckbox (see my.xhtml)

        By clicking the check box, the model (MyBean) is not updated.
        The inputText does work as expected.

        • If we use an h:dataTable the behavior is as expected.
        • If partial state saving is enabled the behaviour is as expected.

        We actually don't want to disable partial state saving but we are forced to do so by http://java.net/jira/browse/JAVASERVERFACES-2041. If that bug was fixed in Mojarra this bug here would actually not be an issue for us.

        Show
        Adrian Gygax added a comment - - edited Attached example application demonstrating the bug. A composite component containing an ice.dataTable with a selectBooleanCheckbox (see my.xhtml) By clicking the check box, the model (MyBean) is not updated. The inputText does work as expected. If we use an h:dataTable the behavior is as expected. If partial state saving is enabled the behaviour is as expected. We actually don't want to disable partial state saving but we are forced to do so by http://java.net/jira/browse/JAVASERVERFACES-2041 . If that bug was fixed in Mojarra this bug here would actually not be an issue for us.
        Hide
        Ted Goddard added a comment -

        We may be able to provide f:ajax functionality but without the state-saving problems. Does the test case include pages that illustrate the desired f:ajax use?

        Show
        Ted Goddard added a comment - We may be able to provide f:ajax functionality but without the state-saving problems. Does the test case include pages that illustrate the desired f:ajax use?
        Hide
        Adrian Gygax added a comment -

        Yes, the test case illustrates the desired f:ajax use. It's in resources\table\my.xhtml.

        In the example, if a checkbox is clicked it's immediately deselected if using ice:dataTable.

        Show
        Adrian Gygax added a comment - Yes, the test case illustrates the desired f:ajax use. It's in resources\table\my.xhtml. In the example, if a checkbox is clicked it's immediately deselected if using ice:dataTable.
        Hide
        Ted Goddard added a comment -

        This should be tested with ace:ajax (Mark suggested this, so he may be a good candidate). If that fails similarly, we will want to provide a replacement for:

        <h:selectBooleanCheckbox value="#

        {item.isSelected}">
        <f:ajax execute="@this" render="@all"/>
        </h:selectBooleanCheckbox>

        This mimics singleSubmit, so it may be sufficient to replace h:selectBooleanCheckbox with an ice: or ace: component.

        The following approach could be investigated:

        A new component <ice:ajax> acting as a wrapper:

        <ice:ajax execute="@this" render="@all">
        <h:selectBooleanCheckbox value="#{item.isSelected}

        ">
        </ice:ajax>

        prior to rendering children would set onclick and onchange values explicitly given knowledge of what is appropriate for each component. This would result in very similar markup to f:ajax. The drawback is that knowledge of "ajax" for each component would be contained in ice:ajax. This lacks object orientation, but would be functional and maintainable given that the current JSF components are standardized.

        Show
        Ted Goddard added a comment - This should be tested with ace:ajax (Mark suggested this, so he may be a good candidate). If that fails similarly, we will want to provide a replacement for: <h:selectBooleanCheckbox value="# {item.isSelected}"> <f:ajax execute="@this" render="@all"/> </h:selectBooleanCheckbox> This mimics singleSubmit, so it may be sufficient to replace h:selectBooleanCheckbox with an ice: or ace: component. The following approach could be investigated: A new component <ice:ajax> acting as a wrapper: <ice:ajax execute="@this" render="@all"> <h:selectBooleanCheckbox value="#{item.isSelected} "> </ice:ajax> prior to rendering children would set onclick and onchange values explicitly given knowledge of what is appropriate for each component. This would result in very similar markup to f:ajax. The drawback is that knowledge of "ajax" for each component would be contained in ice:ajax. This lacks object orientation, but would be functional and maintainable given that the current JSF components are standardized.
        Hide
        Adrian Gygax added a comment -

        Have you found the cause why this works with <h:dataTable> but not with <ice:dataTable>?

        Show
        Adrian Gygax added a comment - Have you found the cause why this works with <h:dataTable> but not with <ice:dataTable>?
        Hide
        Adrian Gygax added a comment -

        As there seems to be no progress on this issue we created a patched Mojarra 2 version with the patch from http://java.net/jira/browse/JAVASERVERFACES-1845. This allows us to use Partial State Saving again and we don't stumble on this bug anymore

        Show
        Adrian Gygax added a comment - As there seems to be no progress on this issue we created a patched Mojarra 2 version with the patch from http://java.net/jira/browse/JAVASERVERFACES-1845 . This allows us to use Partial State Saving again and we don't stumble on this bug anymore
        Hide
        Mark Collette added a comment -

        Fixed by ICE-7142.

        Show
        Mark Collette added a comment - Fixed by ICE-7142 .

          People

          • Assignee:
            Mark Collette
            Reporter:
            Adrian Gygax
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: