This content has been marked as final.
Show 3 replies
-
1. Re: @DataModel(scope=CONVERSATION) banned, why?
dan.j.allen Jul 15, 2007 6:34 PM (in response to ellenzhao)I believe it has to do with the fact that a DataModel is either attached to the scope of the owning component or it is placed in PAGE context when used on a stateless component. The restriction has to do with how Seam maintains the row selection. It isn't meant to be tossed out into the great wide open.
-
2. Re: @DataModel(scope=CONVERSATION) banned, why?
amitev Jul 16, 2007 2:14 AM (in response to ellenzhao)And i don't see a reason @DataModel to be in converstation scope, you need it on one page only.
-
3. Re: @DataModel(scope=CONVERSATION) banned, why?
ellenzhao Jul 16, 2007 5:29 AM (in response to ellenzhao)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.