MyFaces Core
  1. MyFaces Core
  2. MYFACES-2342

New objects added for new api in UIViewRoot, UIComponent and UIComponentBase could be saved and restored

    Details

    • Type: Task Task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0
    • Component/s: JSR-314
    • Labels:
      None

      Description

      The following fields added on jsf 2.0 should be included in saveState/restoreState (adding partial support)

      UIViewRoot._viewScope
      UIComponent._systemEventListenerClassMap
      UIComponentBase._behaviorsMap

      I'll check UIComponent hierarchy again for another fields that needs to be included on saveState/restoreState methods.

        Activity

        Hide
        Leonardo Uribe added a comment -

        Before release 2.0.0 we did all necessary stuff, so we can close this issue.

        Show
        Leonardo Uribe added a comment - Before release 2.0.0 we did all necessary stuff, so we can close this issue.
        Hide
        Leonardo Uribe added a comment -

        I did some test and it was found that properties returning MethodExpression and MethodBinding does not need to deal with PartialStateHolder. The properties changed where:

        UICommand.actionExpression
        UICommand.actionListener
        UIInput.valueChangeListener
        UIInput.validator (only the method returning it)
        UIViewRoot.beforePhaseListener
        UIViewRoot.afterPhaseListener

        StateHelper handles by default all properties as StateHolder, so we can use it directly. It is true FacesListener, Validator, Converter could implement StateHolder or PartialStateHolder, but the methods previously mentioned does not store this classes. There exists MethodBinding / MethodExpression classes that implements StateHolder, but checking its implementations it uses Serializable in most cases, or are never called from facelets (because MethodBinding is deprecated).

        This methods are never called from facelets:

        UICommand.actionListener
        UIInput.valueChangeListener
        UIInput.validator (only the method returning it)

        Instead, methods like UICommand.addActionListener, UIInput.addValueChangeListener and UIInput.addValidator are used, and the lists backing this classes handles PartialStateHolder case.

        The property @JSFComponent.stateHolder in jsf 2.0 now changes. It now indicate properties that need to deal with PartialStateHolder interface. One example is UIOutput.converter.

        It was also found that _DeltaList count instances of Serializable or no StateHolder classes as if it could change the delta. According to the documentation, if a class (FacesListener) needs to handle state it must implements StateHolder/PartialStateHolder. Serializable or no StateHolder instances are consider inmutables. Note that UIOutput.converter takes that into account that.

        Show
        Leonardo Uribe added a comment - I did some test and it was found that properties returning MethodExpression and MethodBinding does not need to deal with PartialStateHolder. The properties changed where: UICommand.actionExpression UICommand.actionListener UIInput.valueChangeListener UIInput.validator (only the method returning it) UIViewRoot.beforePhaseListener UIViewRoot.afterPhaseListener StateHelper handles by default all properties as StateHolder, so we can use it directly. It is true FacesListener, Validator, Converter could implement StateHolder or PartialStateHolder, but the methods previously mentioned does not store this classes. There exists MethodBinding / MethodExpression classes that implements StateHolder, but checking its implementations it uses Serializable in most cases, or are never called from facelets (because MethodBinding is deprecated). This methods are never called from facelets: UICommand.actionListener UIInput.valueChangeListener UIInput.validator (only the method returning it) Instead, methods like UICommand.addActionListener, UIInput.addValueChangeListener and UIInput.addValidator are used, and the lists backing this classes handles PartialStateHolder case. The property @JSFComponent.stateHolder in jsf 2.0 now changes. It now indicate properties that need to deal with PartialStateHolder interface. One example is UIOutput.converter. It was also found that _DeltaList count instances of Serializable or no StateHolder classes as if it could change the delta. According to the documentation, if a class (FacesListener) needs to handle state it must implements StateHolder/PartialStateHolder. Serializable or no StateHolder instances are consider inmutables. Note that UIOutput.converter takes that into account that.
        Hide
        Leonardo Uribe added a comment -

        Also, it is necessary to apply PartialStateHolder to objects created in facelets tag handlers.

        Show
        Leonardo Uribe added a comment - Also, it is necessary to apply PartialStateHolder to objects created in facelets tag handlers.

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Leonardo Uribe
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development