Hi I've started doing some work on this.
On 02/02/07, Adam Winer <[EMAIL PROTECTED]> wrote:
(1) Page in data as necessary, automatically
I'm not entirely sure how this is supposed to be done with the CollectionModel. As we're using JPA what we want is a something like: // build the query query.setFirstResult(10); query.setMaxResults(10); List list = query.getResultList(); // wrap the result list in a datamodel. but the CollectionModel isn't updated with paging information - it seems to be stored on the component. Any hints ;)
(2) Report good permanent row keys, so that adding/removing rows gets picked up without any off-by-one errors.
It should be possible to use the business key of the entity for this, just some problems arise as the EntityManager isn't always available.
(3) Perform sorting directly on the model
This works nicely - translating the sort criterion into an order by and an order by into a List<SortCriterion>. Trinidad doesn't seem to support a List<SortCriterion> with more than one element however (it just displays the little arrow for the first criterion)?
-- Adam On 2/1/07, Peter Muir <[EMAIL PROTECTED]> wrote: > > Hello there, > > I'm hoping to do some work to improve the integration of Seam and > Trinidad. I've tried to explain the various Seam specific bits but > I'm very happy to clarify :) > > Firstly, issues that I know of (and have been reported by Seam users): > > * Seam has a tag validateAll, which traverses down the JSF component > tree looking for UIInput components and adding a validator to them > (just saves you having to add the validator to each UIInput). This > can be fixed in Seam (http://jira.jboss.org/jira/browse/JBSEAM-501) > > * There is a problem outjecting (this is Seam's way of making an > object available in JSF) a Trinidad TreeModel (none of the children > appear). It works quite happily (for example) if you outject an > object, and then convert it to a (ChildProperty)TreeModel in a > facelets function. Anyone got any ideas? Or do I need to dig into > this ;) > > * Seam uses some EL enhancements (by Stan Silvert) to allow passing of > method parameters. These don't work when you use Trinidad BUT I don't > think this is worth fixing as there is supposed to be an enhancement > to EL (by Jacob Hookom) becoming available that will allow method > parameters to work anyway > (http://jira.jboss.org/jira/browse/JBSEAM-697) > > Secondly, a few ideas for making the two frameworks work better > together - my suggestion is to distribute these with Seam as > jboss-seam-trinidad.jar - an optional jar you could include in your > project to get this extra functionality. > > 1) @TreeModel & @TreeModelSelection > > The idea here is that in your Java code you could do something like > > @TreeModel(childProperty="children") > private List<Foo> foo; > > and then, in your view, it would be magically converted to a tree > model. Further, when an action is called from the view, if one of the > nodes of the tree was selected, a property annotated with > @TreeModelSelection would contain the object representing the node. > This already works with datamodels so should be straightforward. > > 2) Data paging: Seam includes the ability to page through a query, > only retrieving that pages worth of records from the persistence layer > BUT it requires quite a lot of controls on the front end. Trinidad > has good paging controls BUT will load all the data and then page in > JSF. It would be good to get the best of both and make trinidad > request only the records it needs. My initial ideas about achieving > this are: > > add in some sort of PagingController which Seam could override to do its > paging > > or > > Use the existing-in-Trinidad RangeChangeEvent to alter query parameters > > 3) Perhaps an @MenuModel annotation (similar to treemodel) > > Thirdly, once you guys have any sort of release out (that we can say > to Seam users - use this version), we'll add an example of using > Trinidad and Seam to the set of Seam examples. > > I'd like to hear of any incompatibilities you know about and any other > integration ideas you guys have :) Also, it would be great to hear > how close the areas I've mentioned above are to being in their final > form or whether there is a lot of refactoring to do. > > I'm tracking this via http://jira.jboss.org/jira/browse/JBSEAM-754 > > Thanks > > Pete >
