[jboss-user] [JBoss Seam] - Re: @DataModel(scope=CONVERSATION) banned, why?
do-not-reply at jboss.com
Mon Jul 16 05:29:04 EDT 2007
well, there was problem when I use facelet composition (2 levels templating) and my @DataModel private Map myMap was not tied to a proxy-based collection. The map can be displayed in a table at the first time when the composed page was rendered. But I wanted such control: there was a s:button in the same page calling showFacts() which will set the boolean renderMyMapTable to true. If I click this button and load (in fact) the same page, the map table was not loaded any more. Seam might treat them as two different pages....
There is a work around to this. Put all the Map.Entry in myMap to a list (type: List<Map.Entry<MyKey, MyValue>>) and make the list conversation bean managed. Write a getter for this list and expose the getter in business interface. Ask <h:dataTable> to iterate the myMapEntryList if the boolean render flag is set to true. This way the map table can be shown/folded as many times as the user wishes. Tested it and it works well.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4064467#4064467
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4064467
More information about the jboss-user