[ 
http://issues.apache.org/jira/browse/MYFACES-331?page=comments#action_12315846 
] 

Mike Kienenberger commented on MYFACES-331:
-------------------------------------------

> I analysed your code of RowAndColumnRelationshipsHtmlDataTable.saveState and 
> saw that you don´t save the state of the dynamically added components as I 
> would expect.

My first iteration did save the state of the components, but since the 
HtmlDataTable was also saving them, I would get another duplicate set of the 
controls every time the page restored.   I suppose I could go and remove all of 
the controls before save/restore, but the current implementation behavior is 
inconsistent.   Some of the components are saved by dataTable (the first 
UIColumn and the facet footer), but some aren't (the UIColumns element).

> Maybe you can save a lot of trouble if you use the x:columns component in the 
> jsf page b/c I don´t see any reasons for the dynamic way you did

I appreciate your suggestion, but this composite componet is used all over the 
place.   I don't want to have to repeat the jsp code everywhere -- I just want 
to be able to use <mycomponent model="x">

But even if I did it some other way (jsp include or typed them out fully each 
time), there'd still be a bug ;)

> You have to save the state of the valuebindings (don´t set them to null 
> before calling super.saveState()). That´s the reason why the UIColumns 
> component has a null value ofter refreshing.

Are you saying that under the new code, a UIColumns object which has no value 
binding will not be restored?  That sounds very inconsistent and arbitrary.   
The UIOutput and UICommand objects are restored even after the value binding 
and action listener are set to null before saving.

> You use some custom valuebinding implementations which don´t implement 
> saveState and restoreState Methods. 

Right, I recreate and reassign these bindings rather than save and restore 
them.   The only "state" necessary to restore my custom composite component is 
the name of the model backing bean, provided that dataTable is also saving its 
state properly.

Thanks for looking into this.

> post-Mathias-Broekelmann x:dataTable doesn't work with dynamically-created 
> UIColumns data.
> ------------------------------------------------------------------------------------------
>
>          Key: MYFACES-331
>          URL: http://issues.apache.org/jira/browse/MYFACES-331
>      Project: MyFaces
>         Type: Bug
>     Versions: Nightly Build
>     Reporter: Mike Kienenberger
>     Assignee: Mathias Broekelmann
>  Attachments: RowAndColumnRelationshipComponent.zip
>
> Mathias, I still have to use the BEFORE_SVN_REORG version as your new
> dataTable code still isn't working with programmically-created
> UIColumns elements -- they get lost after a page refresh, probably due
> to a save/restore state issue.   My programmically-created 
> footer-with-UICommand and UI-Column-with-UIOutput row header are saved and 
> restored properly, though.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to