t:tree2 navigation, expand and collapse image component manipulation does not 
work well with PSS on JSF 2
---------------------------------------------------------------------------------------------------------

                 Key: TOMAHAWK-1540
                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1540
             Project: MyFaces Tomahawk
          Issue Type: Bug
          Components: JSF2, Tree2
    Affects Versions: 1.1.9
            Reporter: Leonardo Uribe
            Assignee: Leonardo Uribe


In JSF 1.2 and lower, HtmlTreeRenderer used a hack on expand, collapse and 
navigation images to force render ids for graphic images, because on client 
side mode they are required by javascript part. To do that, it was used a 
counter inside the renderer class. 

That previous hack worked well, because the ids are not required to save the 
component state.

In JSF 2.0, Partial State Saving was introduced, and to work correctly it 
requires some stability on the ids generated. The problem is the ids for those 
components are changed on render response time. When state saving occur, the 
state is saved using those ids, but on a postback the view is built again, but 
since the ids are not changed on that time, it is not possible to restore the 
state correctly. This effect does not break myfaces core PSS, bug it breaks 
mojarra, because they use the ids even for save facets.

The solution is create a facelet tag handler that changes the ids on the right 
time and remove the hack from the renderer.

Other problem present is how the navigation images are rendered. For render 
them, an image component is created and then it is called setParent(), so when 
getClientId is called later the id will contain the parent container client id 
too. This component is never saved on the state, so it behaves like a transient 
one, but on PSS a listener is used to track tree changes, and since it is not 
marked to be transient, it is added to the list for being restored.

The solution is mark this component as transient, calling setTransient(true).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to